aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/duckman
diff options
context:
space:
mode:
authorjohndoe1232015-11-28 23:38:30 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit15498a231aca26c701fa5f123fbe2e0f1bd9cf67 (patch)
tree1005ad0dc035f03a43e72ec13e59f4e981f437f3 /engines/illusions/duckman
parent2b9af91d8fbda6f47d16d3fb0e7e6bb6206b016e (diff)
downloadscummvm-rg350-15498a231aca26c701fa5f123fbe2e0f1bd9cf67.tar.gz
scummvm-rg350-15498a231aca26c701fa5f123fbe2e0f1bd9cf67.tar.bz2
scummvm-rg350-15498a231aca26c701fa5f123fbe2e0f1bd9cf67.zip
ILLUSIONS: DUCKMAN: Implement opcode 21
Diffstat (limited to 'engines/illusions/duckman')
-rw-r--r--engines/illusions/duckman/illusions_duckman.cpp8
-rw-r--r--engines/illusions/duckman/illusions_duckman.h2
-rw-r--r--engines/illusions/duckman/scriptopcodes_duckman.cpp6
-rw-r--r--engines/illusions/duckman/scriptopcodes_duckman.h1
4 files changed, 16 insertions, 1 deletions
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp
index db8f83c295..272a7d619b 100644
--- a/engines/illusions/duckman/illusions_duckman.cpp
+++ b/engines/illusions/duckman/illusions_duckman.cpp
@@ -694,6 +694,14 @@ uint32 IllusionsEngine_Duckman::startTempScriptThread(byte *scriptCodeIp, uint32
return tempThreadId;
}
+void IllusionsEngine_Duckman::resumeFromSavegame(uint32 callingThreadId) {
+ _input->discardAllEvents();
+ if (changeScene(_savegameSceneId, _savegameThreadId, callingThreadId)) {
+ _savegameSceneId = 0;
+ _savegameThreadId = 0;
+ }
+}
+
void IllusionsEngine_Duckman::newScriptThread(uint32 threadId, uint32 callingThreadId, uint notifyFlags,
byte *scriptCodeIp) {
ScriptThread *scriptThread = new ScriptThread(this, threadId, callingThreadId, notifyFlags,
diff --git a/engines/illusions/duckman/illusions_duckman.h b/engines/illusions/duckman/illusions_duckman.h
index e2b3223efc..c9467366f5 100644
--- a/engines/illusions/duckman/illusions_duckman.h
+++ b/engines/illusions/duckman/illusions_duckman.h
@@ -150,6 +150,8 @@ public:
uint32 sequenceId2, uint32 callingThreadId);
uint32 startTempScriptThread(byte *scriptCodeIp, uint32 callingThreadId,
uint32 value8, uint32 valueC, uint32 value10);
+ void resumeFromSavegame(uint32 callingThreadId);
+
void newScriptThread(uint32 threadId, uint32 callingThreadId, uint notifyFlags,
byte *scriptCodeIp);
uint32 newTimerThread(uint32 duration, uint32 callingThreadId, bool isAbortable);
diff --git a/engines/illusions/duckman/scriptopcodes_duckman.cpp b/engines/illusions/duckman/scriptopcodes_duckman.cpp
index 618a6e4a13..5abef682b6 100644
--- a/engines/illusions/duckman/scriptopcodes_duckman.cpp
+++ b/engines/illusions/duckman/scriptopcodes_duckman.cpp
@@ -76,7 +76,7 @@ void ScriptOpcodes_Duckman::initOpcodes() {
OPCODE(18, opEnterScene18);
OPCODE(19, opUnloadResourcesBySceneId);
OPCODE(20, opChangeScene);
- // TODO OPCODE(21, );
+ OPCODE(21, opResumeFromSavegame);
OPCODE(22, opStartModalScene);
OPCODE(23, opExitModalScene);
OPCODE(24, opEnterScene24);
@@ -328,6 +328,10 @@ void ScriptOpcodes_Duckman::opChangeScene(ScriptThread *scriptThread, OpCall &op
}
}
+void ScriptOpcodes_Duckman::opResumeFromSavegame(ScriptThread *scriptThread, OpCall &opCall) {
+ _vm->resumeFromSavegame(opCall._callerThreadId);
+}
+
void ScriptOpcodes_Duckman::opStartModalScene(ScriptThread *scriptThread, OpCall &opCall) {
ARG_SKIP(2);
ARG_UINT32(sceneId);
diff --git a/engines/illusions/duckman/scriptopcodes_duckman.h b/engines/illusions/duckman/scriptopcodes_duckman.h
index 6b3b2ec6c4..1dbe6e6e6d 100644
--- a/engines/illusions/duckman/scriptopcodes_duckman.h
+++ b/engines/illusions/duckman/scriptopcodes_duckman.h
@@ -57,6 +57,7 @@ protected:
void opEnterScene18(ScriptThread *scriptThread, OpCall &opCall);
void opUnloadResourcesBySceneId(ScriptThread *scriptThread, OpCall &opCall);
void opChangeScene(ScriptThread *scriptThread, OpCall &opCall);
+ void opResumeFromSavegame(ScriptThread *scriptThread, OpCall &opCall);
void opStartModalScene(ScriptThread *scriptThread, OpCall &opCall);
void opExitModalScene(ScriptThread *scriptThread, OpCall &opCall);
void opEnterScene24(ScriptThread *scriptThread, OpCall &opCall);