From: Holger Schemel Date: Tue, 9 Jun 2015 20:35:52 +0000 (+0200) Subject: added some (currently deactivated) frame rate debugging code X-Git-Tag: 4.0.0.0-rc1~179 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b0489427758a5a038557b8dc884846afbfe68ff3;p=rocksndiamonds.git added some (currently deactivated) frame rate debugging code --- diff --git a/src/game.c b/src/game.c index c02e590f..1f9289e8 100644 --- a/src/game.c +++ b/src/game.c @@ -11057,9 +11057,18 @@ void GameActions() if (tape.playing && tape.warp_forward && !tape.pausing) game_frame_delay_value = 0; +#if 0 + /* ---------- main game synchronization point ---------- */ + + int skip = WaitUntilDelayReached(&game_frame_delay, game_frame_delay_value); + + printf("::: skip == %d\n", skip); + +#else /* ---------- main game synchronization point ---------- */ WaitUntilDelayReached(&game_frame_delay, game_frame_delay_value); +#endif if (network_playing && !network_player_action_received) { diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 32635b53..a9fff4ea 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -60,6 +60,23 @@ static void UpdateScreen(SDL_Rect *rect) LimitScreenUpdates(FALSE); +#if 0 + { + static int LastFrameCounter = 0; + boolean changed = (FrameCounter != LastFrameCounter); + + printf("::: FrameCounter == %d [%s]\n", FrameCounter, + (changed ? "-" : "SAME FRAME UPDATED")); + + LastFrameCounter = FrameCounter; + + /* + if (FrameCounter % 2) + return; + */ + } +#endif + #if defined(TARGET_SDL2) #if USE_RENDERER SDL_Surface *screen = backbuffer->surface;