From 44a9fea38808d5414ddbbc9ce6ce1e3f91442112 Mon Sep 17 00:00:00 2001 From: truelight Date: Fri, 22 Jun 2007 20:07:39 +0000 Subject: (svn r10278) -Fix r10276: make the _realtime_tick less demanding on the CPU --- src/video/cocoa_v.mm | 4 ++-- src/video/sdl_v.cpp | 4 ++-- src/video/win32_v.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/cocoa_v.mm b/src/video/cocoa_v.mm index 8e13605d8..1481bc606 100644 --- a/src/video/cocoa_v.mm +++ b/src/video/cocoa_v.mm @@ -732,9 +732,9 @@ 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) { + _realtime_tick += cur_ticks - last_cur_ticks; + last_cur_ticks = cur_ticks; next_tick = cur_ticks + 30; _ctrl_pressed = !!(_cocoa_video_data.current_mods & NSControlKeyMask); diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 782ac1521..bc12edb92 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -472,9 +472,9 @@ 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) { + _realtime_tick += cur_ticks - last_cur_ticks; + last_cur_ticks = cur_ticks; next_tick = cur_ticks + 30; _ctrl_pressed = !!(mod & KMOD_CTRL); diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 583f7f84b..987a4a6ff 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -823,9 +823,9 @@ 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) { + _realtime_tick += cur_ticks - last_cur_ticks; + last_cur_ticks = cur_ticks; next_tick = cur_ticks + 30; _ctrl_pressed = _wnd.has_focus && GetAsyncKeyState(VK_CONTROL)<0; _shift_pressed = _wnd.has_focus && GetAsyncKeyState(VK_SHIFT)<0; -- cgit v1.2.3-70-g09d2