aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorlukaslw2014-08-05 18:11:33 +0200
committerlukaslw2014-08-05 18:11:33 +0200
commita3c829a7741630cf2aca1c142c782a111402902e (patch)
tree9b6316765ed02fafb055f5802016212dba031061 /engines
parent49337549d9959ec9858fb0e497c27b27febfc277 (diff)
downloadscummvm-rg350-a3c829a7741630cf2aca1c142c782a111402902e.tar.gz
scummvm-rg350-a3c829a7741630cf2aca1c142c782a111402902e.tar.bz2
scummvm-rg350-a3c829a7741630cf2aca1c142c782a111402902e.zip
PRINCE: Background animations - update
Diffstat (limited to 'engines')
-rw-r--r--engines/prince/script.cpp12
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() {