summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-02-15 21:20:24 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-02-15 21:20:24 (GMT)
commit6d5bce4fc5ae00a13e5cdb4d51b6a73054bed1f9 (patch)
treed9298e6b5faf40ada691dcfeab7395a61693d4d1
parent64bd53f6a5413810dd8e36237cf5aaf9feee0be4 (diff)
downloadmisc-6d5bce4fc5ae00a13e5cdb4d51b6a73054bed1f9.zip
misc-6d5bce4fc5ae00a13e5cdb4d51b6a73054bed1f9.tar.gz
misc-6d5bce4fc5ae00a13e5cdb4d51b6a73054bed1f9.tar.bz2
meme/gui.c: use SDL_GetError when reporting an SDL problem
-rw-r--r--meme/gui.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/meme/gui.c b/meme/gui.c
index 6cda8ca..c557492 100644
--- a/meme/gui.c
+++ b/meme/gui.c
@@ -479,7 +479,7 @@ static void change(SDL_Surface *s, int x, int y, int w, int h)
c = alloc_type(struct change);
c->s = sdl_surface(SDL_SURFACE, w, h);
if (!c->s) {
- fprintf(stderr, "sdl_surface failed: %s\n", SDL_GetError());
+ fprintf(stderr, "sdl_surface: %s\n", SDL_GetError());
exit(1);
}
@@ -488,7 +488,7 @@ static void change(SDL_Surface *s, int x, int y, int w, int h)
c->r.w = w;
c->r.h = h;
if (SDL_BlitSurface(s, &c->r, c->s, NULL)) {
- fprintf(stderr, "SDL_BlitSurface failed\n");
+ fprintf(stderr, "SDL_BlitSurface: %s\n", SDL_GetError());
exit(1);
}
@@ -523,7 +523,8 @@ static void rollback_changes(SDL_Surface *s)
for (c = changes.prev; c != &changes; c = prev) {
prev = c->prev;
if (SDL_BlitSurface(c->s, NULL, s, &c->r)) {
- fprintf(stderr, "SDL_BlitSurface failed\n");
+ fprintf(stderr, "SDL_BlitSurface: %s\n",
+ SDL_GetError());
exit(1);
}
SDL_FreeSurface(c->s);
@@ -726,7 +727,7 @@ static void text_change(SDL_Surface *s, int x, int y, const char *fmt, ...)
r.w = t->w;
r.h = t->h;
if (SDL_BlitSurface(t, NULL, s, &r)) {
- fprintf(stderr, "SDL_BlitSurface failed\n");
+ fprintf(stderr, "SDL_BlitSurface: %s\n", SDL_GetError());
exit(1);
}
SDL_FreeSurface(t);