Mercurial > hg > dmlib
diff tools/view64.c @ 1420:9b7915193683
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 06 Nov 2017 01:09:13 +0200 |
parents | 36016db0d0b3 |
children | 065dedf5890e |
line wrap: on
line diff
--- a/tools/view64.c Sun Nov 05 23:27:53 2017 +0200 +++ b/tools/view64.c Mon Nov 06 01:09:13 2017 +0200 @@ -230,11 +230,11 @@ DMImage bmap; int ret; - bmap.size = surf->pitch * cimage->height; + bmap.size = surf->pitch * surf->h; bmap.data = surf->pixels; bmap.pitch = surf->pitch; - bmap.width = cimage->width; - bmap.height = cimage->height; + bmap.width = surf->w; + bmap.height = surf->h; bmap.constpal = TRUE; if (fmt->convertFrom != NULL) @@ -347,6 +347,7 @@ switch (event.key.keysym.sym) { case SDLK_ESCAPE: + case SDLK_q: exitFlag = TRUE; break; @@ -381,7 +382,7 @@ break; case SDL_QUIT: - exit(0); + goto exit; } if (currIndex != prevIndex) @@ -403,7 +404,7 @@ goto fail; } - if (fmt == NULL) + if (fmt == NULL || cimage == NULL) { dmErrorMsg("Probing could not find any matching image format. Perhaps try forcing a format via -f.\n"); goto fail;