From dda0a740dba381909b81cc088778b98e6d3a1e92 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 27 Apr 2012 13:01:22 +0000 Subject: cleanup --- gui.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3