summaryrefslogtreecommitdiff
path: root/src/video/sdl_v.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-22 20:04:21 +0000
committertruelight <truelight@openttd.org>2007-06-22 20:04:21 +0000
commit7bfc7d19e814567bb09acda7406cb437f5e2f213 (patch)
tree487e36c90385f72fecad8d7a35fdb2c0192bec39 /src/video/sdl_v.cpp
parentd5f4251823f878285532149272d039f1a7a4bcc3 (diff)
downloadopenttd-7bfc7d19e814567bb09acda7406cb437f5e2f213.tar.xz
(svn r10276) -Codechange: made a counter based on milliseconds and independent of the game-state to base double-click and TGP Generation Process on
-Codechange: renamed _timer_counter to _palette_animation_counter, as that is what it is
Diffstat (limited to 'src/video/sdl_v.cpp')
-rw-r--r--src/video/sdl_v.cpp3
1 files changed, 3 insertions, 0 deletions
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;