Removed SVM_timeGetTime(). We may as well call get_msecs() directly.

svn-id: r11260
This commit is contained in:
Torbjörn Andersson 2003-11-11 10:30:25 +00:00
parent 70bc5d15ec
commit 1f53624d88
10 changed files with 18 additions and 23 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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");
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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();

View File

@ -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);