From 862622c29a7e3ef73c986735a69a56c17a774172 Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Wed, 22 Oct 2008 22:11:04 +0200 Subject: [PATCH] Make sure FPS limit in the main menu is always correct Without this patch, after the gameloop has finished, we won't have reset the FPS counter, so the FPS limiter will be practically disabled, depending on how long you played. With this patch, the FPS limit counter is reset after the gameloop has finished, so we always have a correct way of calculating FPS. This can probably be improved. --- tennix.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tennix.c b/tennix.c index f2faf14..03ede76 100644 --- a/tennix.c +++ b/tennix.c @@ -295,6 +295,10 @@ int main( int argc, char** argv) { gameloop(current_game); SDL_Delay(150); while(SDL_PollEvent(&e)); +#ifdef ENABLE_FPS_LIMIT + frames = 0; + ft = SDL_GetTicks(); +#endif start_fade(); state = MENU_STATE_SLIDE_TO_MAINMENU; break; @@ -328,6 +332,11 @@ int main( int argc, char** argv) { } /* Graphics */ +#ifdef DEBUG + if (state != MENU_STATE_OPTIONS) { + fill_image_offset(GR_FOG, 0, 0, WIDTH, HEIGHT, -i, 0); + } +#endif show_image(GR_SIDEBAR, WIDTH-get_image_width(GR_SIDEBAR)+slide, 0, 255); show_image(GR_TENNIXLOGO, WIDTH-get_image_width(GR_SIDEBAR)-10, 20-slide, 255); if (state != MENU_STATE_OPTIONS) { -- 2.11.4.GIT