修訂 | 37 (tree) |
---|---|
時間 | 2009-02-27 13:54:36 |
作者 | karasimiso |
<フォント>のデフォルト値修正
@@ -305,7 +305,12 @@ | ||
305 | 305 | |
306 | 306 | SDL_Surface* Library::createString(const char* text, const char* fontPath, int size, const SDL_Color& color, int style) |
307 | 307 | { |
308 | - TTF_Font* font = TTF_OpenFont(fontPath, size); | |
308 | + if ( *fontPath == 0 ) { | |
309 | + return TTF_RenderUTF8_Blended(getSystemFont(), text, color); | |
310 | + } | |
311 | + | |
312 | + TTF_Font* font; | |
313 | + font = TTF_OpenFont(fontPath, size); | |
309 | 314 | if ( !font ) { |
310 | 315 | cerr << "Library::createString(text,fontpath,size,color,style);" << endl; |
311 | 316 | cerr << "フォントを開けませんでした。" << endl; |
@@ -360,7 +365,7 @@ | ||
360 | 365 | return keyboardMap[name]; |
361 | 366 | } |
362 | 367 | |
363 | -const TTF_Font* Library::getSystemFont() | |
368 | +TTF_Font* Library::getSystemFont() | |
364 | 369 | { |
365 | 370 | return systemFont; |
366 | 371 | } |
@@ -250,4 +250,5 @@ | ||
250 | 250 | bool Monitor::keyReleased(SceneMediator* mediator) |
251 | 251 | { |
252 | 252 | keypress = false; |
253 | + return true; | |
253 | 254 | } |
@@ -51,7 +51,7 @@ | ||
51 | 51 | static SDL_Surface* createString(const char* text, const SDL_Color* color); |
52 | 52 | static SDL_Surface* createFilledString(const char* text, const SDL_Color& fg, const SDL_Color& bg); |
53 | 53 | static SDL_Surface* createString(const char* text, const char* fontPath, int size, const SDL_Color& color, int style); |
54 | - static const TTF_Font* getSystemFont(); | |
54 | + static TTF_Font* getSystemFont(); | |
55 | 55 | static SDL_Surface* loadImage(const string& file); |
56 | 56 | static void freeImages(); |
57 | 57 | static SDLKey getKeySym(string name); |
@@ -69,6 +69,7 @@ | ||
69 | 69 | else { |
70 | 70 | invalidElement(name); |
71 | 71 | } |
72 | + return NULL; | |
72 | 73 | } |
73 | 74 | |
74 | 75 | void KeyEntryElement::endElement() |
@@ -202,6 +202,7 @@ | ||
202 | 202 | else { |
203 | 203 | invalidElement(name); |
204 | 204 | } |
205 | + return NULL; | |
205 | 206 | } |
206 | 207 | |
207 | 208 | void ActionFOElement::endElement() |