aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions
diff options
context:
space:
mode:
authorjohndoe1232014-03-24 10:15:04 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commita6a4a3dc1cb346afc1f7b0491158d8b00ac063c5 (patch)
treec160c8aac1c7c5686a4dab252b8b9fdfcbadf5de /engines/illusions
parentfc4266bcadaf7c01bf558ef78a9702254803ca77 (diff)
downloadscummvm-rg350-a6a4a3dc1cb346afc1f7b0491158d8b00ac063c5.tar.gz
scummvm-rg350-a6a4a3dc1cb346afc1f7b0491158d8b00ac063c5.tar.bz2
scummvm-rg350-a6a4a3dc1cb346afc1f7b0491158d8b00ac063c5.zip
ILLUSIONS: Implement more script opcodes
Diffstat (limited to 'engines/illusions')
-rw-r--r--engines/illusions/actor.cpp107
-rw-r--r--engines/illusions/actor.h3
-rw-r--r--engines/illusions/actorresource.cpp26
-rw-r--r--engines/illusions/actorresource.h2
-rw-r--r--engines/illusions/scriptman.cpp23
-rw-r--r--engines/illusions/scriptman.h2
-rw-r--r--engines/illusions/scriptopcodes.cpp58
-rw-r--r--engines/illusions/scriptopcodes.h7
-rw-r--r--engines/illusions/sequenceopcodes.cpp33
-rw-r--r--engines/illusions/sequenceopcodes.h1
-rw-r--r--engines/illusions/talkthread.cpp2
11 files changed, 207 insertions, 57 deletions
diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp
index 933ebee18e..b813ff0cc9 100644
--- a/engines/illusions/actor.cpp
+++ b/engines/illusions/actor.cpp
@@ -533,6 +533,26 @@ void Control::stopSequenceActor() {
}
}
+void Control::startTalkActor(uint32 sequenceId, byte *entryTblPtr, uint32 threadId) {
+ bool doSeq = true;
+ if (_actor->_linkIndex2) {
+ Control *subControl = _vm->_dict->getObjectControl(_actor->_subobjects[_actor->_linkIndex2 - 1]);
+ if (subControl->_actor->_flags & 1) {
+ /* TODO
+ if (control->_actor->pathNode) {
+ doSeq = false;
+ subControl->_actor->notifyThreadId2 = threadId;
+ subControl->_actor->entryTblPtr = entryTblPtr;
+ subControl->_actor->flags |= 0x80;
+ script_TalkThreads_sub_417FA0(subControl->_actor->_notifyThreadId2, 0);
+ }
+ */
+ }
+ }
+ if (doSeq)
+ startSequenceActorIntern(sequenceId, 2, entryTblPtr, threadId);
+}
+
void Control::sequenceActor() {
if (_actor->_pauseCtr > 0)
@@ -591,15 +611,14 @@ void Control::startSequenceActorIntern(uint32 sequenceId, int value, byte *entry
_actor->_flags |= 0x0100;
sequenceId = _actor->_defaultSequences.use(sequenceId);
-
+
_actor->_sequenceId = sequenceId;
_actor->_notifyThreadId1 = notifyThreadId;
_actor->_notifyId3C = 0;
_actor->_path40 = 0;
Sequence *sequence = _vm->_dict->findSequence(sequenceId);
- debug(1, "Control::startSequenceActorIntern() sequence = %p", (void*)sequence);
-
+
_actor->_seqCodeIp = sequence->_sequenceCode;
_actor->_frames = _vm->_actorItems->findSequenceFrames(sequence);
@@ -774,6 +793,58 @@ void Controls::destroyControlsByTag(uint32 tag) {
}
}
+void Controls::pauseControlsByTag(uint32 tag) {
+ for (ItemsIterator it = _controls.begin(); it != _controls.end(); ++it) {
+ Control *control = *it;
+ if (control->_tag == tag) {
+ ++control->_pauseCtr;
+ if (control->_pauseCtr == 1)
+ control->pause();
+ }
+ }
+}
+
+void Controls::unpauseControlsByTag(uint32 tag) {
+ for (ItemsIterator it = _controls.begin(); it != _controls.end(); ++it) {
+ Control *control = *it;
+ if (control->_tag == tag) {
+ --control->_pauseCtr;
+ if (control->_pauseCtr == 0)
+ control->unpause();
+ }
+ }
+}
+
+void Controls::actorControlRouine(Control *control, uint32 deltaTime) {
+
+ Actor *actor = control->_actor;
+
+ if (actor->_pauseCtr > 0)
+ return;
+
+ if (false/*actor->_pathNode*/) {
+ // TODO Update pathwalking
+ } else {
+ actor->_seqCodeValue1 = 100 * deltaTime;
+ }
+
+ if (actor->_flags & 4) {
+ int scale = actor->_scaleLayer->getScale(actor->_position);
+ control->setActorScale(scale);
+ }
+
+ if (actor->_flags & 8) {
+ int16 priority = actor->_priorityLayer->getPriority(actor->_position);
+ if (priority)
+ control->setPriority(priority + 1);
+ }
+
+ if (actor->_flags & 0x20) {
+ // TODO Update transition sequence (seems to be unused in BBDOU?)
+ }
+
+}
+
Actor *Controls::newActor() {
return new Actor(_vm);
}
@@ -811,34 +882,4 @@ void Controls::destroyControl(Control *control) {
delete control;
}
-void Controls::actorControlRouine(Control *control, uint32 deltaTime) {
-
- Actor *actor = control->_actor;
-
- if (actor->_pauseCtr > 0)
- return;
-
- if (false/*actor->_pathNode*/) {
- // TODO Update pathwalking
- } else {
- actor->_seqCodeValue1 = 100 * deltaTime;
- }
-
- if (actor->_flags & 4) {
- int scale = actor->_scaleLayer->getScale(actor->_position);
- control->setActorScale(scale);
- }
-
- if (actor->_flags & 8) {
- int16 priority = actor->_priorityLayer->getPriority(actor->_position);
- if (priority)
- control->setPriority(priority + 1);
- }
-
- if (actor->_flags & 0x20) {
- // TODO Update transition sequence (seems to be unused in BBDOU?)
- }
-
-}
-
} // End of namespace Illusions
diff --git a/engines/illusions/actor.h b/engines/illusions/actor.h
index 28c539a667..fe5564e0a7 100644
--- a/engines/illusions/actor.h
+++ b/engines/illusions/actor.h
@@ -167,6 +167,7 @@ public:
void stopActor();
void startSequenceActor(uint32 sequenceId, int value, uint32 notifyThreadId);
void stopSequenceActor();
+ void startTalkActor(uint32 sequenceId, byte *entryTblPtr, uint32 threadId);
void sequenceActor();
public:
IllusionsEngine *_vm;
@@ -198,6 +199,8 @@ public:
void placeSequenceLessActor(uint32 objectId, Common::Point placePt, WidthHeight dimensions, int16 priority);
void placeActorLessObject(uint32 objectId, Common::Point feetPt, Common::Point pt, int16 priority, uint flags);
void destroyControlsByTag(uint32 tag);
+ void pauseControlsByTag(uint32 tag);
+ void unpauseControlsByTag(uint32 tag);
void actorControlRouine(Control *control, uint32 deltaTime);
public:
typedef Common::List<Control*> Items;
diff --git a/engines/illusions/actorresource.cpp b/engines/illusions/actorresource.cpp
index 831a932b7a..bb3cd4debc 100644
--- a/engines/illusions/actorresource.cpp
+++ b/engines/illusions/actorresource.cpp
@@ -33,6 +33,7 @@ void ActorResourceLoader::load(Resource *resource) {
ActorResource *actorResource = new ActorResource();
actorResource->load(resource->_data, resource->_dataSize);
+ resource->_refId = actorResource;
ActorItem *actorItem = _vm->_actorItems->allocActorItem();
actorItem->_tag = resource->_tag;
@@ -63,6 +64,17 @@ void ActorResourceLoader::load(Resource *resource) {
}
void ActorResourceLoader::unload(Resource *resource) {
+ debug("ActorResourceLoader::unload() Unloading actor %08X...", resource->_resId);
+ // TODO Move to ActorItems
+ ActorItem *actorItem = _vm->_actorItems->findActorByResource((ActorResource*)resource->_refId);
+ if (actorItem->_pauseCtr <= 0) {
+ for (uint i = 0; i < actorItem->_actRes->_actorTypes.size(); ++i)
+ _vm->_dict->removeActorType(actorItem->_actRes->_actorTypes[i]._actorTypeId);
+ for (uint i = 0; i < actorItem->_actRes->_sequences.size(); ++i)
+ _vm->_dict->removeSequence(actorItem->_actRes->_sequences[i]._sequenceId);
+ }
+ _vm->_actorItems->freeActorItem(actorItem);
+ delete actorItem->_actRes;
}
void ActorResourceLoader::buildFilename(Resource *resource) {
@@ -241,6 +253,11 @@ ActorItem *ActorItems::allocActorItem() {
return actorItem;
}
+void ActorItems::freeActorItem(ActorItem *actorItem) {
+ _items.remove(actorItem);
+ delete actorItem;
+}
+
void ActorItems::pauseByTag(uint32 tag) {
for (ItemsIterator it = _items.begin(); it != _items.end(); ++it)
if ((*it)->_tag == tag)
@@ -250,7 +267,7 @@ void ActorItems::pauseByTag(uint32 tag) {
void ActorItems::unpauseByTag(uint32 tag) {
for (ItemsIterator it = _items.begin(); it != _items.end(); ++it)
if ((*it)->_tag == tag)
- (*it)->pause();
+ (*it)->unpause();
}
FramesList *ActorItems::findSequenceFrames(Sequence *sequence) {
@@ -262,4 +279,11 @@ FramesList *ActorItems::findSequenceFrames(Sequence *sequence) {
return 0;
}
+ActorItem *ActorItems::findActorByResource(ActorResource *actorResource) {
+ for (ItemsIterator it = _items.begin(); it != _items.end(); ++it)
+ if ((*it)->_actRes == actorResource)
+ return (*it);
+ return 0;
+}
+
} // End of namespace Illusions
diff --git a/engines/illusions/actorresource.h b/engines/illusions/actorresource.h
index b15f3a0670..e22ed7ed10 100644
--- a/engines/illusions/actorresource.h
+++ b/engines/illusions/actorresource.h
@@ -111,9 +111,11 @@ public:
ActorItems(IllusionsEngine *vm);
~ActorItems();
ActorItem *allocActorItem();
+ void freeActorItem(ActorItem *actorItem);
void pauseByTag(uint32 tag);
void unpauseByTag(uint32 tag);
FramesList *findSequenceFrames(Sequence *sequence);
+ ActorItem *findActorByResource(ActorResource *actorResource);
protected:
typedef Common::List<ActorItem*> Items;
typedef Items::iterator ItemsIterator;
diff --git a/engines/illusions/scriptman.cpp b/engines/illusions/scriptman.cpp
index eaaeaa57a7..de18dee9dc 100644
--- a/engines/illusions/scriptman.cpp
+++ b/engines/illusions/scriptman.cpp
@@ -21,9 +21,10 @@
*/
#include "illusions/illusions.h"
+#include "illusions/scriptman.h"
#include "illusions/abortablethread.h"
#include "illusions/actor.h"
-#include "illusions/scriptman.h"
+#include "illusions/camera.h"
#include "illusions/scriptthread.h"
#include "illusions/scriptopcodes.h"
#include "illusions/talkthread.h"
@@ -251,6 +252,26 @@ void ScriptMan::exitScene(uint32 threadId) {
_activeScenes.pop();
}
+void ScriptMan::enterPause(uint32 threadId) {
+ uint32 sceneId = _activeScenes.getCurrentScene();
+ _vm->_camera->pushCameraMode();
+ _threads->suspendThreadsByTag(sceneId, threadId);
+ _vm->_controls->pauseControlsByTag(sceneId);
+ _vm->_actorItems->pauseByTag(sceneId);
+ _vm->_backgroundItems->pauseByTag(sceneId);
+ _activeScenes.pauseActiveScene();
+}
+
+void ScriptMan::leavePause(uint32 threadId) {
+ uint32 sceneId = _activeScenes.getCurrentScene();
+ _vm->_backgroundItems->unpauseByTag(sceneId);
+ _vm->_actorItems->unpauseByTag(sceneId);
+ _vm->_controls->unpauseControlsByTag(sceneId);
+ _threads->notifyThreadsByTag(sceneId, threadId);
+ _vm->_camera->popCameraMode();
+ _activeScenes.unpauseActiveScene();
+}
+
void ScriptMan::newScriptThread(uint32 threadId, uint32 callingThreadId, uint notifyFlags,
byte *scriptCodeIp, uint32 value8, uint32 valueC, uint32 value10) {
ScriptThread *scriptThread = new ScriptThread(_vm, threadId, callingThreadId, notifyFlags,
diff --git a/engines/illusions/scriptman.h b/engines/illusions/scriptman.h
index fc11cdfec3..bd9f2c71d7 100644
--- a/engines/illusions/scriptman.h
+++ b/engines/illusions/scriptman.h
@@ -89,6 +89,8 @@ public:
void reset();
bool enterScene(uint32 sceneId, uint32 threadId);
void exitScene(uint32 threadId);
+ void enterPause(uint32 threadId);
+ void leavePause(uint32 threadId);
public:
IllusionsEngine *_vm;
diff --git a/engines/illusions/scriptopcodes.cpp b/engines/illusions/scriptopcodes.cpp
index 0212b10d10..8d19fbfc11 100644
--- a/engines/illusions/scriptopcodes.cpp
+++ b/engines/illusions/scriptopcodes.cpp
@@ -92,8 +92,11 @@ void ScriptOpcodes::initOpcodes() {
OPCODE(14, opSetThreadSceneId);
OPCODE(15, opEndTalkThreads);
OPCODE(16, opLoadResource);
+ OPCODE(17, opUnloadResource);
OPCODE(20, opEnterScene);
OPCODE(25, opChangeScene);
+ OPCODE(30, opEnterCloseUpScene);
+ OPCODE(31, opExitCloseUpScene);
OPCODE(39, opSetDisplay);
OPCODE(42, opIncBlockCounter);
OPCODE(45, opSetProperty);
@@ -109,7 +112,10 @@ void ScriptOpcodes::initOpcodes() {
OPCODE(65, opSetDenySfx);
OPCODE(66, opSetAdjustUpSfx);
OPCODE(67, opSetAdjustDnSfx);
+ OPCODE(71, opStartSound);
+ OPCODE(74, opStopSound);
OPCODE(75, opStartMusic);
+ OPCODE(76, opStopMusic);
OPCODE(78, opStackPushRandom);
OPCODE(79, opIfLte);
OPCODE(80, opAddMenuChoice);
@@ -128,6 +134,7 @@ void ScriptOpcodes::initOpcodes() {
OPCODE(147, opStackDup);
OPCODE(148, opLoadSpecialCodeModule);
OPCODE(150, opRunSpecialCode);
+ OPCODE(160, opStopActor);
OPCODE(161, opSetActorUsePan);
OPCODE(168, opStartAbortableThread);
OPCODE(169, opKillThread);
@@ -214,6 +221,13 @@ void ScriptOpcodes::opLoadResource(ScriptThread *scriptThread, OpCall &opCall) {
_vm->_resSys->loadResource(resourceId, sceneId, opCall._threadId);
}
+void ScriptOpcodes::opUnloadResource(ScriptThread *scriptThread, OpCall &opCall) {
+ ARG_SKIP(2);
+ ARG_UINT32(resourceId);
+ // NOTE Skipped checking for stalled resources
+ _vm->_resSys->unloadResourceById(resourceId);
+}
+
void ScriptOpcodes::opEnterScene(ScriptThread *scriptThread, OpCall &opCall) {
ARG_SKIP(2);
ARG_UINT32(sceneId);
@@ -241,6 +255,21 @@ void ScriptOpcodes::opChangeScene(ScriptThread *scriptThread, OpCall &opCall) {
scriptThread->_value8, scriptThread->_valueC, scriptThread->_value10);
}
+void ScriptOpcodes::opEnterCloseUpScene(ScriptThread *scriptThread, OpCall &opCall) {
+ ARG_SKIP(2);
+ ARG_UINT32(sceneId);
+ // NOTE Skipped checking for stalled resources
+ _vm->_input->discardButtons(0xFFFF);
+ _vm->_scriptMan->enterPause(opCall._callerThreadId);
+ _vm->_scriptMan->enterScene(sceneId, opCall._callerThreadId);
+}
+
+void ScriptOpcodes::opExitCloseUpScene(ScriptThread *scriptThread, OpCall &opCall) {
+ _vm->_scriptMan->exitScene(opCall._callerThreadId);
+ _vm->_scriptMan->leavePause(opCall._callerThreadId);
+ opCall._result = kTSYield;
+}
+
void ScriptOpcodes::opSetDisplay(ScriptThread *scriptThread, OpCall &opCall) {
ARG_INT16(flag);
_vm->_screen->setDisplayOn(flag != 0);
@@ -275,6 +304,7 @@ void ScriptOpcodes::opStartSequenceActor(ScriptThread *scriptThread, OpCall &opC
ARG_UINT32(sequenceId);
// NOTE Skipped checking for stalled sequence, not sure if needed
Control *control = _vm->_dict->getObjectControl(objectId);
+ debug("control: %p", (void*)control);
control->startSequenceActor(sequenceId, 2, opCall._threadId);
}
@@ -356,6 +386,20 @@ void ScriptOpcodes::opSetAdjustDnSfx(ScriptThread *scriptThread, OpCall &opCall)
ARG_UINT32(soundEffectId);
// TODO _vm->setAdjustDnSfx(soundEffectId);
}
+
+void ScriptOpcodes::opStartSound(ScriptThread *scriptThread, OpCall &opCall) {
+ ARG_SKIP(2);
+ ARG_INT16(volume);
+ ARG_INT16(pan);
+ ARG_UINT32(soundEffectId);
+ // TODO _vm->startSound(soundEffectId, volume, pan);
+}
+void ScriptOpcodes::opStopSound(ScriptThread *scriptThread, OpCall &opCall) {
+ ARG_SKIP(2);
+ ARG_UINT32(soundEffectId);
+ // TODO _vm->stopSound(soundEffectId);
+}
+
void ScriptOpcodes::opStartMusic(ScriptThread *scriptThread, OpCall &opCall) {
ARG_SKIP(2);
ARG_INT16(volume);
@@ -365,6 +409,10 @@ void ScriptOpcodes::opStartMusic(ScriptThread *scriptThread, OpCall &opCall) {
// TODO _vm->playMusic(musicId, type, volume, pan);
}
+void ScriptOpcodes::opStopMusic(ScriptThread *scriptThread, OpCall &opCall) {
+ // TODO _vm->stopMusic();
+}
+
void ScriptOpcodes::opStackPushRandom(ScriptThread *scriptThread, OpCall &opCall) {
ARG_INT16(maxValue);
_vm->_scriptMan->_stack.push(_vm->getRandom(maxValue) + 1);
@@ -406,7 +454,6 @@ void ScriptOpcodes::opSwitchMenuChoice(ScriptThread *scriptThread, OpCall &opCal
_vm->_scriptMan->_menuChoiceOfs = 88; // DEBUG Chose "Start game"
opCall._deltaOfs += _vm->_scriptMan->_menuChoiceOfs;
-debug("deltaOfs = %08X", opCall._deltaOfs);
}
void ScriptOpcodes::opResetGame(ScriptThread *scriptThread, OpCall &opCall) {
@@ -451,7 +498,6 @@ void ScriptOpcodes::opCompareBlockCounter(ScriptThread *scriptThread, OpCall &op
ARG_INT16(compareOp);
ARG_INT16(rvalue);
int16 lvalue = _vm->_scriptMan->_scriptResource->_blockCounters.get(index);
- debug("lvalue = %d", lvalue);
bool compareResult = false;
switch (compareOp) {
case 1:
@@ -473,7 +519,6 @@ void ScriptOpcodes::opCompareBlockCounter(ScriptThread *scriptThread, OpCall &op
compareResult = lvalue <= rvalue;
break;
}
- debug(" compareResult -> %d", compareResult);
_vm->_scriptMan->_stack.push(compareResult ? 1 : 0);
}
@@ -521,6 +566,13 @@ void ScriptOpcodes::opRunSpecialCode(ScriptThread *scriptThread, OpCall &opCall)
}
+void ScriptOpcodes::opStopActor(ScriptThread *scriptThread, OpCall &opCall) {
+ ARG_SKIP(2);
+ ARG_UINT32(objectId);
+ Control *control = _vm->_dict->getObjectControl(objectId);
+ control->stopActor();
+}
+
void ScriptOpcodes::opSetActorUsePan(ScriptThread *scriptThread, OpCall &opCall) {
ARG_INT16(usePan)
ARG_UINT32(objectId);
diff --git a/engines/illusions/scriptopcodes.h b/engines/illusions/scriptopcodes.h
index 209aa78017..0e75f780de 100644
--- a/engines/illusions/scriptopcodes.h
+++ b/engines/illusions/scriptopcodes.h
@@ -69,8 +69,11 @@ protected:
void opSetThreadSceneId(ScriptThread *scriptThread, OpCall &opCall);
void opEndTalkThreads(ScriptThread *scriptThread, OpCall &opCall);
void opLoadResource(ScriptThread *scriptThread, OpCall &opCall);
+ void opUnloadResource(ScriptThread *scriptThread, OpCall &opCall);
void opEnterScene(ScriptThread *scriptThread, OpCall &opCall);
void opChangeScene(ScriptThread *scriptThread, OpCall &opCall);
+ void opEnterCloseUpScene(ScriptThread *scriptThread, OpCall &opCall);
+ void opExitCloseUpScene(ScriptThread *scriptThread, OpCall &opCall);
void opSetDisplay(ScriptThread *scriptThread, OpCall &opCall);
void opIncBlockCounter(ScriptThread *scriptThread, OpCall &opCall);
void opSetProperty(ScriptThread *scriptThread, OpCall &opCall);
@@ -86,7 +89,10 @@ protected:
void opSetDenySfx(ScriptThread *scriptThread, OpCall &opCall);
void opSetAdjustUpSfx(ScriptThread *scriptThread, OpCall &opCall);
void opSetAdjustDnSfx(ScriptThread *scriptThread, OpCall &opCall);
+ void opStartSound(ScriptThread *scriptThread, OpCall &opCall);
+ void opStopSound(ScriptThread *scriptThread, OpCall &opCall);
void opStartMusic(ScriptThread *scriptThread, OpCall &opCall);
+ void opStopMusic(ScriptThread *scriptThread, OpCall &opCall);
void opStackPushRandom(ScriptThread *scriptThread, OpCall &opCall);
void opIfLte(ScriptThread *scriptThread, OpCall &opCall);
void opAddMenuChoice(ScriptThread *scriptThread, OpCall &opCall);
@@ -105,6 +111,7 @@ protected:
void opStackDup(ScriptThread *scriptThread, OpCall &opCall);
void opLoadSpecialCodeModule(ScriptThread *scriptThread, OpCall &opCall);
void opRunSpecialCode(ScriptThread *scriptThread, OpCall &opCall);
+ void opStopActor(ScriptThread *scriptThread, OpCall &opCall);
void opSetActorUsePan(ScriptThread *scriptThread, OpCall &opCall);
void opStartAbortableThread(ScriptThread *scriptThread, OpCall &opCall);
void opKillThread(ScriptThread *scriptThread, OpCall &opCall);
diff --git a/engines/illusions/sequenceopcodes.cpp b/engines/illusions/sequenceopcodes.cpp
index b550be6097..2495bcac7f 100644
--- a/engines/illusions/sequenceopcodes.cpp
+++ b/engines/illusions/sequenceopcodes.cpp
@@ -64,6 +64,7 @@ void SequenceOpcodes::initOpcodes() {
OPCODE(12, opNextLoop);
OPCODE(14, opSwitchActorIndex);
OPCODE(15, opSwitchFacing);
+ OPCODE(17, opDisappearActor);
OPCODE(28, opNotifyThreadId1);
OPCODE(29, opSetPathCtrY);
OPCODE(33, opSetPathWalkPoints);
@@ -92,26 +93,17 @@ void SequenceOpcodes::freeOpcodes() {
void SequenceOpcodes::opSetFrameIndex(Control *control, OpCall &opCall) {
ARG_INT16(frameIndex);
if (control->_actor->_flags & 0x80) {
- debug(1, "opSetFrameIndex TODO");
- /* TODO
- v9 = actor->field30;
- if (*(_WORD *)v9) {
- LOWORD(flag) = *(_WORD *)v9;
- v6 = v6 + flag - 1;
- actor->field30 = v9 + 2;
+ int16 frameIncr = READ_LE_UINT16(control->_actor->_entryTblPtr);
+ if (frameIncr) {
+ frameIndex += frameIncr - 1;
+ control->_actor->_entryTblPtr += 2;
} else {
- actor->flags &= 0xFF7Fu;
- v10 = actor->notifyThreadId1;
- actor->field30 = 0;
- actor->notifyThreadId2 = 0;
- if (v10) {
- actor->notifyThreadId1 = 0;
- ThreadList_notifyId__(v10);
- }
- actorDead = 1;
- breakInner = 1;
+ control->_actor->_flags &= ~0x80;
+ control->_actor->_entryTblPtr = 0;
+ control->_actor->_notifyThreadId2 = 0;
+ _vm->notifyThreadId(control->_actor->_notifyThreadId1);
+ opCall._result = 1;
}
- */
}
control->_actor->_flags &= ~0x0100;
if (control->_actor->_flags & 0x8000) {
@@ -191,6 +183,11 @@ void SequenceOpcodes::opSwitchFacing(Control *control, OpCall &opCall) {
opCall._deltaOfs += jumpOffs;
}
+void SequenceOpcodes::opDisappearActor(Control *control, OpCall &opCall) {
+ control->disappearActor();
+ control->_actor->_newFrameIndex = 0;
+}
+
void SequenceOpcodes::opNotifyThreadId1(Control *control, OpCall &opCall) {
_vm->notifyThreadId(control->_actor->_notifyThreadId1);
}
diff --git a/engines/illusions/sequenceopcodes.h b/engines/illusions/sequenceopcodes.h
index 31827aaf7e..dd1302f9e9 100644
--- a/engines/illusions/sequenceopcodes.h
+++ b/engines/illusions/sequenceopcodes.h
@@ -55,6 +55,7 @@ protected:
void opNextLoop(Control *control, OpCall &opCall);
void opSwitchActorIndex(Control *control, OpCall &opCall);
void opSwitchFacing(Control *control, OpCall &opCall);
+ void opDisappearActor(Control *control, OpCall &opCall);
void opNotifyThreadId1(Control *control, OpCall &opCall);
void opSetPathCtrY(Control *control, OpCall &opCall);
void opSetPathWalkPoints(Control *control, OpCall &opCall);
diff --git a/engines/illusions/talkthread.cpp b/engines/illusions/talkthread.cpp
index 50c62660c4..fc777b7aef 100644
--- a/engines/illusions/talkthread.cpp
+++ b/engines/illusions/talkthread.cpp
@@ -138,7 +138,7 @@ int TalkThread::onUpdate() {
refreshText();
if (!(_flags & 2)) {
Control *control = _vm->_dict->getObjectControl(_objectId);
- // TODOcontrol->startTalkActor(_sequenceId1, _entryTblPtr, _threadId);
+ control->startTalkActor(_sequenceId1, _entryTblPtr, _threadId);
}
if (!(_flags & 4)) {
int16 panX = 0;