comparison test/testime.c @ 4637:8c229370ddba

Fix for deleting the last uncommit character
author Jjgod Jiang <gzjjgod@gmail.com>
date Thu, 12 Aug 2010 16:00:47 +0200
parents 3e69e077cb95
children 08d22c54a21f
comparison
equal deleted inserted replaced
4636:b196d2758026 4637:8c229370ddba
134 TTF_Font *font, 134 TTF_Font *font,
135 const char *text, 135 const char *text,
136 int x, int y, 136 int x, int y,
137 SDL_Color color) 137 SDL_Color color)
138 { 138 {
139 SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color); 139 if (text && strlen(text)) {
140 SDL_Rect dest = { x, y, textSur->w, textSur->h }; 140 SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color);
141 141 SDL_Rect dest = { x, y, textSur->w, textSur->h };
142 SDL_BlitSurface(textSur, NULL, sur, &dest); 142
143 SDL_FreeSurface(textSur); 143 SDL_BlitSurface(textSur, NULL, sur, &dest);
144 SDL_FreeSurface(textSur);
145 }
144 } 146 }
145 #endif 147 #endif
146 148
147 void Redraw() 149 void Redraw()
148 { 150 {