diff options
author | Alyssa Milburn | 2012-08-25 13:15:28 +0200 |
---|---|---|
committer | Alyssa Milburn | 2012-08-25 13:32:08 +0200 |
commit | 8b0dca3862da10e87fe0fec237c694c48e12f83c (patch) | |
tree | 95db6e377f7c8cdca351a7968bcb569b4c9b30a7 | |
parent | 659436739f1e32297bdd8faac83b71e51d4a4937 (diff) | |
download | scummvm-rg350-8b0dca3862da10e87fe0fec237c694c48e12f83c.tar.gz scummvm-rg350-8b0dca3862da10e87fe0fec237c694c48e12f83c.tar.bz2 scummvm-rg350-8b0dca3862da10e87fe0fec237c694c48e12f83c.zip |
TONY: Fix Take/ReleaseOwnership.
-rw-r--r-- | engines/tony/custom.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index e082e5fcde..fcb304c623 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -2052,25 +2052,12 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr */ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - CORO_BEGIN_CONTEXT; - bool expired; - CORO_END_CONTEXT(_ctx); - - CORO_BEGIN_CODE(_ctx); - // The event is operating as a mutex, so if the event is already set, wait until it's reset - do { - CORO_INVOKE_3(CoroScheduler.waitForSingleObject, GLOBALS._mut[num], 0, &_ctx->expired); - } while (!_ctx->expired); - - // Set the event to flag ownership - CoroScheduler.setEvent(GLOBALS._mut[num]); - - CORO_END_CODE; + CoroScheduler.waitForSingleObject(coroParam, GLOBALS._mut[num], CORO_INFINITE); } DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) { - CoroScheduler.resetEvent(GLOBALS._mut[num]); + CoroScheduler.setEvent(GLOBALS._mut[num]); } /* @@ -2563,7 +2550,7 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation int i; for (i = 0; i < 10; i++) - GLOBALS._mut[i] = CoroScheduler.createEvent(false, false); + GLOBALS._mut[i] = CoroScheduler.createEvent(false, true); for (i = 0; i < 200; i++) GLOBALS._ambiance[i] = 0; |