From: Holger Schemel Date: Fri, 24 May 2019 18:16:22 +0000 (+0200) Subject: added video frame counter (currently not used) X-Git-Tag: 4.1.4.0~39 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e617cc94b68c43105fc3c06d26d31c9bc99161a4;p=rocksndiamonds.git added video frame counter (currently not used) --- diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index f18b97b4..e13b6736 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -218,6 +218,8 @@ static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay) if (with_frame_delay) WaitUntilDelayReached(&video.frame_delay, video.frame_delay_value); + video.frame_counter++; + // show render target buffer on screen SDL_RenderPresent(sdl_renderer); } diff --git a/src/libgame/system.c b/src/libgame/system.c index d6ede9ff..dc7dba8b 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -570,6 +570,7 @@ void InitVideoBuffer(int width, int height, int depth, boolean fullscreen) video.window_scaling_available = WINDOW_SCALING_STATUS; + video.frame_counter = 0; video.frame_delay = 0; video.frame_delay_value = GAME_FRAME_DELAY; diff --git a/src/libgame/system.h b/src/libgame/system.h index 6c0490f3..4c0081e5 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1011,6 +1011,7 @@ struct VideoSystemInfo int screen_rendering_mode; int vsync_mode; + unsigned int frame_counter; unsigned int frame_delay; unsigned int frame_delay_value;