diff options
author | Christopher Page | 2008-05-28 20:30:20 +0000 |
---|---|---|
committer | Christopher Page | 2008-05-28 20:30:20 +0000 |
commit | 8297ead2671e43963098a3dc41e8e75fdbce4ddc (patch) | |
tree | 72b0e2bb7d03e461cc157ea5f093261ab902fbfb /engines/lure | |
parent | 3c0e72bb25f83120f0320782793af64213cbd1c2 (diff) | |
parent | 057af1000f5187a93fc1ac1a5f61a7a6a382bf03 (diff) | |
download | scummvm-rg350-8297ead2671e43963098a3dc41e8e75fdbce4ddc.tar.gz scummvm-rg350-8297ead2671e43963098a3dc41e8e75fdbce4ddc.tar.bz2 scummvm-rg350-8297ead2671e43963098a3dc41e8e75fdbce4ddc.zip |
Merged revisions 32124,32126-32128,32131,32133,32135-32144,32146-32153,32155-32163,32165-32168,32170-32173,32175-32179,32181-32191,32193-32202,32204-32205,32209-32214,32216,32218,32220-32235,32237-32266,32269-32271,32273-32290,32292-32295,32297-32317,32319-32323,32325-32328,32330-32331,32334-32338,32343-32347 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
svn-id: r32350
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/game.cpp | 3 | ||||
-rw-r--r-- | engines/lure/lure.cpp | 10 | ||||
-rw-r--r-- | engines/lure/lure.h | 1 | ||||
-rw-r--r-- | engines/lure/res_struct.cpp | 21 |
4 files changed, 21 insertions, 14 deletions
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index c87f81618a..f9b31c21c5 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -167,6 +167,7 @@ void Game::execute() { if (system.getMillis() > timerVal + GAME_FRAME_DELAY) { timerVal = system.getMillis(); nextFrame(); + res.delayList().tick(); Sound.musicInterface_ContinuePlaying(); } @@ -177,8 +178,6 @@ void Game::execute() { tickCheck(); } - res.delayList().tick(); - while (events.pollEvent()) { if (events.type() == Common::EVENT_KEYDOWN) { uint16 roomNum = room.roomNumber(); diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index de213b4f5a..06d3b1984e 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -154,6 +154,16 @@ int LureEngine::go() { return 0; } +void LureEngine::pauseEngineIntern(bool pause) { + Engine::pauseEngineIntern(pause); + + if (pause) { + Sound.pause(); + } else { + Sound.resume(); + } +} + void LureEngine::quitGame() { _system->quit(); } diff --git a/engines/lure/lure.h b/engines/lure/lure.h index fa70abc1f0..d66f446247 100644 --- a/engines/lure/lure.h +++ b/engines/lure/lure.h @@ -69,6 +69,7 @@ public: virtual int init(); virtual int go(); + virtual void pauseEngineIntern(bool pause); void quitGame(); Disk &disk() { return *_disk; } diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index 913505c8c9..de09f982d1 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -760,10 +760,8 @@ RoomExitCoordinateData &RoomExitCoordinates::getData(uint16 destRoomNumber) { // The following classes hold any sequence offsets that are being delayed SequenceDelayData::SequenceDelayData(uint16 delay, uint16 seqOffset, bool canClearFlag) { - OSystem &system = *g_system; - - // The delay is in number of seconds - timeoutCtr = system.getMillis() + delay * 1000; + // The delay is in number of seconds - convert it to remaining milliseconds + timeoutCtr = delay * 1000; sequenceOffset = seqOffset; canClear = canClearFlag; } @@ -784,21 +782,23 @@ void SequenceDelayList::add(uint16 delay, uint16 seqOffset, bool canClear) { } void SequenceDelayList::tick() { - uint32 currTime = g_system->getMillis(); SequenceDelayList::iterator i; - debugC(ERROR_DETAILED, kLureDebugScripts, "Delay List check start at time %d", currTime); + debugC(ERROR_DETAILED, kLureDebugScripts, "Delay List check start at time %d", + g_system->getMillis()); for (i = begin(); i != end(); i++) { SequenceDelayData *entry = (*i).get(); debugC(ERROR_DETAILED, kLureDebugScripts, "Delay List check %xh at time %d", entry->sequenceOffset, entry->timeoutCtr); - if (currTime >= entry->timeoutCtr) { + if (entry->timeoutCtr <= GAME_FRAME_DELAY) { // Timeout reached - delete entry from list and execute the sequence uint16 seqOffset = entry->sequenceOffset; erase(i); Script::execute(seqOffset); return; + } else { + entry->timeoutCtr -= GAME_FRAME_DELAY; } } } @@ -816,14 +816,12 @@ void SequenceDelayList::clear(bool forceClear) { } void SequenceDelayList::saveToStream(WriteStream *stream) { - uint32 currTime = g_system->getMillis(); SequenceDelayList::iterator i; for (i = begin(); i != end(); ++i) { SequenceDelayData *entry = (*i).get(); stream->writeUint16LE(entry->sequenceOffset); - stream->writeUint32LE((currTime > entry->timeoutCtr ) ? 0 : - entry->timeoutCtr - currTime); + stream->writeUint32LE(entry->timeoutCtr); stream->writeByte(entry->canClear); } @@ -833,10 +831,9 @@ void SequenceDelayList::saveToStream(WriteStream *stream) { void SequenceDelayList::loadFromStream(ReadStream *stream) { clear(true); uint16 seqOffset; - uint32 currTime = g_system->getMillis(); while ((seqOffset = stream->readUint16LE()) != 0) { - uint32 delay = currTime + stream->readUint32LE(); + uint32 delay = stream->readUint32LE(); bool canClear = stream->readByte() != 0; push_back(SequenceDelayList::value_type(SequenceDelayData::load(delay, seqOffset, canClear))); } |