diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/saga/script.h | 3 | ||||
-rw-r--r-- | engines/saga/sthread.cpp | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/engines/saga/script.h b/engines/saga/script.h index f31af7b2ea..21afeb5c44 100644 --- a/engines/saga/script.h +++ b/engines/saga/script.h @@ -246,16 +246,19 @@ public: } void waitWalk(void *threadObj) { + debug(3, "waitWalk()"); wait(kWaitTypeWalk); _threadObj = threadObj; } void waitDelay(int sleepTime) { + debug(3, "waitDelay(%d)", sleepTime); wait(kWaitTypeDelay); _sleepTime = sleepTime; } void waitFrames(int frames) { + debug(3, "waitFrames(%d)", frames); wait(kWaitTypeWaitFrames); _frameWait = frames; } diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp index c133f8de88..be674e5acd 100644 --- a/engines/saga/sthread.cpp +++ b/engines/saga/sthread.cpp @@ -58,6 +58,8 @@ ScriptThread &Script::createThread(uint16 scriptModuleNumber, uint16 scriptEntry _threadList.push_front(newThread); + debug(3, "createThread(). Total threads: %d", _threadList.size()); + ScriptThread &tmp = *_threadList.begin(); tmp._stackBuf = (int16 *)malloc(ScriptThread::THREAD_STACK_SIZE * sizeof(int16)); tmp._stackTopIndex = ScriptThread::THREAD_STACK_SIZE - 2; @@ -78,6 +80,8 @@ void Script::wakeUpActorThread(int waitType, void *threadObj) { void Script::wakeUpThreads(int waitType) { ScriptThreadList::iterator threadIterator; + debug(3, "wakeUpThreads(%d)", waitType); + for (threadIterator = _threadList.begin(); threadIterator != _threadList.end(); ++threadIterator) { ScriptThread &thread = *threadIterator; if ((thread._flags & kTFlagWaiting) && (thread._waitType == waitType)) { @@ -89,6 +93,8 @@ void Script::wakeUpThreads(int waitType) { void Script::wakeUpThreadsDelayed(int waitType, int sleepTime) { ScriptThreadList::iterator threadIterator; + debug(3, "wakeUpThreads(%d, %d)", waitType, sleepTime); + for (threadIterator = _threadList.begin(); threadIterator != _threadList.end(); ++threadIterator) { ScriptThread &thread = *threadIterator; if ((thread._flags & kTFlagWaiting) && (thread._waitType == waitType)) { @@ -169,6 +175,8 @@ void Script::executeThreads(uint msec) { void Script::abortAllThreads() { ScriptThreadList::iterator threadIterator; + debug(3, "abortAllThreads()"); + threadIterator = _threadList.begin(); while (threadIterator != _threadList.end()) { |