Mercurial > hg > openttd
changeset 7019:4dd485dafed0 draft
(svn r10278) -Fix r10276: make the _realtime_tick less demanding on the CPU
author | truelight <truelight@openttd.org> |
---|---|
date | Fri, 22 Jun 2007 20:07:39 +0000 |
parents | a05bbdc788a2 |
children | 5b067f8530bf |
files | src/video/cocoa_v.mm src/video/sdl_v.cpp src/video/win32_v.cpp |
diffstat | 3 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/video/cocoa_v.mm +++ b/src/video/cocoa_v.mm @@ -732,9 +732,9 @@ } 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);
--- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -472,9 +472,9 @@ } 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);
--- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -823,9 +823,9 @@ } 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;