diff options
author | Alyssa Milburn | 2011-07-18 15:06:17 +0200 |
---|---|---|
committer | Alyssa Milburn | 2011-07-18 15:06:17 +0200 |
commit | 305023aef5d36af451ce2ac2a6928d0659a205a9 (patch) | |
tree | d4c1cfc0ab0641295c29d500f65dc7a65a8575da /engines/composer | |
parent | f5bac8464927ed3624186629a25c698ce4b313d8 (diff) | |
download | scummvm-rg350-305023aef5d36af451ce2ac2a6928d0659a205a9.tar.gz scummvm-rg350-305023aef5d36af451ce2ac2a6928d0659a205a9.tar.bz2 scummvm-rg350-305023aef5d36af451ce2ac2a6928d0659a205a9.zip |
COMPOSER: Various minor fixes.
Diffstat (limited to 'engines/composer')
-rw-r--r-- | engines/composer/composer.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp index 343b5d2bd2..0a3b7b722a 100644 --- a/engines/composer/composer.cpp +++ b/engines/composer/composer.cpp @@ -768,7 +768,7 @@ Common::Error ComposerEngine::run() { continue; if (script._baseTime + script._duration > thisTime) continue; - if (script._count != 0xffff) + if (script._count != 0xffffffff) script._count--; script._baseTime = thisTime; runScript(script._scriptId, i, 0, 0); @@ -870,10 +870,10 @@ void ComposerEngine::onMouseMove(const Common::Point &pos) { const Sprite *sprite = getSpriteAtPos(pos); const Button *button = getButtonFor(sprite, pos); if (_lastButton != button) { - if (_lastButton) + if (_lastButton && _lastButton->_scriptIdRollOff) runScript(_lastButton->_scriptIdRollOff, _lastButton->_id, buttonsDown, 0); _lastButton = button; - if (_lastButton) + if (_lastButton && _lastButton->_scriptIdRollOn) runScript(_lastButton->_scriptIdRollOn, _lastButton->_id, buttonsDown, 0); } @@ -1066,6 +1066,9 @@ void ComposerEngine::runEvent(uint16 id, int16 param1, int16 param2, int16 param uint16 scriptId = stream->readUint16LE(); delete stream; + if (!scriptId) + return; + debug(2, "running event %d via script %d(%d, %d, %d)", id, scriptId, param1, param2, param3); runScript(scriptId, param1, param2, param3); @@ -1483,7 +1486,7 @@ int16 ComposerEngine::scriptFuncCall(uint16 id, int16 param1, int16 param2, int1 debug(3, "kFuncQueueScript(%d, %d, %d)", param1, param2, param3); _queuedScripts[param1]._baseTime = _system->getMillis(); _queuedScripts[param1]._duration = 10 * param2; - _queuedScripts[param1]._count = 0xffff; + _queuedScripts[param1]._count = 0xffffffff; _queuedScripts[param1]._scriptId = param3; return 0; case kFuncDequeueScript: @@ -1614,7 +1617,7 @@ int16 ComposerEngine::scriptFuncCall(uint16 id, int16 param1, int16 param2, int1 { Common::Point pos(_vars[param3], _vars[param3 + 1]); int16 zorder = _vars[param3 + 2]; - debug(3, "kFuncAddSprite(%d, %d, [%d = %d, (%d, %d)])", param1, param2, param3, pos.x, pos.y, zorder); + debug(3, "kFuncAddSprite(%d, %d, [%d = (%d, %d), %d])", param1, param2, param3, pos.x, pos.y, zorder); addSprite(param1, param2, zorder, pos); } return 0; |