aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/scriptman.cpp
diff options
context:
space:
mode:
authorjohndoe1232014-03-21 17:21:55 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit762be35a364fe66359d29b85b650c6e7add80e47 (patch)
tree61a1d7dd5849f7d79f961f4f46ce77036a88ade9 /engines/illusions/scriptman.cpp
parent43cd806f17377d5244e575b863519f013e5f033c (diff)
downloadscummvm-rg350-762be35a364fe66359d29b85b650c6e7add80e47.tar.gz
scummvm-rg350-762be35a364fe66359d29b85b650c6e7add80e47.tar.bz2
scummvm-rg350-762be35a364fe66359d29b85b650c6e7add80e47.zip
ILLUSIONS: Add more script opcodes and fix/add stuff along the way
- Unload backgrounds - Add transparent sprite drawing - Add AbortableThread
Diffstat (limited to 'engines/illusions/scriptman.cpp')
-rw-r--r--engines/illusions/scriptman.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/illusions/scriptman.cpp b/engines/illusions/scriptman.cpp
index 527c0a5f3e..2ba39c7ae5 100644
--- a/engines/illusions/scriptman.cpp
+++ b/engines/illusions/scriptman.cpp
@@ -21,6 +21,7 @@
*/
#include "illusions/illusions.h"
+#include "illusions/abortablethread.h"
#include "illusions/actor.h"
#include "illusions/scriptman.h"
#include "illusions/scriptthread.h"
@@ -171,6 +172,15 @@ uint32 ScriptMan::startTimerThread(uint32 duration, uint32 threadId) {
return newTimerThread(duration, threadId, false);
}
+uint32 ScriptMan::startAbortableThread(byte *scriptCodeIp1, byte *scriptCodeIp2, uint32 callingThreadId) {
+ debug("Starting abortable thread");
+ uint32 tempThreadId = newTempThreadId();
+ uint32 scriptThreadId = startTempScriptThread(scriptCodeIp1, tempThreadId, 0, 0, 0);
+ AbortableThread *abortableThread = new AbortableThread(_vm, tempThreadId, callingThreadId, 0, scriptThreadId, scriptCodeIp2);
+ _threads->startThread(abortableThread);
+ return tempThreadId;
+}
+
void ScriptMan::setCurrFontId(uint32 fontId) {
_fontId = fontId;
}
@@ -198,7 +208,7 @@ void ScriptMan::exitScene(uint32 threadId) {
_threads->terminateThreadsByTag(sceneId, threadId);
_vm->_controls->destroyControlsByTag(sceneId);
// TODO causeFunc_removeBySceneId(sceneId);
- // TODO _vm->_resSys->unloadResourceByTag(sceneId);
+ _vm->_resSys->unloadResourcesByTag(sceneId);
_activeScenes.pop();
}