aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Hamm2002-04-25 08:53:10 +0000
committerVincent Hamm2002-04-25 08:53:10 +0000
commitf3aab1ce9c791ee366f70d1678e70e61d4844597 (patch)
treed31d89b1604f2a85cac6f38801a4e983799fe769
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
-rw-r--r--boxes.cpp22
-rw-r--r--script_v2.cpp21
-rw-r--r--scumm.h1
3 files changed, 38 insertions, 6 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;
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:
diff --git a/scumm.h b/scumm.h
index 8392225f40..d01d06335e 100644
--- a/scumm.h
+++ b/scumm.h
@@ -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);