aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/walk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/parallaction/walk.cpp')
-rw-r--r--engines/parallaction/walk.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index 43ded244c5..d57e9d2532 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -41,7 +41,7 @@ static uint16 walkData2 = 0; // next walk frame
uint16 queryPath(uint16 x, uint16 y) {
// NOTE: a better solution would have us mirror each byte in the mask in the loading routine
- // AmigaDisk::loadPath() instead of doing it here.
+ // AmigaDisk_ns::loadPath() instead of doing it here.
byte _al = _buffer[y*40 + x/8];
byte _dl = (_vm->getPlatform() == Common::kPlatformPC) ? (x & 7) : (7 - (x & 7));
@@ -59,11 +59,11 @@ void PathBuilder::correctPathPoint(Common::Point &to) {
int16 left = to.x;
do {
right++;
- } while ((queryPath(right, to.y) == 0) && (right < SCREEN_WIDTH));
+ } while ((queryPath(right, to.y) == 0) && (right < _vm->_screenWidth));
do {
left--;
} while ((queryPath(left, to.y) == 0) && (left > 0));
- right = (right == SCREEN_WIDTH) ? 1000 : right - to.x;
+ right = (right == _vm->_screenWidth) ? 1000 : right - to.x;
left = (left == 0) ? 1000 : to.x - left;
@@ -74,9 +74,9 @@ void PathBuilder::correctPathPoint(Common::Point &to) {
} while ((queryPath(to.x, top) == 0) && (top > 0));
do {
bottom++;
- } while ((queryPath(to.x, bottom) == 0) && (bottom < SCREEN_HEIGHT));
+ } while ((queryPath(to.x, bottom) == 0) && (bottom < _vm->_screenHeight));
top = (top == 0) ? 1000 : to.y - top;
- bottom = (bottom == SCREEN_HEIGHT) ? 1000 : bottom - to.y;
+ bottom = (bottom == _vm->_screenHeight) ? 1000 : bottom - to.y;
int16 closeX = (right >= left) ? left : right;
@@ -272,19 +272,19 @@ uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNode *Node) {
void Parallaction::clipMove(Common::Point& pos, const WalkNode* from) {
- if ((pos.x < from->_x) && (pos.x < SCREEN_WIDTH) && (queryPath(_vm->_char._ani.width()/2 + pos.x + 2, _vm->_char._ani.height() + pos.y) != 0)) {
+ if ((pos.x < from->_x) && (pos.x < _screenWidth) && (queryPath(_char._ani.width()/2 + pos.x + 2, _char._ani.height() + pos.y) != 0)) {
pos.x = (pos.x + 2 < from->_x) ? pos.x + 2 : from->_x;
}
- if ((pos.x > from->_x) && (pos.x > -20) && (queryPath(_vm->_char._ani.width()/2 + pos.x - 2, _vm->_char._ani.height() + pos.y) != 0)) {
+ if ((pos.x > from->_x) && (pos.x > -20) && (queryPath(_char._ani.width()/2 + pos.x - 2, _char._ani.height() + pos.y) != 0)) {
pos.x = (pos.x - 2 > from->_x) ? pos.x - 2 : from->_x;
}
- if ((pos.y < from->_y) && (pos.y < (SCREEN_HEIGHT - _vm->_char._ani.height())) && (queryPath(_vm->_char._ani.width()/2 + pos.x, _vm->_char._ani.height() + pos.y + 2) != 0)) {
+ if ((pos.y < from->_y) && (pos.y < (_screenHeight - _char._ani.height())) && (queryPath(_char._ani.width()/2 + pos.x, _char._ani.height() + pos.y + 2) != 0)) {
pos.y = (pos.y + 2 <= from->_y) ? pos.y + 2 : from->_y;
}
- if ((pos.y > from->_y) && (pos.y > -20) && (queryPath(_vm->_char._ani.width()/2 + pos.x, _vm->_char._ani.height() + pos.y- 2) != 0)) {
+ if ((pos.y > from->_y) && (pos.y > -20) && (queryPath(_char._ani.width()/2 + pos.x, _char._ani.height() + pos.y- 2) != 0)) {
pos.y = (pos.y - 2 >= from->_y) ? pos.y - 2 :from->_y;
}
@@ -304,7 +304,7 @@ int16 Parallaction::selectWalkFrame(const Common::Point& pos, const WalkNode* fr
// walk frame selection
int16 v16;
- if (_vm->_char._ani.getFrameNum() == 20) {
+ if (_char._ani.getFrameNum() == 20) {
if (dist.x > dist.y) {
walkData2 = (from->_x > pos.x) ? 0 : 7;
@@ -336,49 +336,49 @@ int16 Parallaction::selectWalkFrame(const Common::Point& pos, const WalkNode* fr
uint16 Parallaction::checkDoor() {
// printf("checkDoor()...");
- if (_vm->_currentLocationIndex != _doorData1) {
- _doorData1 = _vm->_currentLocationIndex;
+ if (_currentLocationIndex != _doorData1) {
+ _doorData1 = _currentLocationIndex;
_zoneTrap = NULL;
}
_engineFlags &= ~kEngineWalking;
- Zone *z = _vm->hitZone(kZoneDoor, _vm->_char._ani._left + _vm->_char._ani.width() / 2, _vm->_char._ani._top + _vm->_char._ani.height());
+ Zone *z = hitZone(kZoneDoor, _char._ani._left + _char._ani.width() / 2, _char._ani._top + _char._ani.height());
if (z != NULL) {
if ((z->_flags & kFlagsClosed) == 0) {
- _vm->_location._startPosition.x = z->u.door->_startPos.x;
- _vm->_location._startPosition.y = z->u.door->_startPos.y;
- _vm->_location._startFrame = z->u.door->_startFrame;
- strcpy( _vm->_location._name, z->u.door->_location );
+ _location._startPosition.x = z->u.door->_startPos.x;
+ _location._startPosition.y = z->u.door->_startPos.y;
+ _location._startFrame = z->u.door->_startFrame;
+ strcpy(_location._name, z->u.door->_location);
_engineFlags |= kEngineChangeLocation;
_zoneTrap = NULL;
} else {
- _vm->runCommands(z->_commands, z);
+ runCommands(z->_commands, z);
}
}
- z = _vm->hitZone(kZoneTrap, _vm->_char._ani._left + _vm->_char._ani.width() / 2, _vm->_char._ani._top + _vm->_char._ani.height());
+ z = hitZone(kZoneTrap, _char._ani._left + _char._ani.width() / 2, _char._ani._top + _char._ani.height());
if (z != NULL) {
- _localFlags[_vm->_currentLocationIndex] |= kFlagsEnter;
- _vm->runCommands(z->_commands, z);
- _localFlags[_vm->_currentLocationIndex] &= ~kFlagsEnter;
+ _localFlags[_currentLocationIndex] |= kFlagsEnter;
+ runCommands(z->_commands, z);
+ _localFlags[_currentLocationIndex] &= ~kFlagsEnter;
_zoneTrap = z;
} else
if (_zoneTrap != NULL) {
- _localFlags[_vm->_currentLocationIndex] |= kFlagsExit;
- _vm->runCommands(_zoneTrap->_commands, _zoneTrap);
- _localFlags[_vm->_currentLocationIndex] &= ~kFlagsExit;
+ _localFlags[_currentLocationIndex] |= kFlagsExit;
+ runCommands(_zoneTrap->_commands, _zoneTrap);
+ _localFlags[_currentLocationIndex] &= ~kFlagsExit;
_zoneTrap = NULL;
}
// printf("done\n");
- _vm->_char._ani._frame = walkData2;
- return _vm->_char._ani._frame;
+ _char._ani._frame = walkData2;
+ return _char._ani._frame;
}
@@ -429,11 +429,11 @@ void jobWalk(void *parm, Job *j) {
void Parallaction::setPath(byte *path) {
- memcpy(_buffer, path, SCREENPATH_WIDTH*SCREEN_HEIGHT);
+ memcpy(_buffer, path, _screenPathSize);
}
void Parallaction::initWalk() {
- _buffer = (byte*)malloc(SCREENPATH_WIDTH * SCREEN_HEIGHT);
+ _buffer = (byte*)malloc(_screenPathSize);
}