diff options
author | Vincent Hamm | 2002-04-25 08:53:10 +0000 |
---|---|---|
committer | Vincent Hamm | 2002-04-25 08:53:10 +0000 |
commit | f3aab1ce9c791ee366f70d1678e70e61d4844597 (patch) | |
tree | d31d89b1604f2a85cac6f38801a4e983799fe769 | |
parent | d0bb864d354ff10c4d3531b17ed7f6003d505115 (diff) | |
download | scummvm-rg350-f3aab1ce9c791ee366f70d1678e70e61d4844597.tar.gz scummvm-rg350-f3aab1ce9c791ee366f70d1678e70e61d4844597.tar.bz2 scummvm-rg350-f3aab1ce9c791ee366f70d1678e70e61d4844597.zip |
Implemented a few new functions. Now you can control the crane in Full Throttle
svn-id: r4079
-rw-r--r-- | boxes.cpp | 22 | ||||
-rw-r--r-- | script_v2.cpp | 21 | ||||
-rw-r--r-- | scumm.h | 1 |
3 files changed, 38 insertions, 6 deletions
@@ -74,6 +74,28 @@ Box *Scumm::getBoxBaseAddr(int box) return (Box *) (ptr + box * SIZEOF_BOX + 2); } +int Scumm::getSpecialBox(int param1, int param2) +{ + int i; + int numOfBoxes; + byte flag; + + numOfBoxes = getNumBoxes() - 1; + + for(i=numOfBoxes;i>=0;i--) + { + flag = getBoxFlags(i); + + if(!(flag & 0x80) && (flag & 0x20)) + return(-1); + + if(checkXYInBoxBounds(i,param1,param2)) + return(i); + } + + return(-1); +} + bool Scumm::checkXYInBoxBounds(int b, int x, int y) { BoxCoords box; diff --git a/script_v2.cpp b/script_v2.cpp index 135312c60b..1e839699ff 100644 --- a/script_v2.cpp +++ b/script_v2.cpp @@ -2708,8 +2708,8 @@ void Scumm::o6_miscOps() setCursorImg(args[1], (uint) - 1, args[2]); break; case 13: - warning("o6_miscOps: stub13(%d,%d,%d,%d)", args[1], args[2], args[3], - args[4]); + remapActor(derefActorSafe(args[1], "o6_miscOps:14"), args[2], args[3], + args[4], -1); break; case 14: remapActor(derefActorSafe(args[1], "o6_miscOps:14"), args[2], args[3], @@ -2721,8 +2721,8 @@ void Scumm::o6_miscOps() case 16: byte buf[200]; _msgPtrToAdd = buf; - addMessageToStack(getStringAddress(_vars[VAR_STRING2DRAW])); - //warning("o6_miscOps: drawString(%s,charset=%d,color=%d,x=%d,y=%d)",buf, args[1],args[2],args[3],args[4]); + addMessageToStack(getStringAddressVar(VAR_STRING2DRAW)); + break; case 17: warning("o6_miscOps: stub17(%d,%d,%d,%d)", args[1], args[2], args[3], @@ -2888,8 +2888,7 @@ void Scumm::o6_kernelFunction() push(0); break; case 115: - warning("o6_kernelFunction: stub115(%d,%d)", args[1], args[2]); - push(0); + push(getSpecialBox(args[1], args[2])); break; case 116: push(checkXYInBoxBounds(args[3], args[1], args[2])); @@ -2915,6 +2914,16 @@ void Scumm::o6_kernelFunction() break; case 211: warning("o6_kernelFunction: getInput(%d)", args[1]); + /* + 13 = thrust + 336 = thrust + 328 = thrust + 27 = abord + 97 = left + 331 = left + 115 = right + 333 = tight + */ push(0); break; case 212: @@ -1282,6 +1282,7 @@ public: void GetGates(int trap1,int trap2); bool inBoxQuickReject(int box, int x, int y, int threshold); AdjustBoxResult getClosestPtOnBox(int box, int x, int y); + int getSpecialBox(int param1, int param2); void setBoxFlags(int box, int val); void setBoxScale(int box, int b); |