aboutsummaryrefslogtreecommitdiff
path: root/gui.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-04-23 21:34:49 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-04-23 21:34:49 +0000
commitf92bb441463c201e605c737fb1a6203ce7daaf57 (patch)
treeccd96ade3546b4c48d5c3e448efea8dbe68c71eb /gui.c
parent84686e20760914f5156ffc43f79efa284bfbe076 (diff)
less branches, update screen at least all 100 cycles
Diffstat (limited to 'gui.c')
-rw-r--r--gui.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gui.c b/gui.c
index 1eff06b..c1376ba 100644
--- a/gui.c
+++ b/gui.c
@@ -196,17 +196,18 @@ setfont(unsigned short *m)
void
guiemu(unsigned short *m, unsigned short *r)
{
- int n = 0;
+ int c, n = 0;
screen = SDL_SetVideoMode(scr.w, scr.h, 8, SDL_HWSURFACE|SDL_HWPALETTE);
SDL_SetColors(screen, color, 0, 16);
setfont(m);
- while (step(m, r) != -1) {
- if (++n % 100)
+ while ((c = step(m, r)) != -1) {
+ if ((n += c) < 100)
continue;
drawscreen(screen, m);
+ n = 0;
if (keyboard(m) == -1)
break;
}