aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-04-27 13:01:22 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-04-27 13:01:22 +0000
commitdda0a740dba381909b81cc088778b98e6d3a1e92 (patch)
treefe6b741f5c1d8790520c443cc19d118282bed77c
parentfa4c64af783151818087a437a2f195270369043f (diff)
cleanup
-rw-r--r--gui.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gui.c b/gui.c
index cd98a38..4879581 100644
--- a/gui.c
+++ b/gui.c
@@ -182,12 +182,16 @@ guiemu(unsigned short *m, unsigned short *r)
scratch = SDL_CreateRGBSurface(SDL_HWSURFACE, scr.w, scr.h, 8, 0, 0, 0, 0);
SDL_SetColors(scratch, color, 0, 16);
+ atexit(SDL_Quit);
+
loadfont(m, "font.xpm");
while ((c = step(m, r)) != -1) {
if ((n += c) < 100)
continue;
+ n = 0;
+
if (SDL_MUSTLOCK(screen) && SDL_LockSurface(screen))
continue;
@@ -204,7 +208,6 @@ guiemu(unsigned short *m, unsigned short *r)
if (SDL_MUSTLOCK(screen))
SDL_UnlockSurface(screen);
- n = 0;
if (keyboard(m) == -1)
break;
}