diff options
Diffstat (limited to 'src/video')
-rw-r--r-- | src/video/cocoa_v.mm | 3 | ||||
-rw-r--r-- | src/video/sdl_v.cpp | 3 | ||||
-rw-r--r-- | src/video/win32_v.cpp | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/video/cocoa_v.mm b/src/video/cocoa_v.mm index f4dfc5b77..8e13605d8 100644 --- a/src/video/cocoa_v.mm +++ b/src/video/cocoa_v.mm @@ -685,6 +685,7 @@ static bool QZ_PollEvent() static void QZ_GameLoop() { uint32 cur_ticks = GetTick(); + uint32 last_cur_ticks = cur_ticks; uint32 next_tick = cur_ticks + 30; uint32 pal_tick = 0; #ifdef _DEBUG @@ -731,6 +732,8 @@ static void QZ_GameLoop() } cur_ticks = GetTick(); + _realtime_tick += cur_ticks - last_cur_ticks; + last_cur_ticks = cur_ticks; if (cur_ticks >= next_tick || (_fast_forward && !_pause_game) || cur_ticks < prev_cur_ticks) { next_tick = cur_ticks + 30; diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 1e11b32c3..782ac1521 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -442,6 +442,7 @@ static void SdlVideoStop() static void SdlVideoMainLoop() { uint32 cur_ticks = SDL_CALL SDL_GetTicks(); + uint32 last_cur_ticks = cur_ticks; uint32 next_tick = cur_ticks + 30; uint32 pal_tick = 0; uint32 mod; @@ -471,6 +472,8 @@ static void SdlVideoMainLoop() } cur_ticks = SDL_CALL SDL_GetTicks(); + _realtime_tick += cur_ticks - last_cur_ticks; + last_cur_ticks = cur_ticks; if (cur_ticks >= next_tick || (_fast_forward && !_pause_game) || cur_ticks < prev_cur_ticks) { next_tick = cur_ticks + 30; diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 1508e1ebd..583f7f84b 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -795,6 +795,7 @@ static void Win32GdiMainLoop() { MSG mesg; uint32 cur_ticks = GetTickCount(); + uint32 last_cur_ticks = cur_ticks; uint32 next_tick = cur_ticks + 30; _wnd.running = true; @@ -822,6 +823,8 @@ static void Win32GdiMainLoop() } cur_ticks = GetTickCount(); + _realtime_tick += cur_ticks - last_cur_ticks; + last_cur_ticks = cur_ticks; if (cur_ticks >= next_tick || (_fast_forward && !_pause_game) || cur_ticks < prev_cur_ticks) { next_tick = cur_ticks + 30; _ctrl_pressed = _wnd.has_focus && GetAsyncKeyState(VK_CONTROL)<0; |