diff options
-rw-r--r-- | engines/made/made.cpp | 16 | ||||
-rw-r--r-- | engines/made/scriptfuncs_lgop2.cpp | 9 |
2 files changed, 17 insertions, 8 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) { diff --git a/engines/made/scriptfuncs_lgop2.cpp b/engines/made/scriptfuncs_lgop2.cpp index 70f265a17d..ef3c2dffc4 100644 --- a/engines/made/scriptfuncs_lgop2.cpp +++ b/engines/made/scriptfuncs_lgop2.cpp @@ -129,6 +129,7 @@ int16 ScriptFunctionsLgop2::o1_CLS(int16 argc, int16 *argv) { } int16 ScriptFunctionsLgop2::o1_SHOWPAGE(int16 argc, int16 *argv) { + _vm->_mixer->stopHandle(_audioStreamHandle); _vm->_screen->show(); return 0; } @@ -322,7 +323,8 @@ int16 ScriptFunctionsLgop2::o1_FREEANIM(int16 argc, int16 *argv) { } int16 ScriptFunctionsLgop2::o1_DRAWSPRITE(int16 argc, int16 *argv) { - return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]); + _vm->_screen->drawSprite(argv[2], argv[1], argv[0]); + return 0; } int16 ScriptFunctionsLgop2::o1_ERASESPRITES(int16 argc, int16 *argv) { @@ -350,8 +352,7 @@ int16 ScriptFunctionsLgop2::o1_RESETTIMER(int16 argc, int16 *argv) { } int16 ScriptFunctionsLgop2::o1_ALLOCTIMER(int16 argc, int16 *argv) { - int16 timerNum = _vm->allocTimer(); - return timerNum; + return _vm->allocTimer(); } int16 ScriptFunctionsLgop2::o1_FREETIMER(int16 argc, int16 *argv) { @@ -439,6 +440,8 @@ int16 ScriptFunctionsLgop2::o1_RESTEXT(int16 argc, int16 *argv) { int16 ScriptFunctionsLgop2::o1_ADDMASK(int16 argc, int16 *argv) { warning("Unimplemented opcode: o1_ADDMASK"); + //PictureResource *flex = _vm->_res->getPicture(flexIndex); + //Graphics::Surface *sourceSurface = flex->getPicture(); return 0; } |