diff options
author | Nicola Mettifogo | 2007-07-29 19:17:53 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-07-29 19:17:53 +0000 |
commit | 283b89daf83ef62d29f0c7d7d54a64fcc8bd69d8 (patch) | |
tree | e63622e41a2085111ef038b0e7a2f6e7341459eb /engines/parallaction/walk.cpp | |
parent | 1ff49e3ab25fa8cf9388c96d3b1f6f6013c42922 (diff) | |
download | scummvm-rg350-283b89daf83ef62d29f0c7d7d54a64fcc8bd69d8.tar.gz scummvm-rg350-283b89daf83ef62d29f0c7d7d54a64fcc8bd69d8.tar.bz2 scummvm-rg350-283b89daf83ef62d29f0c7d7d54a64fcc8bd69d8.zip |
Cleanup.
svn-id: r28315
Diffstat (limited to 'engines/parallaction/walk.cpp')
-rw-r--r-- | engines/parallaction/walk.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index fd2fa8d186..d57e9d2532 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -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 < _screenWidth) && (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 < (_screenHeight - _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; } |