fix checks
This commit is contained in:
parent
dadc103aed
commit
1f664c1404
1 changed files with 3 additions and 3 deletions
|
@ -21,14 +21,14 @@ int writeText(GLuint *_textTexId, TTF_Font *font, char *text, SDL_Color color) {
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
SDL_Surface *d, *s;
|
SDL_Surface *d, *s;
|
||||||
if ((d = TTF_RenderUTF8_Blended_Wrapped(font, text, color, 0)) == NULL) {
|
if (!(d = TTF_RenderUTF8_Blended_Wrapped(font, text, color, 0))) {
|
||||||
freeFont(font);
|
freeFont(font);
|
||||||
fprintf(stderr, "Erreur TTF : TTF_RenderUTF8_Blended_Wrapped\n");
|
fprintf(stderr, "Erreur TTF : TTF_RenderUTF8_Blended_Wrapped\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((s = SDL_CreateRGBSurface(0, d->w, d->h, 32, R_MASK, G_MASK, B_MASK,
|
if (!(s = SDL_CreateRGBSurface(0, d->w, d->h, 32, R_MASK, G_MASK, B_MASK,
|
||||||
A_MASK))) {
|
A_MASK))) {
|
||||||
freeFont(font);
|
freeFont(font);
|
||||||
fprintf(stderr, "Erreur SDL : %s\n", SDL_GetError());
|
fprintf(stderr, "Erreur SDL : %s\n", SDL_GetError());
|
||||||
return 2;
|
return 2;
|
||||||
|
|
Reference in a new issue