diff options
author | Robert Göffringmann | 2003-06-06 16:40:44 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-06-06 16:40:44 +0000 |
commit | 09b1baf73151d1f0de6b547bf918dada2395d10c (patch) | |
tree | b5f4382872b94369679a2eae3b3f78989a17c8a5 /sky | |
parent | 64ffbe6021aa9dadd7a19770d296a42148db071b (diff) | |
download | scummvm-rg350-09b1baf73151d1f0de6b547bf918dada2395d10c.tar.gz scummvm-rg350-09b1baf73151d1f0de6b547bf918dada2395d10c.tar.bz2 scummvm-rg350-09b1baf73151d1f0de6b547bf918dada2395d10c.zip |
misc fixes
svn-id: r8355
Diffstat (limited to 'sky')
-rw-r--r-- | sky/logic.cpp | 31 | ||||
-rw-r--r-- | sky/logic.h | 2 | ||||
-rw-r--r-- | sky/mouse.cpp | 20 |
3 files changed, 34 insertions, 19 deletions
diff --git a/sky/logic.cpp b/sky/logic.cpp index 2564b690de..a1e15e46ae 100644 --- a/sky/logic.cpp +++ b/sky/logic.cpp @@ -1044,7 +1044,7 @@ void SkyLogic::initScriptVariables() { _scriptVariables[709] = 1; _scriptVariables[710] = 1; _scriptVariables[711] = 1; - _scriptVariables[79] = 1; + _scriptVariables[719] = 1; _scriptVariables[720] = 1; _scriptVariables[793] = 1; _scriptVariables[797] = 1; @@ -1067,6 +1067,15 @@ void SkyLogic::initScriptVariables() { memcpy(_scriptVariables + 505, forwardList5b, sizeof(forwardList5b)); } +uint16 SkyLogic::mouseScript(uint32 scrNum, Compact *scriptComp) { + + Compact *tmpComp = _compact; + _compact = scriptComp; + uint16 retVal = script((uint16)(scrNum & 0xFFFF), (uint16)(scrNum >> 16)); + _compact = tmpComp; + return retVal; +}; + /** * \fn uint32 SkyLogic::script(uint16 scriptNo, uint16 offset) * \brief This is the actual script engine. @@ -1374,11 +1383,13 @@ bool SkyLogic::fnCursorUp(uint32 a, uint32 b, uint32 c) { } bool SkyLogic::fnOpenHand(uint32 a, uint32 b, uint32 c) { - error("Stub: fnOpenHand"); + warning("Stub: fnOpenHand"); + return true; } bool SkyLogic::fnCloseHand(uint32 a, uint32 b, uint32 c) { - error("Stub: fnCloseHand"); + warning("Stub: fnCloseHand"); + return true; } bool SkyLogic::fnGetTo(uint32 targetPlaceId, uint32 mode, uint32 c) { @@ -1740,10 +1751,10 @@ bool SkyLogic::fnStartMenu(uint32 firstObject, uint32 b, uint32 c) { cpt->xcood = rollingX; rollingX += 24; - if (_scriptVariables[MENU] == 2) + //if (_scriptVariables[MENU] == 2) cpt->ycood = 136; - else - cpt->ycood = 112; + /*else + cpt->ycood = 112;*/ } return true; @@ -1958,7 +1969,9 @@ bool SkyLogic::fnPersonHere(uint32 id, uint32 room, uint32 c) { } bool SkyLogic::fnToggleMouse(uint32 a, uint32 b, uint32 c) { - error("Stub: fnToggleMouse"); + + SkyState::fetchCompact(a)->status ^= ST_MOUSE; + return true; } bool SkyLogic::fnMouseOn(uint32 a, uint32 b, uint32 c) { @@ -2233,12 +2246,12 @@ bool SkyLogic::fnQuitToDos(uint32 a, uint32 b, uint32 c) { } bool SkyLogic::fnPauseFx(uint32 a, uint32 b, uint32 c) { - warning("Stub: fnPauseFx"); + //warning("Stub: fnPauseFx"); return true; } bool SkyLogic::fnUnPauseFx(uint32 a, uint32 b, uint32 c) { - warning("Stub: fnUnPauseFx"); + //warning("Stub: fnUnPauseFx"); return true; } diff --git a/sky/logic.h b/sky/logic.h index 4b7f0d2cdd..614e555af4 100644 --- a/sky/logic.h +++ b/sky/logic.h @@ -92,7 +92,7 @@ public: void pause(); void waitSync(); void simpleAnim(); - uint16 script(uint32 num) { return script((uint16)(num & 0xFFFF), (uint16)(num >> 16)); }; + uint16 mouseScript(uint32 scrNum, Compact *scriptComp); uint16 script(uint16 scriptNo, uint16 offset); bool fnCacheChip(uint32 a, uint32 b, uint32 c); diff --git a/sky/mouse.cpp b/sky/mouse.cpp index 251d3fb44f..dc82773561 100644 --- a/sky/mouse.cpp +++ b/sky/mouse.cpp @@ -135,7 +135,7 @@ bool SkyMouse::fnAddHuman(void) { //surely this script should be run just in case //I am going to try it anyway if (SkyLogic::_scriptVariables[GET_OFF]) - _skyLogic->script(SkyLogic::_scriptVariables[GET_OFF]); + _skyLogic->script((uint16)SkyLogic::_scriptVariables[GET_OFF],(uint16)(SkyLogic::_scriptVariables[GET_OFF] >> 16)); SkyLogic::_scriptVariables[SPECIAL_ITEM] = 0xFFFFFFFF; SkyLogic::_scriptVariables[GET_OFF] = RESET_MOUSE; @@ -239,18 +239,19 @@ void SkyMouse::pointerEngine(void) { Compact *itemData = SkyState::fetchCompact(itemNum); currentList++; if ((itemData->screen == SkyLogic::_scriptVariables[SCREEN]) && (itemData->status & 16)) { - if (itemData->xcood + itemData->mouseRelX > _tMouseX) continue; - if (itemData->xcood + itemData->mouseRelX + itemData->mouseSizeX < _tMouseX) continue; - if (itemData->ycood + itemData->mouseRelY > _tMouseY) continue; - if (itemData->ycood + itemData->mouseRelY + itemData->mouseSizeY < _tMouseY) continue; + if (itemData->xcood + ((int16)itemData->mouseRelX) > _tMouseX) continue; + if (itemData->xcood + ((int16)itemData->mouseRelX) + itemData->mouseSizeX < _tMouseX) continue; + if (itemData->ycood + ((int16)itemData->mouseRelY) > _tMouseY) continue; + if (itemData->ycood + ((int16)itemData->mouseRelY) + itemData->mouseSizeY < _tMouseY) continue; // we've hit the item if (SkyLogic::_scriptVariables[SPECIAL_ITEM] == itemNum) return; SkyLogic::_scriptVariables[SPECIAL_ITEM] = itemNum; if (SkyLogic::_scriptVariables[GET_OFF]) - _skyLogic->script(SkyLogic::_scriptVariables[GET_OFF]); + _skyLogic->mouseScript(SkyLogic::_scriptVariables[GET_OFF], itemData); SkyLogic::_scriptVariables[GET_OFF] = itemData->mouseOff; - if (itemData->mouseOn) _skyLogic->script(itemData->mouseOn); + if (itemData->mouseOn) + _skyLogic->mouseScript(itemData->mouseOn, itemData); return; } } @@ -259,8 +260,9 @@ void SkyMouse::pointerEngine(void) { } while (*currentList != 0); if (SkyLogic::_scriptVariables[SPECIAL_ITEM] != 0) { SkyLogic::_scriptVariables[SPECIAL_ITEM] = 0; + if (SkyLogic::_scriptVariables[GET_OFF]) - _skyLogic->script(SkyLogic::_scriptVariables[GET_OFF]); + _skyLogic->script((uint16)SkyLogic::_scriptVariables[GET_OFF],(uint16)(SkyLogic::_scriptVariables[GET_OFF] >> 16)); SkyLogic::_scriptVariables[GET_OFF] = 0; } } @@ -275,7 +277,7 @@ void SkyMouse::buttonEngine1(void) { if (SkyLogic::_scriptVariables[SPECIAL_ITEM]) { //over anything? Compact *item = SkyState::fetchCompact(SkyLogic::_scriptVariables[SPECIAL_ITEM]); if (item->mouseClick) - _skyLogic->script(item->mouseClick, 0); + _skyLogic->mouseScript(item->mouseClick, item); } } } |