diff options
author | Torbjörn Andersson | 2003-11-11 10:30:25 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-11-11 10:30:25 +0000 |
commit | 1f53624d88ac05bff0b4f408507eeca331cfdcd5 (patch) | |
tree | 682dd311f072b41437369e671a8d3d7a4faf5ab4 | |
parent | 70bc5d15ec0af3dd6c009063816dac1e045067ef (diff) | |
download | scummvm-rg350-1f53624d88ac05bff0b4f408507eeca331cfdcd5.tar.gz scummvm-rg350-1f53624d88ac05bff0b4f408507eeca331cfdcd5.tar.bz2 scummvm-rg350-1f53624d88ac05bff0b4f408507eeca331cfdcd5.zip |
Removed SVM_timeGetTime(). We may as well call get_msecs() directly.
svn-id: r11260
-rw-r--r-- | sword2/build_display.cpp | 6 | ||||
-rw-r--r-- | sword2/console.cpp | 4 | ||||
-rw-r--r-- | sword2/debug.cpp | 2 | ||||
-rw-r--r-- | sword2/driver/driver96.h | 1 | ||||
-rw-r--r-- | sword2/driver/menu.cpp | 4 | ||||
-rw-r--r-- | sword2/driver/misc.cpp | 4 | ||||
-rw-r--r-- | sword2/driver/palette.cpp | 6 | ||||
-rw-r--r-- | sword2/driver/render.cpp | 8 | ||||
-rw-r--r-- | sword2/sword2.cpp | 4 | ||||
-rw-r--r-- | sword2/sword2.h | 2 |
10 files changed, 18 insertions, 23 deletions
diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp index 6b187a92d6..34951bca3d 100644 --- a/sword2/build_display.cpp +++ b/sword2/build_display.cpp @@ -173,11 +173,11 @@ void Sword2Engine::buildDisplay(void) { // update our fps reading _frameCount++; - if (SVM_timeGetTime() > _cycleTime) { + if (_system->get_msecs() > _cycleTime) { _fps = _frameCount; debug(2, "FPS: %d", _fps); _frameCount = 0; - _cycleTime = SVM_timeGetTime() + 1000; + _cycleTime = _system->get_msecs() + 1000; } // Check if we've got time to render the screen again @@ -255,7 +255,7 @@ void Sword2Engine::displayMsg(uint8 *text, int time) { g_graphics->waitForFade(); - uint32 targetTime = SVM_timeGetTime() + (time * 1000); + uint32 targetTime = _system->get_msecs() + (time * 1000); // Keep the message there even when the user task swaps. rv = g_graphics->drawSprite(&spriteInfo); diff --git a/sword2/console.cpp b/sword2/console.cpp index e50741fdb9..e6939ddb8e 100644 --- a/sword2/console.cpp +++ b/sword2/console.cpp @@ -466,9 +466,9 @@ bool Debugger::Cmd_BltFxOff(int argc, const char **argv) { bool Debugger::Cmd_TimeOn(int argc, const char **argv) { if (argc == 2) - _startTime = SVM_timeGetTime() - atoi(argv[1]) * 1000; + _startTime = g_system->get_msecs() - atoi(argv[1]) * 1000; else if (_startTime == 0) - _startTime = SVM_timeGetTime(); + _startTime = g_system->get_msecs(); _displayTime = true; DebugPrintf("Timer display on\n"); return true; diff --git a/sword2/debug.cpp b/sword2/debug.cpp index d4950adc3c..fde2ce3b5b 100644 --- a/sword2/debug.cpp +++ b/sword2/debug.cpp @@ -120,7 +120,7 @@ void Debugger::buildDebugText(void) { // debug info at top of screen - enabled/disabled as one complete unit if (_displayTime) { - int32 time = SVM_timeGetTime(); + int32 time = g_system->get_msecs(); if ((time - _startTime) / 1000 >= 10000) _startTime = time; diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h index 4ecf614da9..510b8cef37 100644 --- a/sword2/driver/driver96.h +++ b/sword2/driver/driver96.h @@ -276,7 +276,6 @@ extern int32 SetLanguageVersion(uint8 version); //----------------------------------------------------------------------------- // Misc functions - from misc.cpp //----------------------------------------------------------------------------- -extern uint32 SVM_timeGetTime(void); extern void SVM_SetFileAttributes(char *file, uint32 atrib); extern void SVM_DeleteFile(char *file); extern int32 SVM_GetVolumeInformation(char *cdPath, char *sCDName, uint32 maxPath, uint8 *, uint32 *dwMaxCompLength, uint32 *dwFSFlags, uint8 *, uint32 a); diff --git a/sword2/driver/menu.cpp b/sword2/driver/menu.cpp index 341fb85de9..bbcd63668a 100644 --- a/sword2/driver/menu.cpp +++ b/sword2/driver/menu.cpp @@ -65,10 +65,10 @@ void Graphics::processMenu(void) { static int32 lastTime = 0; if (lastTime == 0) { - lastTime = SVM_timeGetTime(); + lastTime = g_system->get_msecs(); frameCount = 1; } else { - delta = SVM_timeGetTime() - lastTime; + delta = g_system->get_msecs() - lastTime; if (delta > 250) { lastTime += delta; delta = 250; diff --git a/sword2/driver/misc.cpp b/sword2/driver/misc.cpp index 6e68e622f9..5ccf5ca09a 100644 --- a/sword2/driver/misc.cpp +++ b/sword2/driver/misc.cpp @@ -23,10 +23,6 @@ namespace Sword2 { -uint32 SVM_timeGetTime(void) { - return g_system->get_msecs(); -} - void SVM_SetFileAttributes(char *file, uint32 atrib) { warning("stub SetFileAttributes"); } diff --git a/sword2/driver/palette.cpp b/sword2/driver/palette.cpp index a4098426b3..4b69fbc48c 100644 --- a/sword2/driver/palette.cpp +++ b/sword2/driver/palette.cpp @@ -141,7 +141,7 @@ int32 Graphics::fadeUp(float time) { _fadeTotalTime = (int32) (time * 1000); _fadeStatus = RDFADE_UP; - _fadeStartTime = SVM_timeGetTime(); + _fadeStartTime = g_system->get_msecs(); return RD_OK; } @@ -157,7 +157,7 @@ int32 Graphics::fadeDown(float time) { _fadeTotalTime = (int32) (time * 1000); _fadeStatus = RDFADE_DOWN; - _fadeStartTime = SVM_timeGetTime(); + _fadeStartTime = g_system->get_msecs(); return RD_OK; } @@ -196,7 +196,7 @@ void Graphics::fadeServer(void) { // I don't know if this is necessary, but let's limit how often the // palette is updated, just to be safe. - currentTime = SVM_timeGetTime(); + currentTime = g_system->get_msecs(); if (currentTime - previousTime <= 25) return; diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp index 71f01befea..0fb3598d69 100644 --- a/sword2/driver/render.cpp +++ b/sword2/driver/render.cpp @@ -575,7 +575,7 @@ void Graphics::renderParallax(_parallax *p, int16 l) { */ void Graphics::initialiseRenderCycle(void) { - _initialTime = SVM_timeGetTime(); + _initialTime = g_system->get_msecs(); _totalTime = _initialTime + MILLISECSPERCYCLE; } @@ -588,7 +588,7 @@ void Graphics::startRenderCycle(void) { _scrollXOld = _scrollX; _scrollYOld = _scrollY; - _startTime = SVM_timeGetTime(); + _startTime = g_system->get_msecs(); if (_startTime + _renderAverageTime >= _totalTime) { _scrollX = _scrollXTarget; @@ -614,7 +614,7 @@ bool Graphics::endRenderCycle(void) { static int32 renderCountIndex = 0; int32 time; - time = SVM_timeGetTime(); + time = g_system->get_msecs(); renderTimeLog[renderCountIndex] = time - _startTime; _startTime = time; _renderAverageTime = (renderTimeLog[0] + renderTimeLog[1] + renderTimeLog[2] + renderTimeLog[3]) >> 2; @@ -640,7 +640,7 @@ bool Graphics::endRenderCycle(void) { // If we have already reached the scroll target sleep for the // rest of the render cycle. g_sword2->sleepUntil(_totalTime); - _initialTime = SVM_timeGetTime(); + _initialTime = g_system->get_msecs(); _totalTime += MILLISECSPERCYCLE; return true; } diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp index 045b27291f..138283c547 100644 --- a/sword2/sword2.cpp +++ b/sword2/sword2.cpp @@ -477,8 +477,8 @@ void Sword2Engine::startGame(void) { // FIXME: Move this to some better place? -void Sword2Engine::sleepUntil(int32 time) { - while ((int32) SVM_timeGetTime() < time) { +void Sword2Engine::sleepUntil(uint32 time) { + while (_system->get_msecs() < time) { // Make sure menu animations and fades don't suffer _graphics->processMenu(); _graphics->updateDisplay(); diff --git a/sword2/sword2.h b/sword2/sword2.h index 271f2315f3..dfa4219b84 100644 --- a/sword2/sword2.h +++ b/sword2/sword2.h @@ -364,7 +364,7 @@ public: void gameCycle(void); void closeGame(void); - void sleepUntil(int32 time); + void sleepUntil(uint32 time); uint32 readFile(const char *name, mem **membloc, uint32 uid); |