From 340aa842982987a7bffe83b67a5d43484299acb9 Mon Sep 17 00:00:00 2001 From: zicodxx Date: Tue, 11 Jan 2011 00:37:38 +0100 Subject: [PATCH] Reverted most of the last commit - didn't work well when timer was updated too frequently --- CHANGELOG.txt | 2 +- arch/sdl/timer.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ba62d0c98..706978702 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,7 +4,7 @@ D1X-Rebirth Changelog -------- 2d/disc.c, arch/ogl/gr.c, arch/ogl/ogl.c, include/gr.h, include/ogl_init.h, main/automap.c, main/gauges.c, main/gauges.h, main/menu.c, main/playsave.c, main/playsave.h: Added different reticle types with RGBA and size settings; Apply RGBA and size to FlightSim Indicator; Added Brightness Slider to Graphics options menu; Added OpenGL usage for gr_disk main/credits.c, main/songs.c, misc/hmp.c: Let credits track fade out at the end of text sequence; Fixed usage for RBAPlayTracks - when playing only one track last must be equal first, not 0; In hmp_open changed data from long to int, preventing memory explosion depending on optimisation of the code -arch/sdl/timer.c: In timer_update() use i2f and fixdiv for SDL_GetTicks() to get more accurate values to F64_RunTime; Added rollover check for SDL_GetTicks() to timer_delay2() +arch/sdl/timer.c: In timer_update() convert cur_tv to fix scale before substracting from last_tv to get a little more accurate values to F64_RunTime (insignificant tho); Added rollover check for SDL_GetTicks() to timer_delay2() 20110109 -------- diff --git a/arch/sdl/timer.c b/arch/sdl/timer.c index 4da401ef0..5e9fbb769 100644 --- a/arch/sdl/timer.c +++ b/arch/sdl/timer.c @@ -15,8 +15,8 @@ static fix64 F64_RunTime = 0; void timer_update(void) { static ubyte init = 1; - static unsigned long last_tv = 0; - unsigned long cur_tv = i2f(SDL_GetTicks()/1000) | fixdiv(i2f(SDL_GetTicks() % 1000),i2f(1000)); + static fix64 last_tv = 0; + fix64 cur_tv = SDL_GetTicks()*F1_0/1000; if (init) {