aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/trip6.cpp
diff options
context:
space:
mode:
authoruruk2013-08-23 16:58:22 +0200
committeruruk2013-08-23 16:58:22 +0200
commitc19b50b3f4228cea0d672982bf3a7bc94e9050b2 (patch)
tree16531960c1594421ea9d67860bbc16aab024c631 /engines/avalanche/trip6.cpp
parent38c51209a406ac3ed8c5c0fbfd250ca3c01e4c10 (diff)
downloadscummvm-rg350-c19b50b3f4228cea0d672982bf3a7bc94e9050b2.tar.gz
scummvm-rg350-c19b50b3f4228cea0d672982bf3a7bc94e9050b2.tar.bz2
scummvm-rg350-c19b50b3f4228cea0d672982bf3a7bc94e9050b2.zip
AVALANCHE: Upgrade Trip::infield(), update the rest of the code accordingly. Repair Trip::neardoor(). Introduce Parser::handleFunctionKey(), partially implement it. Implement Gyro::f5_does(). Implement missing part of Lucerna::enterroom().
Diffstat (limited to 'engines/avalanche/trip6.cpp')
-rw-r--r--engines/avalanche/trip6.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index d55567c64c..7dbda47eea 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1641,7 +1641,8 @@ void Trip::fliproom(byte room, byte ped) {
}
bool Trip::infield(byte which) {
-/* returns True if you're within field "which" */
+ which--; // Pascal -> C: different array indexes.
+
int16 yy = tr[0].y + tr[0]._info.yl;
return (tr[0].x >= _vm->_gyro->fields[which].x1) && (tr[0].x <= _vm->_gyro->fields[which].x2)
@@ -1649,29 +1650,19 @@ bool Trip::infield(byte which) {
}
-bool Trip::neardoor() { /* returns True if you're near a door! */
- int16 ux, uy;
- byte fv;
- bool nd;
-
- bool neardoor_result;
+bool Trip::neardoor() {
if (_vm->_gyro->numfields < 9) {
/* there ARE no doors here! */
- neardoor_result = false;
- return neardoor_result;
+ return false;
}
- ux = tr[1].x;
- uy = tr[1].y + tr[1]._info.yl;
-
- nd = false;
- for (fv = 9; fv <= _vm->_gyro->numfields; fv++) {
- _vm->_gyro->fields[fv];
-
+ int16 ux = tr[0].x;
+ int16 uy = tr[0].y + tr[0]._info.yl;
+ bool nd = false;
+ for (byte fv = 9; fv <= _vm->_gyro->numfields; fv++)
if ((ux >= _vm->_gyro->fields[fv].x1) && (ux <= _vm->_gyro->fields[fv].x2)
&& (uy >= _vm->_gyro->fields[fv].y1) && (uy <= _vm->_gyro->fields[fv].y2))
nd = true;
- }
return nd;
}