diff options
author | lukaslw | 2014-08-05 18:11:33 +0200 |
---|---|---|
committer | lukaslw | 2014-08-05 18:11:33 +0200 |
commit | a3c829a7741630cf2aca1c142c782a111402902e (patch) | |
tree | 9b6316765ed02fafb055f5802016212dba031061 /engines/prince | |
parent | 49337549d9959ec9858fb0e497c27b27febfc277 (diff) | |
download | scummvm-rg350-a3c829a7741630cf2aca1c142c782a111402902e.tar.gz scummvm-rg350-a3c829a7741630cf2aca1c142c782a111402902e.tar.bz2 scummvm-rg350-a3c829a7741630cf2aca1c142c782a111402902e.zip |
PRINCE: Background animations - update
Diffstat (limited to 'engines/prince')
-rw-r--r-- | engines/prince/script.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index 91b8e50ea6..061d86c848 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -250,6 +250,8 @@ int Script::scanMobEventsWithItem(int mobMask, int dataEventOffset, int itemMask void Script::installSingleBackAnim(Common::Array<BackgroundAnim> &backAnimList, int slot, int roomBackAnimOffset) { + _vm->removeSingleBackAnim(slot); + int offset = roomBackAnimOffset + slot * 4; BackgroundAnim newBackgroundAnim; @@ -788,15 +790,19 @@ void Interpreter::O_GO() { void Interpreter::O_BACKANIMUPDATEOFF() { uint16 slotId = readScriptFlagValue(); int currAnim = _vm->_backAnimList[slotId]._seq._currRelative; - _vm->_backAnimList[slotId].backAnims[currAnim]._state = 1; + if (!_vm->_backAnimList[slotId].backAnims.empty()) { + _vm->_backAnimList[slotId].backAnims[currAnim]._state = 1; + } debugInterpreter("O_BACKANIMUPDATEOFF slotId %d", slotId); } void Interpreter::O_BACKANIMUPDATEON() { uint16 slotId = readScriptFlagValue(); int currAnim = _vm->_backAnimList[slotId]._seq._currRelative; - _vm->_backAnimList[slotId].backAnims[currAnim]._state = 0; - debugInterpreter("O_BACKANIMUPDATEON %d", slotId); + if (!_vm->_backAnimList[slotId].backAnims.empty()) { + _vm->_backAnimList[slotId].backAnims[currAnim]._state = 0; + } + debugInterpreter("O_BACKANIMUPDATEON slotId %d", slotId); } void Interpreter::O_CHANGECURSOR() { |