aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/script_ff.cpp
diff options
context:
space:
mode:
authorMax Horn2007-12-20 09:43:46 +0000
committerMax Horn2007-12-20 09:43:46 +0000
commitf44a19608792ac884ca4654eb89514d848fdeedd (patch)
tree90c4c65f7449f7b6d564c354d20bbc7e98405b1e /engines/agos/script_ff.cpp
parent15a94b7c0c9d53ec2ae7fa4dce4c62daac6040ae (diff)
downloadscummvm-rg350-f44a19608792ac884ca4654eb89514d848fdeedd.tar.gz
scummvm-rg350-f44a19608792ac884ca4654eb89514d848fdeedd.tar.bz2
scummvm-rg350-f44a19608792ac884ca4654eb89514d848fdeedd.zip
Moved all time() calls in AGOS to a single new method AGOSEngine::getTime(); also replaced an evil function-static variable by a member variable (lastMinute)
svn-id: r29908
Diffstat (limited to 'engines/agos/script_ff.cpp')
-rw-r--r--engines/agos/script_ff.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/engines/agos/script_ff.cpp b/engines/agos/script_ff.cpp
index 89c760b8bf..2bc04708f4 100644
--- a/engines/agos/script_ff.cpp
+++ b/engines/agos/script_ff.cpp
@@ -397,12 +397,8 @@ void AGOSEngine_Feeble::off_oracleTextUp() {
void AGOSEngine_Feeble::off_ifTime() {
// 124: if time
- time_t t;
-
uint a = getVarOrWord();
- time(&t);
- t -= _gameStoppedClock;
- t -= a;
+ uint32 t = getTime() - _gameStoppedClock - a;
if (t >= _timeStore)
setScriptCondition(true);
else
@@ -411,8 +407,7 @@ void AGOSEngine_Feeble::off_ifTime() {
void AGOSEngine_Feeble::off_setTime() {
// 131
- time(&_timeStore);
- _timeStore -= _gameStoppedClock;
+ _timeStore = getTime() - _gameStoppedClock;
}
void AGOSEngine_Feeble::off_saveUserGame() {
@@ -612,13 +607,13 @@ void AGOSEngine_Feeble::off_setPathValues() {
void AGOSEngine_Feeble::off_stopClock() {
// 193: pause clock
- _clockStopped = time(NULL);
+ _clockStopped = getTime();
}
void AGOSEngine_Feeble::off_restartClock() {
// 194: resume clock
if (_clockStopped != 0)
- _gameStoppedClock += time(NULL) - _clockStopped;
+ _gameStoppedClock += getTime() - _clockStopped;
_clockStopped = 0;
}