aboutsummaryrefslogtreecommitdiff
path: root/engines/gnap/character.cpp
diff options
context:
space:
mode:
authorStrangerke2016-05-08 10:14:46 +0200
committerEugene Sandulenko2016-05-10 12:14:55 +0200
commitfdabbcc16ab90b47a14eda8c168ab206a92780f1 (patch)
tree051e34a6a2f04ee009d932a033cadeb181aa2c80 /engines/gnap/character.cpp
parent1f7eeb24a0622a44a4b4582b51950fae4a80fcb7 (diff)
downloadscummvm-rg350-fdabbcc16ab90b47a14eda8c168ab206a92780f1.tar.gz
scummvm-rg350-fdabbcc16ab90b47a14eda8c168ab206a92780f1.tar.bz2
scummvm-rg350-fdabbcc16ab90b47a14eda8c168ab206a92780f1.zip
GNAP: Reduce dereferencing of _gnap
Diffstat (limited to 'engines/gnap/character.cpp')
-rw-r--r--engines/gnap/character.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/gnap/character.cpp b/engines/gnap/character.cpp
index 114c2f4adf..3d74d1e300 100644
--- a/engines/gnap/character.cpp
+++ b/engines/gnap/character.cpp
@@ -1208,7 +1208,9 @@ void PlayerPlat::updateIdleSequence() {
}
void PlayerPlat::updateIdleSequence2() {
- if (_actionStatus < 0 && _vm->_gnap->_actionStatus < 0) {
+ PlayerGnap& gnap = *_vm->_gnap;
+
+ if (_actionStatus < 0 && gnap._actionStatus < 0) {
if (_vm->_timers[0]) {
if (!_vm->_timers[1]) {
_vm->_timers[1] = _vm->getRandom(20) + 30;
@@ -1268,6 +1270,7 @@ int PlayerPlat::getWalkSequenceId(int deltaX, int deltaY) {
bool PlayerPlat::walkTo(Common::Point gridPos, int animationIndex, int sequenceId, int flags) {
int datNum = flags & 3;
+ PlayerGnap& gnap = *_vm->_gnap;
_vm->_timers[1] = 60;
@@ -1282,8 +1285,8 @@ bool PlayerPlat::walkTo(Common::Point gridPos, int animationIndex, int sequenceI
_walkDestX = CLIP(gridX, 0, _vm->_gridMaxX - 1);
_walkDestY = CLIP(gridY, 0, _vm->_gridMaxY - 1);
- if (animationIndex >= 0 && _vm->_gnap->_pos == Common::Point(_walkDestX, _walkDestY))
- _vm->_gnap->walkStep();
+ if (animationIndex >= 0 && gnap._pos == Common::Point(_walkDestX, _walkDestY))
+ gnap.walkStep();
bool done = findPath1(_pos.x, _pos.y, 0);