diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2012-04-23 21:34:49 +0000 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2012-04-23 21:34:49 +0000 |
commit | f92bb441463c201e605c737fb1a6203ce7daaf57 (patch) | |
tree | ccd96ade3546b4c48d5c3e448efea8dbe68c71eb /gui.c | |
parent | 84686e20760914f5156ffc43f79efa284bfbe076 (diff) |
less branches, update screen at least all 100 cycles
Diffstat (limited to 'gui.c')
-rw-r--r-- | gui.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } |