diff options
author | Oliver Kiehl | 2003-05-25 14:36:33 +0000 |
---|---|---|
committer | Oliver Kiehl | 2003-05-25 14:36:33 +0000 |
commit | 7d8729874f2d3cc4a3553b4389b577652a991039 (patch) | |
tree | a8bd5780b9835282c57557d247c70256f72abe88 /sky | |
parent | 6212e21d03e7fc9d10238d94c66a88e8fb2c8528 (diff) | |
download | scummvm-rg350-7d8729874f2d3cc4a3553b4389b577652a991039.tar.gz scummvm-rg350-7d8729874f2d3cc4a3553b4389b577652a991039.tar.bz2 scummvm-rg350-7d8729874f2d3cc4a3553b4389b577652a991039.zip |
add some stuff/cleanup
svn-id: r7955
Diffstat (limited to 'sky')
-rw-r--r-- | sky/logic.cpp | 25 | ||||
-rw-r--r-- | sky/logic.h | 3 | ||||
-rw-r--r-- | sky/skydefs.h | 1 |
3 files changed, 21 insertions, 8 deletions
diff --git a/sky/logic.cpp b/sky/logic.cpp index 20db75a7df..7570da456f 100644 --- a/sky/logic.cpp +++ b/sky/logic.cpp @@ -115,7 +115,7 @@ void SkyLogic::logicScript() { uint16 *scriptNo = (uint16 *)SkyCompact::getCompactElem(_compact, C_BASE_SUB + mode); uint16 *offset = (uint16 *)SkyCompact::getCompactElem(_compact, C_BASE_SUB + mode + 2); - uint32 scr = script(_compact, *scriptNo, *offset); + uint32 scr = script(*scriptNo, *offset); *scriptNo = (uint16)(scr & 0xffff); *offset = (uint16)(scr >> 16); @@ -231,7 +231,7 @@ void SkyLogic::arAnim() { return; } - script(_compact, _compact->extCompact->miniBump, 0); + script(_compact->extCompact->miniBump, 0); return; } } @@ -579,6 +579,13 @@ bool SkyLogic::collide(Compact *cpt) { } } +void SkyLogic::runGetOff() { + uint32 getOff = _scriptVariables[GET_OFF]; + _scriptVariables[GET_OFF] = 0; + if (getOff) + script((uint16)(getOff & 0xffff), (uint16)(getOff >> 16)); +} + void SkyLogic::checkModuleLoaded(uint16 moduleNo) { if (!_moduleList[moduleNo]) _moduleList[moduleNo] = (uint16 *)_skyDisk->loadFile((uint16)moduleNo + F_MODULE_0, NULL); @@ -880,7 +887,7 @@ void SkyLogic::initScriptVariables() { memcpy(_scriptVariables + 505, forwardList5b, sizeof(forwardList5b)); } -uint32 SkyLogic::script(Compact *compact, uint16 scriptNo, uint16 offset) { +uint32 SkyLogic::script(uint16 scriptNo, uint16 offset) { script: // process a script // low level interface to interpreter @@ -1035,13 +1042,13 @@ script: case 15: // push_offset // Push a compact access s = READ_LE_UINT16(scriptData++); - tmp = (uint16 *)SkyCompact::getCompactElem(compact, s); + tmp = (uint16 *)SkyCompact::getCompactElem(_compact, s); push(*tmp); break; case 16: // pop_offset // pop a value into a compact s = READ_LE_UINT16(scriptData++); - tmp = (uint16 *)SkyCompact::getCompactElem(compact, s); + tmp = (uint16 *)SkyCompact::getCompactElem(_compact, s); *tmp = (uint16)pop(); break; case 17: // is_equal @@ -1252,7 +1259,11 @@ uint32 SkyLogic::fnKillId(uint32 a, uint32 b, uint32 c) { } uint32 SkyLogic::fnNoHuman(uint32 a, uint32 b, uint32 c) { - warning("Stub: fnNoHuman"); + if (!_scriptVariables[MOUSE_STOP]) { + _scriptVariables[MOUSE_STOP] &= 1; + runGetOff(); + fnBlankMouse(a, b, c); + } return 1; } @@ -1270,7 +1281,7 @@ uint32 SkyLogic::fnNoButtons(uint32 a, uint32 b, uint32 c) { } uint32 SkyLogic::fnSetStop(uint32 a, uint32 b, uint32 c) { - warning("Stub: fnSetStop"); + _scriptVariables[MOUSE_STOP] |= 1; return 1; } diff --git a/sky/logic.h b/sky/logic.h index 85537aed1a..86ca55a617 100644 --- a/sky/logic.h +++ b/sky/logic.h @@ -175,10 +175,11 @@ protected: void push(uint32); uint32 pop(); void checkModuleLoaded(uint16 moduleNo); - uint32 script(Compact *compact, uint16 scriptNo, uint16 offset); + uint32 script(uint16 scriptNo, uint16 offset); bool collide(Compact *cpt); void initScriptVariables(); void mainAnim(); + void runGetOff(); uint16 *_moduleList[16]; uint32 _stack[20]; diff --git a/sky/skydefs.h b/sky/skydefs.h index 4c5fdea43c..4a85ec77a9 100644 --- a/sky/skydefs.h +++ b/sky/skydefs.h @@ -42,6 +42,7 @@ #define CUR_ID 12 #define MOUSE_STATUS 13 #define MOUSE_STOP 14 +#define GET_OFF 18 #define HIT_ID 37 #define THE_CHOSEN_ONE 51 #define TEXT1 53 |