diff options
author | Benjamin Haisch | 2008-05-12 09:49:10 +0000 |
---|---|---|
committer | Benjamin Haisch | 2008-05-12 09:49:10 +0000 |
commit | 9e39e7d7a2c62e175240a5a55017ee9c206d2cf0 (patch) | |
tree | a1c37bfc339fe06e3399d90805d21bf16e2a3951 /engines/made/made.cpp | |
parent | 27b9887a30a035829a03f40800c5460e004c9d17 (diff) | |
download | scummvm-rg350-9e39e7d7a2c62e175240a5a55017ee9c206d2cf0.tar.gz scummvm-rg350-9e39e7d7a2c62e175240a5a55017ee9c206d2cf0.tar.bz2 scummvm-rg350-9e39e7d7a2c62e175240a5a55017ee9c206d2cf0.zip |
- Fixed timers, LGOP2 intro should now play correctly
- Some cleanup in LGOP2 opcodes
svn-id: r32051
Diffstat (limited to 'engines/made/made.cpp')
-rw-r--r-- | engines/made/made.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/made/made.cpp b/engines/made/made.cpp index 0cf73d5dd0..ccb4ad5e8d 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -134,21 +134,26 @@ int MadeEngine::init() { } int16 MadeEngine::getTimer(int16 timerNum) { - return (_system->getMillis() - _timers[timerNum]) / 60; + if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers) && _timers[timerNum - 1] != -1) + return (_system->getMillis() - _timers[timerNum - 1]) / 60; + else + return 32000; } void MadeEngine::setTimer(int16 timerNum, int16 value) { - _timers[timerNum] = value * 60; + if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers)) + _timers[timerNum - 1] = value * 60; } void MadeEngine::resetTimer(int16 timerNum) { - _timers[timerNum] = _system->getMillis(); + if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers)) + _timers[timerNum - 1] = _system->getMillis(); } int16 MadeEngine::allocTimer() { for (int i = 0; i < ARRAYSIZE(_timers); i++) { if (_timers[i] == -1) { - resetTimer(i); + _timers[i] = _system->getMillis(); return i + 1; } } @@ -156,7 +161,8 @@ int16 MadeEngine::allocTimer() { } void MadeEngine::freeTimer(int16 timerNum) { - _timers[timerNum] = -1; + if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers)) + _timers[timerNum - 1] = -1; } Common::String MadeEngine::getSavegameFilename(int16 saveNum) { |