diff options
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/object.cpp | 11 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v80he.cpp | 11 | ||||
-rw-r--r-- | scumm/scumm.h | 1 |
5 files changed, 25 insertions, 1 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 062db31d8f..316347a812 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -778,6 +778,7 @@ protected: virtual const char *getOpcodeDesc(byte i); /* HE version 80 script opcodes */ + void o80_setState(); }; class ScummEngine_v90he : public ScummEngine_v80he { diff --git a/scumm/object.cpp b/scumm/object.cpp index 0b02463340..dc61789aa8 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -851,6 +851,17 @@ void ScummEngine::addObjectToDrawQue(int object) { _drawObjectQue[_drawObjectQueNr++] = object; } +void ScummEngine::removeObjectFromDrawQue(int object) { + if (_drawObjectQue <= 0) + return; + + int i; + for (i = 0; i < _drawObjectQueNr; i++) { + if (_drawObjectQue[i] = object) + _drawObjectQue[i] = 0; + } +} + void ScummEngine::clearDrawObjectQueue() { _drawObjectQueNr = 0; } diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index 6887f8ddf3..a581c1245f 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -391,6 +391,8 @@ void ScummEngine_v6he::o6_setState() { if (state & 0x8000) { state = state & 0x7F00; putState(obj, state); + if (_heversion >= 72) + removeObjectFromDrawQue(obj); return; } diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp index 52021deffd..938a6867bf 100644 --- a/scumm/script_v80he.cpp +++ b/scumm/script_v80he.cpp @@ -185,7 +185,7 @@ void ScummEngine_v80he::setupOpcodes() { OPCODE(o6_setClass), OPCODE(o6_getState), /* 70 */ - OPCODE(o6_setState), + OPCODE(o80_setState), OPCODE(o6_setOwner), OPCODE(o6_getOwner), OPCODE(o6_jump), @@ -378,4 +378,13 @@ const char *ScummEngine_v80he::getOpcodeDesc(byte i) { return _opcodesV80he[i].desc; } +void ScummEngine_v80he::o80_setState() { + int state = pop(); + int obj = pop(); + + state = state & 0x7F00; + putState(obj, state); + removeObjectFromDrawQue(obj); +} + } // End of namespace Scumm diff --git a/scumm/scumm.h b/scumm/scumm.h index 51ef188288..1c08b407a7 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -758,6 +758,7 @@ protected: void setObjectName(int obj); void addObjectToDrawQue(int object); + void removeObjectFromDrawQue(int object); void clearDrawObjectQueue(); void processDrawQue(); |