aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/sthread.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-04-11 09:04:50 +0000
committerFilippos Karapetis2009-04-11 09:04:50 +0000
commit271f8b58b594aee76dcee625251a6ca9f517fcd8 (patch)
tree74d1bb4fcad1af42d7f2dcd4864cc8d96b3c0ae8 /engines/saga/sthread.cpp
parent64fc4253e8df69f7539809f8eabba20e1ca029db (diff)
downloadscummvm-rg350-271f8b58b594aee76dcee625251a6ca9f517fcd8.tar.gz
scummvm-rg350-271f8b58b594aee76dcee625251a6ca9f517fcd8.tar.bz2
scummvm-rg350-271f8b58b594aee76dcee625251a6ca9f517fcd8.zip
Removed move SortedList methods
svn-id: r39924
Diffstat (limited to 'engines/saga/sthread.cpp')
-rw-r--r--engines/saga/sthread.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp
index 70a73038a9..177cabb729 100644
--- a/engines/saga/sthread.cpp
+++ b/engines/saga/sthread.cpp
@@ -38,14 +38,13 @@
namespace Saga {
ScriptThread *Script::createThread(uint16 scriptModuleNumber, uint16 scriptEntryPointNumber) {
- ScriptThread *newThread;
+ ScriptThread *newThread = new ScriptThread();
loadModule(scriptModuleNumber);
if (_modules[scriptModuleNumber].entryPointsCount <= scriptEntryPointNumber) {
error("Script::createThread wrong scriptEntryPointNumber");
}
- newThread = &(*_threadList.pushFront());
newThread->_flags = kTFlagNone;
newThread->_stackSize = DEFAULT_THREAD_STACK_SIZE;
newThread->_stackBuf = (uint16 *)malloc(newThread->_stackSize * sizeof(uint16));
@@ -55,7 +54,6 @@ ScriptThread *Script::createThread(uint16 scriptModuleNumber, uint16 scriptEntry
newThread->_staticBase = _commonBuffer + _modules[scriptModuleNumber].staticOffset;
newThread->_moduleBase = _modules[scriptModuleNumber].moduleBase;
newThread->_moduleBaseSize = _modules[scriptModuleNumber].moduleBaseSize;
-
newThread->_strings = &_modules[scriptModuleNumber].strings;
if (_vm->getGameId() == GID_IHNM)
@@ -63,7 +61,9 @@ ScriptThread *Script::createThread(uint16 scriptModuleNumber, uint16 scriptEntry
else
newThread->_voiceLUT = &_modules[scriptModuleNumber].voiceLUT;
- return newThread;
+ _threadList.push_front(*newThread);
+
+ return &*_threadList.begin();
}
void Script::wakeUpActorThread(int waitType, void *threadObj) {