diff options
author | Travis Howell | 2006-04-18 11:38:18 +0000 |
---|---|---|
committer | Travis Howell | 2006-04-18 11:38:18 +0000 |
commit | 506cdd9054198b6cf049b28b879bb1fff0b7d478 (patch) | |
tree | 2e7fcb6ad1723b511ac98dc3341d3da2079135a2 | |
parent | ab48280f731cf65313b4bd57896e762eb04fbce9 (diff) | |
download | scummvm-rg350-506cdd9054198b6cf049b28b879bb1fff0b7d478.tar.gz scummvm-rg350-506cdd9054198b6cf049b28b879bb1fff0b7d478.tar.bz2 scummvm-rg350-506cdd9054198b6cf049b28b879bb1fff0b7d478.zip |
Fix time events continuing, when using the oracle in FF
svn-id: r22003
-rw-r--r-- | engines/simon/saveload.cpp | 4 | ||||
-rw-r--r-- | engines/simon/simon.cpp | 14 | ||||
-rw-r--r-- | engines/simon/simon.h | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/engines/simon/saveload.cpp b/engines/simon/saveload.cpp index 1722467f53..374dbab6b6 100644 --- a/engines/simon/saveload.cpp +++ b/engines/simon/saveload.cpp @@ -327,7 +327,7 @@ restart:; get_out:; unk_132_helper_3(); - _base_time = time(NULL) - save_time + _base_time; + _gameStoppedClock = time(NULL) - save_time + _gameStoppedClock; _copyPartialMode = 0; restoreBlock(94, 208, 46, 80); @@ -507,7 +507,7 @@ bool SimonEngine::saveGame(uint slot, char *caption) { f->writeUint32BE(i); for (te = _firstTimeStruct; te; te = te->next) { - f->writeUint32BE(te->time + _base_time); + f->writeUint32BE(te->time + _gameStoppedClock); f->writeUint16BE(te->subroutine_id); } diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index d5aa21fc22..c9a303f916 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -312,8 +312,6 @@ SimonEngine::SimonEngine(OSystem *syst) _firstTimeStruct = 0; _pendingDeleteTimeEvent = 0; - _base_time = 0; - _mouseX = 0; _mouseY = 0; _mouseXOld = 0; @@ -1453,7 +1451,9 @@ void SimonEngine::addTimeEvent(uint timeout, uint subroutine_id) { time(&cur_time); - te->time = cur_time + timeout - _base_time; + te->time = cur_time + timeout - _gameStoppedClock; + if (_clockStopped) + te->time -= ((uint32)time(NULL) - _clockStopped); te->subroutine_id = subroutine_id; first = _firstTimeStruct; @@ -1524,8 +1524,11 @@ bool SimonEngine::kickoffTimeEvents() { TimeEvent *te; bool result = false; + if (_clockStopped) + return result; + time(&cur_time); - cur_time -= _base_time; + cur_time -= _gameStoppedClock; while ((te = _firstTimeStruct) != NULL && te->time <= (uint32)cur_time) { result = true; @@ -1544,11 +1547,14 @@ void SimonEngine::invokeTimeEvent(TimeEvent *te) { Subroutine *sub; _scriptVerb = 0; + if (_runScriptReturn1) return; + sub = getSubroutineByID(te->subroutine_id); if (sub != NULL) startSubroutineEx(sub); + _runScriptReturn1 = false; } diff --git a/engines/simon/simon.h b/engines/simon/simon.h index a93cd4aeb8..8251d1f2dd 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -306,8 +306,6 @@ protected: TimeEvent *_firstTimeStruct, *_pendingDeleteTimeEvent; - uint _base_time; - int _mouseX, _mouseY; int _mouseXOld, _mouseYOld; |