diff options
author | Paul Gilbert | 2012-05-06 21:24:55 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-05-06 21:24:55 +1000 |
commit | 156d8cdb733fe03688da9e2e9844b722681bed7f (patch) | |
tree | 6f255fd9f1e53c84e434907c30dc1769af0b930e /engines/tony/mpal | |
parent | 8bfc60f5c9bdba4b1f37fcf42df4b0aa360c325f (diff) | |
download | scummvm-rg350-156d8cdb733fe03688da9e2e9844b722681bed7f.tar.gz scummvm-rg350-156d8cdb733fe03688da9e2e9844b722681bed7f.tar.bz2 scummvm-rg350-156d8cdb733fe03688da9e2e9844b722681bed7f.zip |
TONY: Bugfix for waitForSingleObject, and added action process debug information
Diffstat (limited to 'engines/tony/mpal')
-rw-r--r-- | engines/tony/mpal/mpal.cpp | 18 | ||||
-rw-r--r-- | engines/tony/mpal/mpal.h | 3 |
2 files changed, 18 insertions, 3 deletions
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp index 9000693292..26cbf3652d 100644 --- a/engines/tony/mpal/mpal.cpp +++ b/engines/tony/mpal/mpal.cpp @@ -102,7 +102,8 @@ static byte * lpMpcImage; LPITEMIRQFUNCTION lpiifCustom=NULL; -LPLPCUSTOMFUNCTION lplpFunctions=NULL; +LPLPCUSTOMFUNCTION lplpFunctions = NULL; +Common::String * lplpFunctionStrings = NULL; uint16 nObjs; uint16 nVars; @@ -959,6 +960,12 @@ void ActionThread(CORO_PARAM, const void *param) { if (item->Command[_ctx->k].type == 1) { // Custom function + debugC(DEBUG_DETAILED, kTonyDebugActions, "Action Process %d Call=%s params=%d,%d,%d,%d", + _vm->_scheduler.getCurrentPID(), lplpFunctionStrings[item->Command[_ctx->k].nCf].c_str(), + item->Command[_ctx->k].arg1, item->Command[_ctx->k].arg2, + item->Command[_ctx->k].arg3, item->Command[_ctx->k].arg4 + ); + CORO_INVOKE_4(lplpFunctions[item->Command[_ctx->k].nCf], item->Command[_ctx->k].arg1, item->Command[_ctx->k].arg2, @@ -968,6 +975,9 @@ void ActionThread(CORO_PARAM, const void *param) { ); } else if (item->Command[_ctx->k].type == 2) { // Variable assign + debugC(DEBUG_DETAILED, kTonyDebugActions, "Action Process %d Variable=%s", + _vm->_scheduler.getCurrentPID(), item->Command[_ctx->k].lpszVarName); + LockVar(); varSetValue(item->Command[_ctx->k].lpszVarName, EvaluateExpression(item->Command[_ctx->k].expr)); UnlockVar(); @@ -981,6 +991,8 @@ void ActionThread(CORO_PARAM, const void *param) { GlobalFree(item); + debugC(DEBUG_DETAILED, kTonyDebugActions, "Action Process %d ended", _vm->_scheduler.getCurrentPID()); + CORO_KILL_SELF(); CORO_END_CODE; @@ -1705,7 +1717,8 @@ bool DoSelection(uint32 i, uint32 dwData) { * \****************************************************************************/ -bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName, LPLPCUSTOMFUNCTION lplpcfArray) { +bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName, + LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings) { Common::File hMpc; byte buf[5]; uint32 nBytesRead; @@ -1719,6 +1732,7 @@ bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName, LPLPCUST /* Si salva l'array delle funzioni custom */ lplpFunctions = lplpcfArray; + lplpFunctionStrings = lpcfStrings; /* Apre il file MPC in lettura */ if (!hMpc.open(lpszMpcFileName)) diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 9da963d39e..c9f8625744 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -119,6 +119,7 @@ #include "common/scummsys.h" #include "common/rect.h" +#include "common/str.h" #include "tony/coroutine.h" namespace Tony { @@ -602,7 +603,7 @@ extern "C" { \****************************************************************************/ bool EXPORT mpalInit(const char *lpszFileName, const char *lpszMprFileName, - LPLPCUSTOMFUNCTION lplpcfArray); + LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings); |