aboutsummaryrefslogtreecommitdiff
path: root/boxes.cpp
diff options
context:
space:
mode:
authorVincent Hamm2002-04-25 08:53:10 +0000
committerVincent Hamm2002-04-25 08:53:10 +0000
commitf3aab1ce9c791ee366f70d1678e70e61d4844597 (patch)
treed31d89b1604f2a85cac6f38801a4e983799fe769 /boxes.cpp
parentd0bb864d354ff10c4d3531b17ed7f6003d505115 (diff)
downloadscummvm-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
Diffstat (limited to 'boxes.cpp')
-rw-r--r--boxes.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/boxes.cpp b/boxes.cpp
index 2e4b3e4984..24b1a8be47 100644
--- a/boxes.cpp
+++ b/boxes.cpp
@@ -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;