aboutsummaryrefslogtreecommitdiff
path: root/engines/gnap
diff options
context:
space:
mode:
authorStrangerke2016-05-04 07:13:48 +0200
committerEugene Sandulenko2016-05-10 12:14:49 +0200
commit2e50019c05dbff0bbb559b72a201630605505c87 (patch)
tree473fb2794fd1a783ac5015f2de4456c12642cd12 /engines/gnap
parentaee38421631479b6025585649172491f3251ce5e (diff)
downloadscummvm-rg350-2e50019c05dbff0bbb559b72a201630605505c87.tar.gz
scummvm-rg350-2e50019c05dbff0bbb559b72a201630605505c87.tar.bz2
scummvm-rg350-2e50019c05dbff0bbb559b72a201630605505c87.zip
GNAP: Introduce Character class - WIP
Diffstat (limited to 'engines/gnap')
-rw-r--r--engines/gnap/character.cpp37
-rw-r--r--engines/gnap/character.h58
-rw-r--r--engines/gnap/gnap.cpp303
-rw-r--r--engines/gnap/gnap.h14
-rw-r--r--engines/gnap/grid.cpp78
-rw-r--r--engines/gnap/module.mk1
-rw-r--r--engines/gnap/scenes/group0.cpp109
-rw-r--r--engines/gnap/scenes/group1.cpp159
-rw-r--r--engines/gnap/scenes/group2.cpp60
-rw-r--r--engines/gnap/scenes/group3.cpp35
-rw-r--r--engines/gnap/scenes/group4.cpp57
11 files changed, 495 insertions, 416 deletions
diff --git a/engines/gnap/character.cpp b/engines/gnap/character.cpp
new file mode 100644
index 0000000000..6e4ade35a5
--- /dev/null
+++ b/engines/gnap/character.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "gnap/gnap.h"
+#include "gnap/character.h"
+
+namespace Gnap {
+
+Character::Character(GnapEngine *vm) : _vm(vm) {
+ _pos = Common::Point(0, 0);
+ _idleFacing = kDirNone;
+}
+
+Character::~Character() {}
+
+PlayerGnap::PlayerGnap(GnapEngine * vm) : Character(vm) {}
+
+} // End of namespace Gnap
diff --git a/engines/gnap/character.h b/engines/gnap/character.h
new file mode 100644
index 0000000000..5949b7a1eb
--- /dev/null
+++ b/engines/gnap/character.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef GNAP_CHARACTER_H
+#define GNAP_CHARACTER_H
+
+namespace Gnap {
+
+class GnapEngine;
+
+enum Facing {
+ kDirNone = 0,
+ kDirBottomRight = 1,
+ kDirBottomLeft = 3,
+ kDirUnk4 = 4,
+ kDirUpLeft = 5,
+ kDirUpRight = 7
+};
+
+class Character {
+public:
+ Character(GnapEngine *vm);
+ ~Character();
+
+ Common::Point _pos;
+ Facing _idleFacing;
+
+protected:
+ GnapEngine *_vm;
+};
+
+class PlayerGnap : public Character {
+public:
+ PlayerGnap(GnapEngine *vm);
+};
+
+} // End of namespace Gnap
+
+#endif // GNAP_CHARACTER_H
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index e5169e4927..ff9c79e9cd 100644
--- a/engines/gnap/gnap.cpp
+++ b/engines/gnap/gnap.cpp
@@ -148,12 +148,14 @@ Common::Error GnapEngine::run() {
_gameSys = new GameSys(this);
_soundMan = new SoundMan(this);
_debugger = new Debugger(this);
+ _gnap = new PlayerGnap(this);
_menuBackgroundSurface = nullptr;
initGlobalSceneVars();
mainLoop();
+ delete _gnap;
delete _soundMan;
delete _gameSys;
delete _sequenceCache;
@@ -943,25 +945,25 @@ int GnapEngine::getGnapSequenceId(int kind, int gridX, int gridY) {
switch (kind) {
case gskPullOutDevice:
if (gridX > 0 && gridY > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x83F;
- _gnapIdleFacing = kDirUpLeft;
+ _gnap->_idleFacing = kDirUpLeft;
} else {
sequenceId = 0x83D;
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
}
} else {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x83B;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x839;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
}
} else {
- switch (_gnapIdleFacing) {
+ switch (_gnap->_idleFacing) {
case kDirBottomRight:
sequenceId = 0x839;
break;
@@ -980,25 +982,25 @@ int GnapEngine::getGnapSequenceId(int kind, int gridX, int gridY) {
case gskPullOutDeviceNonWorking:
if (gridX > 0 && gridY > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x829;
- _gnapIdleFacing = kDirUpLeft;
+ _gnap->_idleFacing = kDirUpLeft;
} else {
sequenceId = 0x828;
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
}
} else {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x827;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x826;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
}
} else {
- switch (_gnapIdleFacing) {
+ switch (_gnap->_idleFacing) {
case kDirBottomRight:
sequenceId = 0x826;
break;
@@ -1017,40 +1019,40 @@ int GnapEngine::getGnapSequenceId(int kind, int gridX, int gridY) {
case gskScratchingHead:
if (gridX > 0 && gridY > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x834;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x885;
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
}
} else {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x834;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x833;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
}
} else {
- switch (_gnapIdleFacing) {
+ switch (_gnap->_idleFacing) {
case kDirBottomRight:
sequenceId = 0x833;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
break;
case kDirBottomLeft:
sequenceId = 0x834;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
break;
case kDirUpRight:
sequenceId = 0x885;
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
break;
default:
sequenceId = 0x834;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
break;
}
}
@@ -1058,25 +1060,25 @@ int GnapEngine::getGnapSequenceId(int kind, int gridX, int gridY) {
case gskIdle:
if (gridX > 0 && gridY > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x7BC;
- _gnapIdleFacing = kDirUpLeft;
+ _gnap->_idleFacing = kDirUpLeft;
} else {
sequenceId = 0x7BB;
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
}
} else {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x7BA;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x7B9;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
}
} else {
- switch (_gnapIdleFacing) {
+ switch (_gnap->_idleFacing) {
case kDirBottomRight:
sequenceId = 0x7B9;
break;
@@ -1096,25 +1098,25 @@ int GnapEngine::getGnapSequenceId(int kind, int gridX, int gridY) {
case gskBrainPulsating:
_gnapBrainPulseNum = (_gnapBrainPulseNum + 1) & 1;
if (gridX > 0 && gridY > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = _gnapBrainPulseRndValue + _gnapBrainPulseNum + 0x812;
- _gnapIdleFacing = kDirUpLeft;
+ _gnap->_idleFacing = kDirUpLeft;
} else {
sequenceId = _gnapBrainPulseRndValue + _gnapBrainPulseNum + 0x7FE;
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
}
} else {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = _gnapBrainPulseRndValue + _gnapBrainPulseNum + 0x7D6;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = _gnapBrainPulseRndValue + _gnapBrainPulseNum + 0x7EA;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
}
} else {
- switch (_gnapIdleFacing) {
+ switch (_gnap->_idleFacing) {
case kDirBottomRight:
sequenceId = _gnapBrainPulseRndValue + _gnapBrainPulseNum + 0x7EA;
break;
@@ -1133,59 +1135,59 @@ int GnapEngine::getGnapSequenceId(int kind, int gridX, int gridY) {
case gskImpossible:
if (gridX > 0 && gridY > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x831;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x7A8;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
} else {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x831;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
- if (_gnapX % 2)
+ if (_gnap->_pos.x % 2)
sequenceId = 0x7A8;
else
sequenceId = 0x89A;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
}
- } else if (_gnapIdleFacing != kDirBottomRight && _gnapIdleFacing != kDirUpRight) {
+ } else if (_gnap->_idleFacing != kDirBottomRight && _gnap->_idleFacing != kDirUpRight) {
sequenceId = 0x831;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
if (_currentSceneNum % 2)
sequenceId = 0x7A8;
else
sequenceId = 0x89A;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
break;
case gskDeflect:
if (gridX > 0 && gridY > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x830;
- _gnapIdleFacing = kDirUpLeft;
+ _gnap->_idleFacing = kDirUpLeft;
} else {
sequenceId = 0x82F;
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
}
} else {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x82E;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x7A7;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
}
} else {
- switch (_gnapIdleFacing) {
+ switch (_gnap->_idleFacing) {
case kDirBottomRight:
sequenceId = 0x7A7;
break;
@@ -1206,7 +1208,7 @@ int GnapEngine::getGnapSequenceId(int kind, int gridX, int gridY) {
break;
case gskUseDevice:
- switch (_gnapIdleFacing) {
+ switch (_gnap->_idleFacing) {
case kDirBottomRight:
sequenceId = 0x83A;
break;
@@ -1227,57 +1229,57 @@ int GnapEngine::getGnapSequenceId(int kind, int gridX, int gridY) {
case gskMoan1:
if (gridX > 0 && gridY > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x832;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x7AA;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
} else {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x832;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x7AA;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
}
- } else if (_gnapIdleFacing != kDirBottomRight && _gnapIdleFacing != kDirUpRight) {
+ } else if (_gnap->_idleFacing != kDirBottomRight && _gnap->_idleFacing != kDirUpRight) {
sequenceId = 0x832;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x7AA;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
break;
case gskMoan2:
if (gridX > 0 && gridY > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x832;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x7AA;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
} else {
- if (_gnapX > gridX) {
+ if (_gnap->_pos.x > gridX) {
sequenceId = 0x832;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x7AA;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
}
- } else if (_gnapIdleFacing != kDirBottomRight && _gnapIdleFacing != kDirUpRight) {
+ } else if (_gnap->_idleFacing != kDirBottomRight && _gnap->_idleFacing != kDirUpRight) {
sequenceId = 0x832;
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
} else {
sequenceId = 0x7AA;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
break;
}
@@ -1287,120 +1289,120 @@ int GnapEngine::getGnapSequenceId(int kind, int gridX, int gridY) {
int GnapEngine::getGnapShowSequenceId(int index, int gridX, int gridY) {
int sequenceId;
- Facing facing = _gnapIdleFacing;
+ Facing facing = _gnap->_idleFacing;
if (gridY > 0 && gridX > 0) {
- if (_gnapY > gridY) {
- if (_gnapX > gridX)
- _gnapIdleFacing = kDirUpLeft;
+ if (_gnap->_pos.y > gridY) {
+ if (_gnap->_pos.x > gridX)
+ _gnap->_idleFacing = kDirUpLeft;
else
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
} else {
- if (_gnapX > gridX)
- _gnapIdleFacing = kDirUpLeft;
+ if (_gnap->_pos.x > gridX)
+ _gnap->_idleFacing = kDirUpLeft;
else
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
}
- } else if (_gnapIdleFacing != kDirBottomRight && _gnapIdleFacing != kDirUpRight) {
- _gnapIdleFacing = kDirUpLeft;
+ } else if (_gnap->_idleFacing != kDirBottomRight && _gnap->_idleFacing != kDirUpRight) {
+ _gnap->_idleFacing = kDirUpLeft;
} else {
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
}
switch (index) {
case 0:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x8A0;
else
sequenceId = 0x8A1;
break;
case 1:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x880;
else
sequenceId = 0x895;
break;
case 2:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x884;
else
sequenceId = 0x899;
break;
//Skip 3
case 4:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x881;
else
sequenceId = 0x896;
break;
case 5:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x883;
else
sequenceId = 0x898;
break;
case 6:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x87E;
else
sequenceId = 0x893;
break;
case 7:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x848;
else
sequenceId = 0x890;
break;
case 8:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x87D;
else
sequenceId = 0x892;
break;
case 9:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x882;
else
sequenceId = 0x897;
break;
case 10:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x87C;
else
sequenceId = 0x891;
break;
case 11:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x87C;
else
sequenceId = 0x891;
break;
case 12:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x87D;
else
sequenceId = 0x892;
break;
case 13:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x888;
else
sequenceId = 0x89D;
break;
case 14:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x87F;
else
sequenceId = 0x894;
break;
case 15:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x87B;
else
sequenceId = 0x8A3;
break;
case 16:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x877;
else
sequenceId = 0x88C;
@@ -1410,43 +1412,43 @@ int GnapEngine::getGnapShowSequenceId(int index, int gridX, int gridY) {
sequenceId = 0x887;
break;
case 19:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x87A;
else
sequenceId = 0x88F;
break;
case 20:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x878;
else
sequenceId = 0x88D;
break;
case 21:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x879;
else
sequenceId = 0x88E;
break;
case 22:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x88A;
else
sequenceId = 0x89F;
break;
case 23:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x889;
else
sequenceId = 0x89E;
break;
case 24:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x886;
else
sequenceId = 0x89B;
break;
case 25:
- if (_gnapIdleFacing == kDirUpRight)
+ if (_gnap->_idleFacing == kDirUpRight)
sequenceId = 0x87A;
else
sequenceId = 0x88F;
@@ -1456,7 +1458,7 @@ int GnapEngine::getGnapShowSequenceId(int index, int gridX, int gridY) {
//Skip 28
//Skip 29
default:
- _gnapIdleFacing = facing;
+ _gnap->_idleFacing = facing;
sequenceId = getGnapSequenceId(gskImpossible, 0, 0);
break;
}
@@ -1473,7 +1475,7 @@ void GnapEngine::gnapIdle() {
_gnapSequenceId == 0x831 || _gnapSequenceId == 0x89A)) {
_gameSys->insertSequence(getGnapSequenceId(gskIdle, 0, 0) | 0x10000, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncExists, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
+ kSeqSyncExists, 0, 75 * _gnap->_pos.x - _gnapGridX, 48 * _gnap->_pos.y - _gnapGridY);
_gnapSequenceId = getGnapSequenceId(gskIdle, 0, 0);
_gnapSequenceDatNum = 1;
}
@@ -1484,7 +1486,7 @@ void GnapEngine::gnapActionIdle(int sequenceId) {
ridToEntryIndex(sequenceId) == _gnapSequenceId) {
_gameSys->insertSequence(getGnapSequenceId(gskIdle, 0, 0) | 0x10000, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncExists, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
+ kSeqSyncExists, 0, 75 * _gnap->_pos.x - _gnapGridX, 48 * _gnap->_pos.y - _gnapGridY);
_gnapSequenceId = getGnapSequenceId(gskIdle, 0, 0);
_gnapSequenceDatNum = 1;
}
@@ -1496,7 +1498,7 @@ void GnapEngine::playGnapSequence(int sequenceId) {
gnapIdle();
_gameSys->insertSequence(sequenceId, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqScale | kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
+ kSeqScale | kSeqSyncWait, 0, 75 * _gnap->_pos.x - _gnapGridX, 48 * _gnap->_pos.y - _gnapGridY);
_gnapSequenceId = ridToEntryIndex(sequenceId);
_gnapSequenceDatNum = ridToDatIndex(sequenceId);
}
@@ -1554,7 +1556,7 @@ void GnapEngine::updateGnapIdleSequence() {
if (_timers[3] == 0) {
_timers[2] = 60;
_timers[3] = 300;
- if (_gnapIdleFacing == kDirBottomRight) {
+ if (_gnap->_idleFacing == kDirBottomRight) {
switch (getRandom(5)) {
case 0:
playGnapSequence(0x107A6);
@@ -1569,7 +1571,7 @@ void GnapEngine::updateGnapIdleSequence() {
playGnapSequence(0x108A2);
break;
}
- } else if (_gnapIdleFacing == kDirBottomLeft) {
+ } else if (_gnap->_idleFacing == kDirBottomLeft) {
if (getRandom(5) > 2)
playGnapSequence(0x10832);
else
@@ -1578,16 +1580,16 @@ void GnapEngine::updateGnapIdleSequence() {
}
} else {
_timers[2] = getRandom(30) + 20;
- if (_gnapIdleFacing == kDirBottomRight) {
+ if (_gnap->_idleFacing == kDirBottomRight) {
_gameSys->insertSequence(0x107BD, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
+ kSeqSyncWait, 0, 75 * _gnap->_pos.x - _gnapGridX, 48 * _gnap->_pos.y - _gnapGridY);
_gnapSequenceId = 0x7BD;
_gnapSequenceDatNum = 1;
- } else if (_gnapIdleFacing == kDirBottomLeft) {
+ } else if (_gnap->_idleFacing == kDirBottomLeft) {
_gameSys->insertSequence(0x107BE, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
+ kSeqSyncWait, 0, 75 * _gnap->_pos.x - _gnapGridX, 48 * _gnap->_pos.y - _gnapGridY);
_gnapSequenceId = 0x7BE;
_gnapSequenceDatNum = 1;
}
@@ -1604,24 +1606,24 @@ void GnapEngine::updateGnapIdleSequence2() {
if (_timers[3] == 0) {
_timers[2] = 60;
_timers[3] = 300;
- if (_gnapIdleFacing == kDirBottomRight) {
+ if (_gnap->_idleFacing == kDirBottomRight) {
playGnapSequence(0x107AA);
- } else if (_gnapIdleFacing == kDirBottomLeft) {
+ } else if (_gnap->_idleFacing == kDirBottomLeft) {
playGnapSequence(0x10832);
}
}
} else {
_timers[2] = getRandom(30) + 20;
- if (_gnapIdleFacing == kDirBottomRight) {
+ if (_gnap->_idleFacing == kDirBottomRight) {
_gameSys->insertSequence(0x107BD, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
+ kSeqSyncWait, 0, 75 * _gnap->_pos.x - _gnapGridX, 48 * _gnap->_pos.y - _gnapGridY);
_gnapSequenceId = 0x7BD;
_gnapSequenceDatNum = 1;
- } else if (_gnapIdleFacing == kDirBottomLeft) {
+ } else if (_gnap->_idleFacing == kDirBottomLeft) {
_gameSys->insertSequence(0x107BE, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
+ kSeqSyncWait, 0, 75 * _gnap->_pos.x - _gnapGridX, 48 * _gnap->_pos.y - _gnapGridY);
_gnapSequenceId = 0x7BE;
_gnapSequenceDatNum = 1;
}
@@ -1649,23 +1651,22 @@ bool GnapEngine::testWalk(int animationIndex, int someStatus, int gridX1, int gr
void GnapEngine::initGnapPos(int gridX, int gridY, Facing facing) {
_timers[2] = 30;
_timers[3] = 300;
- _gnapX = gridX;
- _gnapY = gridY;
+ _gnap->_pos = Common::Point(gridX, gridY);
if (facing == kDirNone)
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
else
- _gnapIdleFacing = facing;
- if (_gnapIdleFacing == kDirBottomLeft) {
+ _gnap->_idleFacing = facing;
+ if (_gnap->_idleFacing == kDirBottomLeft) {
_gnapSequenceId = 0x7B8;
} else {
_gnapSequenceId = 0x7B5;
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
}
- _gnapId = 20 * _gnapY;
+ _gnapId = 20 * _gnap->_pos.y;
_gnapSequenceDatNum = 1;
- _gameSys->insertSequence(makeRid(1, _gnapSequenceId), 20 * _gnapY,
+ _gameSys->insertSequence(makeRid(1, _gnapSequenceId), 20 * _gnap->_pos.y,
0, 0,
- kSeqScale, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
+ kSeqScale, 0, 75 * _gnap->_pos.x - _gnapGridX, 48 * _gnap->_pos.y - _gnapGridY);
}
void GnapEngine::gnapInitBrainPulseRndValue() {
@@ -1692,7 +1693,7 @@ void GnapEngine::gnapUseDeviceOnPlatypus() {
int newSequenceId = getGnapSequenceId(gskUseDevice, 0, 0);
_gameSys->insertSequence(makeRid(1, newSequenceId), _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
+ kSeqSyncWait, 0, 75 * _gnap->_pos.x - _gnapGridX, 48 * _gnap->_pos.y - _gnapGridY);
_gnapSequenceId = newSequenceId;
_gnapSequenceDatNum = 1;
}
@@ -1712,9 +1713,9 @@ bool GnapEngine::gnapPlatypusAction(int gridX, int gridY, int platSequenceId, in
if (_gnapActionStatus <= -1 && _platypusActionStatus <= -1) {
_gnapActionStatus = 100;
- if (isPointBlocked(_platX + gridX, _platY + gridY) && (_platX + gridX != _gnapX || _platY + gridY != _gnapY))
+ if (isPointBlocked(_platX + gridX, _platY + gridY) && (_gnap->_pos != Common::Point(_platX + gridX, _platY + gridY)))
platypusWalkStep();
- if (!isPointBlocked(_platX + gridX, _platY + gridY) && (_platX + gridX != _gnapX || _platY + gridY != _gnapY)) {
+ if (!isPointBlocked(_platX + gridX, _platY + gridY) && (_gnap->_pos != Common::Point(_platX + gridX, _platY + gridY))) {
gnapWalkTo(_platX + gridX, _platY + gridY, 0, 0x107B9, 1);
while (_gameSys->getAnimationStatus(0) != 2) {
updateMouseCursor();
@@ -1722,7 +1723,7 @@ bool GnapEngine::gnapPlatypusAction(int gridX, int gridY, int platSequenceId, in
gameUpdateTick();
}
_gameSys->setAnimation(0, 0, 0);
- if (_platX + gridX == _gnapX && _platY + gridY == _gnapY) {
+ if (_gnap->_pos == Common::Point(_platX + gridX, _platY + gridY)) {
_gameSys->setAnimation(platSequenceId, _platypusId, 1);
playPlatypusSequence(platSequenceId);
while (_gameSys->getAnimationStatus(1) != 2) {
@@ -1745,7 +1746,7 @@ void GnapEngine::gnapKissPlatypus(int callback) {
_gameSys->setAnimation(0x10847, _gnapId, 0);
_gameSys->insertSequence(0x10847, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncWait, 0, 15 * (5 * _gnapX - 20) - (21 - _gridMinX), 48 * (_gnapY - 6) - (146 - _gridMinY));
+ kSeqSyncWait, 0, 15 * (5 * _gnap->_pos.x - 20) - (21 - _gridMinX), 48 * (_gnap->_pos.y - 6) - (146 - _gridMinY));
_gnapSequenceDatNum = 1;
_gnapSequenceId = 0x847;
_gameSys->insertSequence(0x107CB, _platypusId,
@@ -1775,7 +1776,7 @@ void GnapEngine::gnapUseJointOnPlatypus() {
_gameSys->setAnimation(0x10876, _platypusId, 0);
_gameSys->insertSequence(0x10875, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncWait, 0, 15 * (5 * _gnapX - 30), 48 * (_gnapY - 7));
+ kSeqSyncWait, 0, 15 * (5 * _gnap->_pos.x - 30), 48 * (_gnap->_pos.y - 7));
_gnapSequenceDatNum = 1;
_gnapSequenceId = 0x875;
_gameSys->insertSequence(0x10876, _platypusId,
@@ -1936,7 +1937,7 @@ void GnapEngine::playSequences(int fullScreenSpriteId, int sequenceId1, int sequ
_gameSys->setAnimation(sequenceId2, _gnapId, 0);
_gameSys->insertSequence(sequenceId2, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncWait, 0, 15 * (5 * _gnapX - 25), 48 * (_gnapY - 8));
+ kSeqSyncWait, 0, 15 * (5 * _gnap->_pos.x - 25), 48 * (_gnap->_pos.y - 8));
_gnapSequenceId = sequenceId2;
_gnapSequenceDatNum = 0;
while (_gameSys->getAnimationStatus(0) != 2)
@@ -1950,7 +1951,7 @@ void GnapEngine::playSequences(int fullScreenSpriteId, int sequenceId1, int sequ
_gameSys->setAnimation(sequenceId3, _gnapId, 0);
_gameSys->insertSequence(sequenceId3, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
- kSeqSyncWait, 0, 15 * (5 * _gnapX - 25), 48 * (_gnapY - 8));
+ kSeqSyncWait, 0, 15 * (5 * _gnap->_pos.x - 25), 48 * (_gnap->_pos.y - 8));
removeFullScreenSprite();
showCursor();
_gnapSequenceId = sequenceId3;
diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h
index b388022231..d16ba24f92 100644
--- a/engines/gnap/gnap.h
+++ b/engines/gnap/gnap.h
@@ -42,6 +42,7 @@
#include "gnap/debugger.h"
#include "gnap/resource.h"
#include "gnap/scenes/scenecore.h"
+#include "gnap/character.h"
struct ADGameDescription;
@@ -250,15 +251,6 @@ enum {
// 0x7AF Gnap walks to the left 1
// 0x7B0 Gnap walks to the left 2
-enum Facing {
- kDirNone = 0,
- kDirBottomRight = 1,
- kDirBottomLeft = 3,
- kDirUnk4 = 4,
- kDirUpLeft = 5,
- kDirUpRight = 7
-};
-
struct GnapSavegameHeader {
uint8 _version;
Common::String _saveName;
@@ -292,6 +284,7 @@ public:
SoundMan *_soundMan;
Debugger *_debugger;
Scene *_scene;
+ PlayerGnap *_gnap;
int _lastUpdateClock;
@@ -494,7 +487,6 @@ public:
// Gnap walking
int _gnapWalkNodesCount;
GridStruct _gnapWalkNodes[kMaxGridStructs];
- int _gnapX, _gnapY;
int _gnapWalkDestX, _gnapWalkDestY;
int _gnapWalkDeltaX, _gnapWalkDeltaY, _gnapWalkDirX, _gnapWalkDirY, _gnapWalkDirXIncr, _gnapWalkDirYIncr;
@@ -505,6 +497,7 @@ public:
bool gridSub41F5FC(int gridX, int gridY, int index);
bool gridSub41FAD5(int gridX, int gridY, int index);
bool gnapFindPath3(int gridX, int gridY);
+ bool gnapWalkTo(Common::Point gridPos, int animationIndex, int sequenceId, int flags);
bool gnapWalkTo(int gridX, int gridY, int animationIndex, int sequenceId, int flags);
void gnapWalkStep();
@@ -525,7 +518,6 @@ public:
void platypusMakeRoom();
// Gnap
- Facing _gnapIdleFacing;
int _gnapActionStatus;
int _gnapBrainPulseNum, _gnapBrainPulseRndValue;
int _gnapSequenceId, _gnapSequenceDatNum, _gnapId;
diff --git a/engines/gnap/grid.cpp b/engines/gnap/grid.cpp
index dfdc52811a..ec90cf1e8a 100644
--- a/engines/gnap/grid.cpp
+++ b/engines/gnap/grid.cpp
@@ -73,7 +73,7 @@ bool GnapEngine::isPointBlocked(int gridX, int gridY) {
if (gridX < 0 || gridX >= _gridMaxX || gridY < 0 || gridY >= _gridMaxY)
return true;
- if ((gridX == _gnapX && gridY == _gnapY) || (gridX == _platX && gridY == _platY))
+ if ((_gnap->_pos == Common::Point(gridX, gridY)) || (gridX == _platX && gridY == _platY))
return true;
const int x = _gridMinX + 75 * gridX;
@@ -537,8 +537,11 @@ bool GnapEngine::gnapFindPath3(int gridX, int gridY) {
return done;
}
-bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequenceId, int flags) {
+bool GnapEngine::gnapWalkTo(Common::Point gridPos, int animationIndex, int sequenceId, int flags) {
+ return gnapWalkTo(gridPos.x, gridPos.y, animationIndex, sequenceId, flags);
+}
+bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequenceId, int flags) {
int datNum = flags & 3;
bool done = false;
@@ -557,16 +560,17 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
if (animationIndex >= 0 && _gnapWalkDestX == _platX && _gnapWalkDestY == _platY)
platypusMakeRoom();
- if (gridSub41F5FC(_gnapX, _gnapY, 0))
+ // TODO: Simplify the cascade of Ifs
+ if (gridSub41F5FC(_gnap->_pos.x, _gnap->_pos.y, 0))
done = true;
- if (!done && gridSub41FAD5(_gnapX, _gnapY, 0))
+ if (!done && gridSub41FAD5(_gnap->_pos.x, _gnap->_pos.y, 0))
done = true;
- if (!done && gnapFindPath3(_gnapX, _gnapY))
+ if (!done && gnapFindPath3(_gnap->_pos.x, _gnap->_pos.y))
done = true;
- if (!done && gridSub41F08B(_gnapX, _gnapY))
+ if (!done && gridSub41F08B(_gnap->_pos.x, _gnap->_pos.y))
done = true;
gnapIdle();
@@ -627,7 +631,7 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
if (_gnapWalkNodesCount > 0) {
_gnapSequenceId = gnapSequenceId;
_gnapId = gnapId;
- _gnapIdleFacing = getGnapWalkFacing(_gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaX, _gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaY);
+ _gnap->_idleFacing = getGnapWalkFacing(_gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaX, _gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaY);
_gnapSequenceDatNum = datNum;
if (animationIndex >= 0)
_gameSys->setAnimation(makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId, animationIndex);
@@ -640,26 +644,26 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
_gnapSequenceId = ridToEntryIndex(sequenceId);
_gnapSequenceDatNum = ridToDatIndex(sequenceId);
if (_gnapSequenceId == 0x7B9) {
- _gnapIdleFacing = kDirBottomRight;
+ _gnap->_idleFacing = kDirBottomRight;
} else {
switch (_gnapSequenceId) {
case 0x7BA:
- _gnapIdleFacing = kDirBottomLeft;
+ _gnap->_idleFacing = kDirBottomLeft;
break;
case 0x7BB:
- _gnapIdleFacing = kDirUpRight;
+ _gnap->_idleFacing = kDirUpRight;
break;
case 0x7BC:
- _gnapIdleFacing = kDirUpLeft;
+ _gnap->_idleFacing = kDirUpLeft;
break;
}
}
} else {
if (_gnapWalkNodesCount > 0) {
_gnapSequenceId = getGnapWalkStopSequenceId(_gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaX, _gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaY);
- _gnapIdleFacing = getGnapWalkFacing(_gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaX, _gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaY);
+ _gnap->_idleFacing = getGnapWalkFacing(_gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaX, _gnapWalkNodes[_gnapWalkNodesCount - 1]._deltaY);
} else if (gridX >= 0 || gridY >= 0) {
- switch (_gnapIdleFacing) {
+ switch (_gnap->_idleFacing) {
case kDirBottomRight:
_gnapSequenceId = 0x7B9;
break;
@@ -674,14 +678,15 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
break;
}
} else {
- int v10 = _leftClickMouseX - (_gridMinX + 75 * _gnapX);
- int v11 = _leftClickMouseY - (_gridMinY + 48 * _gnapY);
- if (_leftClickMouseX == _gridMinX + 75 * _gnapX)
+ //TODO: simplify the checks by using v10 and v11
+ int v10 = _leftClickMouseX - (_gridMinX + 75 * _gnap->_pos.x);
+ int v11 = _leftClickMouseY - (_gridMinY + 48 * _gnap->_pos.y);
+ if (_leftClickMouseX == _gridMinX + 75 * _gnap->_pos.x)
++v10;
- if (_leftClickMouseY == _gridMinY + 48 * _gnapY)
+ if (_leftClickMouseY == _gridMinY + 48 * _gnap->_pos.y)
v11 = 1;
_gnapSequenceId = getGnapWalkStopSequenceId(v10 / abs(v10), v11 / abs(v11));
- _gnapIdleFacing = getGnapWalkFacing(v10 / abs(v10), v11 / abs(v11));
+ _gnap->_idleFacing = getGnapWalkFacing(v10 / abs(v10), v11 / abs(v11));
}
_gnapSequenceDatNum = datNum;
}
@@ -704,8 +709,7 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
}
}
- _gnapX = _gnapWalkDestX;
- _gnapY = _gnapWalkDestY;
+ _gnap->_pos = Common::Point(_gnapWalkDestX, _gnapWalkDestY);
return done;
}
@@ -714,22 +718,22 @@ void GnapEngine::gnapWalkStep() {
bool done = false;
for (int i = 1; i < _gridMaxX && !done; ++i) {
done = true;
- if (!isPointBlocked(_gnapX + i, _gnapY))
- gnapWalkTo(_gnapX + i, _gnapY, -1, -1, 1);
- else if (!isPointBlocked(_gnapX - i, _gnapY))
- gnapWalkTo(_gnapX - i, _gnapY, -1, -1, 1);
- else if (!isPointBlocked(_gnapX, _gnapY + 1))
- gnapWalkTo(_gnapX, _gnapY + 1, -1, -1, 1);
- else if (!isPointBlocked(_gnapX, _gnapY - 1))
- gnapWalkTo(_gnapX, _gnapY - 1, -1, -1, 1);
- else if (!isPointBlocked(_gnapX + 1, _gnapY + 1))
- gnapWalkTo(_gnapX + 1, _gnapY + 1, -1, -1, 1);
- else if (!isPointBlocked(_gnapX - 1, _gnapY + 1))
- gnapWalkTo(_gnapX - 1, _gnapY + 1, -1, -1, 1);
- else if (!isPointBlocked(_gnapX + 1, _gnapY - 1))
- gnapWalkTo(_gnapX + 1, _gnapY - 1, -1, -1, 1);
- else if (!isPointBlocked(_gnapX - 1, _gnapY - 1))
- gnapWalkTo(_gnapX - 1, _gnapY - 1, -1, -1, 1);
+ if (!isPointBlocked(_gnap->_pos.x + i, _gnap->_pos.y))
+ gnapWalkTo(_gnap->_pos.x + i, _gnap->_pos.y, -1, -1, 1);
+ else if (!isPointBlocked(_gnap->_pos.x - i, _gnap->_pos.y))
+ gnapWalkTo(_gnap->_pos.x - i, _gnap->_pos.y, -1, -1, 1);
+ else if (!isPointBlocked(_gnap->_pos.x, _gnap->_pos.y + 1))
+ gnapWalkTo(_gnap->_pos.x, _gnap->_pos.y + 1, -1, -1, 1);
+ else if (!isPointBlocked(_gnap->_pos.x, _gnap->_pos.y - 1))
+ gnapWalkTo(_gnap->_pos.x, _gnap->_pos.y - 1, -1, -1, 1);
+ else if (!isPointBlocked(_gnap->_pos.x + 1, _gnap->_pos.y + 1))
+ gnapWalkTo(_gnap->_pos.x + 1, _gnap->_pos.y + 1, -1, -1, 1);
+ else if (!isPointBlocked(_gnap->_pos.x - 1, _gnap->_pos.y + 1))
+ gnapWalkTo(_gnap->_pos.x - 1, _gnap->_pos.y + 1, -1, -1, 1);
+ else if (!isPointBlocked(_gnap->_pos.x + 1, _gnap->_pos.y - 1))
+ gnapWalkTo(_gnap->_pos.x + 1, _gnap->_pos.y - 1, -1, -1, 1);
+ else if (!isPointBlocked(_gnap->_pos.x - 1, _gnap->_pos.y - 1))
+ gnapWalkTo(_gnap->_pos.x - 1, _gnap->_pos.y - 1, -1, -1, 1);
else
done = false;
}
@@ -1210,7 +1214,7 @@ bool GnapEngine::platypusWalkTo(int gridX, int gridY, int animationIndex, int se
_platWalkDestX = CLIP(gridX, 0, _gridMaxX - 1);
_platWalkDestY = CLIP(gridY, 0, _gridMaxY - 1);
- if (animationIndex >= 0 && _platWalkDestX == _gnapX && _platWalkDestY == _gnapY)
+ if (animationIndex >= 0 && _gnap->_pos == Common::Point(_platWalkDestX, _platWalkDestY))
gnapWalkStep();
if (gridSub423CC1(_platX, _platY, 0))
diff --git a/engines/gnap/module.mk b/engines/gnap/module.mk
index 79849cf293..5305299cd2 100644
--- a/engines/gnap/module.mk
+++ b/engines/gnap/module.mk
@@ -1,6 +1,7 @@
MODULE := engines/gnap
MODULE_OBJS := \
+ character.o \
datarchive.o \
debugger.o \
detection.o \
diff --git a/engines/gnap/scenes/group0.cpp b/engines/gnap/scenes/group0.cpp
index 4ec0d88c61..019678d15f 100644
--- a/engines/gnap/scenes/group0.cpp
+++ b/engines/gnap/scenes/group0.cpp
@@ -21,6 +21,7 @@
*/
#include "gnap/gnap.h"
+#include "gnap/character.h"
#include "gnap/gamesys.h"
#include "gnap/resource.h"
#include "gnap/scenes/group0.h"
@@ -156,7 +157,7 @@ void Scene01::run() {
} else {
switch (_vm->_verbCursor) {
case LOOK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[4].x, _vm->_hotspotsWalkPos[4].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1))
_vm->_gnapActionStatus = kAS01LookSpaceship;
break;
@@ -199,17 +200,17 @@ void Scene01::run() {
} else {
switch (_vm->_verbCursor) {
case LOOK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 7, 2) | 0x10000, 1);
_vm->_gnapActionStatus = kAS01LookPigs;
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 7, 2) | 0x10000, 1);
_vm->_gnapActionStatus = kAS01UsePigs;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 7, 2) | 0x10000, 1);
_vm->_gnapActionStatus = kAS01LookPigs;
break;
@@ -502,7 +503,7 @@ void Scene02::run() {
case kHS02Chicken:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex == kItemTwig) {
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].x, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].y + 1,
0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS02UseTwigWithChicken;
@@ -514,14 +515,14 @@ void Scene02::run() {
_vm->playGnapMoan2(9, 8);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[1].x, _vm->_hotspotsWalkPos[1].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1))
_vm->_gnapActionStatus = kAS02GrabChicken;
else
_vm->_gnapActionStatus = -1;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[1].x, _vm->_hotspotsWalkPos[1].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS02TalkChicken;
break;
@@ -566,7 +567,7 @@ void Scene02::run() {
_vm->_gnapActionStatus = kAS02UseTruckNoGas;
}
} else {
- _vm->_gnapIdleFacing = kDirUnk4;
+ _vm->_gnap->_idleFacing = kDirUnk4;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 2, 2) | 0x10000, 1))
_vm->_gnapActionStatus = kAS02UseTruckNoKeys;
}
@@ -590,7 +591,7 @@ void Scene02::run() {
_vm->playGnapMoan2(2, 4);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[4].x, _vm->_hotspotsWalkPos[4].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS02GrabTruckGrill;
break;
@@ -793,7 +794,7 @@ void Scene02::updateAnimations() {
_vm->_timers[2] = 100;
break;
case kAS02GrabChickenDone:
- gameSys.insertSequence(0x107B5, _vm->_gnapId, 0x150, 179, kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ gameSys.insertSequence(0x107B5, _vm->_gnapId, 0x150, 179, kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceId = 0x7B5;
_vm->_gnapSequenceDatNum = 1;
_currChickenSequenceId = 0x14B;
@@ -1060,7 +1061,7 @@ void Scene03::run() {
if (_platypusHypnotized) {
_vm->playGnapBrainPulsating(8, 4);
} else {
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[4].x, _vm->_hotspotsWalkPos[4].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
if (_platypusScared)
_vm->_gnapActionStatus = kAS03HypnotizeScaredPlat;
@@ -1260,22 +1261,21 @@ void Scene03::updateAnimations() {
gameSys.insertSequence(_nextPlatSequenceId, 99, _vm->_platypusSequenceId | (_vm->_platypusSequenceDatNum << 16), 99, kSeqSyncWait, 0, 0, 0);
_vm->_gnapSequenceId = 0x1B5;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapIdleFacing = kDirNone;
+ _vm->_gnap->_idleFacing = kDirNone;
_vm->_platypusSequenceId = _nextPlatSequenceId;
_vm->_platypusSequenceDatNum = 0;
gameSys.setAnimation(_nextPlatSequenceId, 99, 1);
_nextPlatSequenceId = -1;
_vm->_gnapActionStatus = -1;
} else if (_nextPlatSequenceId == 0x1BC) {
- _vm->_gnapX = 3;
- _vm->_gnapY = 6;
+ _vm->_gnap->_pos = Common::Point(3, 6);
gameSys.insertSequence(0x1B6, 120, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
gameSys.insertSequence(0x1BC, 99, _vm->_platypusSequenceId | (_vm->_platypusSequenceDatNum << 16), 99, kSeqSyncWait, 0, 0, 0);
gameSys.setAnimation(0x1BC, 99, 0);
- _vm->_gnapId = 20 * _vm->_gnapY;
+ _vm->_gnapId = 20 * _vm->_gnap->_pos.y;
_vm->_gnapSequenceId = 0x1B6;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapIdleFacing = kDirNone;
+ _vm->_gnap->_idleFacing = kDirNone;
_vm->_gnapActionStatus = kAS03FreePlatypusDone;
_nextPlatSequenceId = -1;
} else if (_nextPlatSequenceId == 0x1C2 && !_platypusScared) {
@@ -1380,8 +1380,7 @@ void Scene04::run() {
_vm->_timers[3] = 300;
// TODO setCursor((LPCSTR)IDC_WAIT);
_vm->setGrabCursorSprite(kItemKeys);
- _vm->_gnapX = 4;
- _vm->_gnapY = 7;
+ _vm->_gnap->_pos = Common::Point(4, 7);
_vm->_gnapId = 140;
_vm->_platX = 6;
_vm->_platY = 7;
@@ -1509,7 +1508,7 @@ void Scene04::run() {
_vm->playGnapMoan2(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS04GrabAxe;
_vm->setFlag(kGFPlatypusTalkingToAssistant);
@@ -1531,19 +1530,19 @@ void Scene04::run() {
} else {
switch (_vm->_verbCursor) {
case LOOK_CURSOR:
- if (_vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, -1, 1)) {
+ if (_vm->gnapWalkTo(_vm->_gnap->_pos, 0, -1, 1)) {
_vm->playGnapMoan2(_vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y);
_nextDogSequenceId = 0x20F;
}
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1))
_vm->_gnapActionStatus = kAS04GrabDog;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomRight;
- if (_vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, -1, 1)) {
+ _vm->_gnap->_idleFacing = kDirBottomRight;
+ if (_vm->gnapWalkTo(_vm->_gnap->_pos, 0, -1, 1)) {
_vm->playGnapBrainPulsating(_vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y);
_nextDogSequenceId = 0x20E;
}
@@ -1571,7 +1570,7 @@ void Scene04::run() {
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[4].x, _vm->_hotspotsWalkPos[4].y, 0, 0x107BC, 1);
_vm->_gnapActionStatus = kAS04OpenDoor;
_vm->_timers[5] = 300;
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
} else {
_vm->_isLeavingScene = true;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[4].x, _vm->_hotspotsWalkPos[4].y, 0, 0x107BC, 1);
@@ -1715,8 +1714,7 @@ void Scene04::updateAnimations() {
case kAS04OpenDoor:
gameSys.insertSequence(0x205, _vm->_gnapId, 0, 0, kSeqNone, 0, 0, 0);
gameSys.insertSequence(0x207, 121, 521, 121, kSeqSyncWait, 0, 0, 0);
- _vm->_gnapX = 6;
- _vm->_gnapY = 7;
+ _vm->_gnap->_pos = Common::Point(6, 7);
gameSys.insertSequence(0x107B5, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
kSeqSyncWait, _vm->getSequenceTotalDuration(0x205) - 1, 450 - _vm->_gnapGridX, 336 - _vm->_gnapGridY);
@@ -1750,8 +1748,8 @@ void Scene04::updateAnimations() {
gameSys.requestRemoveSequence(0x20B, 256);
gameSys.insertSequence(0x107B5, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), 255,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
- _vm->_gnapIdleFacing = kDirBottomRight;
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->_gnapSequenceId = 0x7B5;
_vm->_gnapSequenceDatNum = 1;
_vm->_gnapActionStatus = -1;
@@ -1777,10 +1775,10 @@ void Scene04::updateAnimations() {
gameSys.removeSequence(0x20A, 256, true);
gameSys.insertSequence(0x107B5, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), 255,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceId = 0x7B5;
_vm->_gnapSequenceDatNum = 1;
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->_gnapActionStatus = -1;
break;
case kAS04GrabDog:
@@ -1970,7 +1968,7 @@ void Scene05::run() {
_vm->_platypusActionStatus = kAS05PlatSearchHaystack;
_vm->_platypusFacing = kDirUnk4;
}
- if (_vm->_gnapX == 4 && (_vm->_gnapY == 8 || _vm->_gnapY == 7))
+ if (_vm->_gnap->_pos.x == 4 && (_vm->_gnap->_pos.y == 8 || _vm->_gnap->_pos.y == 7))
_vm->gnapWalkStep();
_vm->playGnapIdle(_vm->_platX, _vm->_platY);
}
@@ -1983,7 +1981,7 @@ void Scene05::run() {
case kHS05Chicken:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex == kItemTwig) {
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].x, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].y + 1,
0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS05UseTwigWithChicken;
@@ -1995,12 +1993,12 @@ void Scene05::run() {
_vm->playGnapMoan2(9, 7);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[5].x, _vm->_hotspotsWalkPos[5].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS05GrabChicken;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[5].x, _vm->_hotspotsWalkPos[5].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS05TalkChicken;
break;
@@ -2022,7 +2020,7 @@ void Scene05::run() {
_vm->playGnapMoan2(2, 4);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomLeft;
+ _vm->_gnap->_idleFacing = kDirBottomLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS05GrabLadder;
break;
@@ -2057,7 +2055,7 @@ void Scene05::run() {
_vm->playGnapScratchingHead(7, 4);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].x, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].y,
0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS05TryPickPadlock;
@@ -2193,7 +2191,7 @@ void Scene05::updateAnimations() {
case kAS05EnterBarn:
gameSys.insertSequence(0x107B1, 1,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
gameSys.setAnimation(0x107B1, 1, 0);
_vm->_gnapActionStatus = kAS05LeaveScene;
break;
@@ -2440,7 +2438,7 @@ void Scene06::run() {
_vm->_hotspots[kHS06WalkArea5]._flags |= SF_WALKABLE;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, 0x107BC, 1);
_vm->_hotspots[kHS06WalkArea5]._flags &= ~SF_WALKABLE;
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->platypusWalkTo(6, 8, 1, 0x107C2, 1);
_vm->_platypusFacing = kDirNone;
_vm->_gnapActionStatus = kAS06UseTwigOnHorse;
@@ -2456,7 +2454,7 @@ void Scene06::run() {
if (_horseTurnedBack) {
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 3, 2) | 0x10000, 1);
} else {
- _vm->_gnapIdleFacing = kDirBottomLeft;
+ _vm->_gnap->_idleFacing = kDirBottomLeft;
_vm->_hotspots[kHS06WalkArea5]._flags |= SF_WALKABLE;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_hotspots[kHS06WalkArea5]._flags &= ~SF_WALKABLE;
@@ -2571,8 +2569,7 @@ void Scene06::updateAnimations() {
_vm->_gnapActionStatus = kAS06TryToClimbLadderDone;
break;
case kAS06TryToClimbLadderDone:
- _vm->_gnapX = 6;
- _vm->_gnapY = 7;
+ _vm->_gnap->_pos = Common::Point(6, 7);
_vm->_gnapActionStatus = -1;
break;
case kAS06TalkToHorse:
@@ -2626,7 +2623,7 @@ void Scene06::updateAnimations() {
_vm->_platypusSequenceId = 0xFA;
_vm->_platypusSequenceDatNum = 0;
gameSys.insertSequence(0x107B7, _vm->_gnapId, 0x100, _vm->_gnapId,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceId = 0x7B7;
_vm->_gnapSequenceDatNum = 1;
_currHorseSequenceId = _nextHorseSequenceId;
@@ -2692,12 +2689,11 @@ void Scene07::run() {
_vm->initPlatypusPos(9, 7, kDirUnk4);
_vm->endSceneInit();
} else {
- _vm->_gnapX = 6;
- _vm->_gnapY = 7;
+ _vm->_gnap->_pos = Common::Point(6, 7);
_vm->_gnapId = 140;
_vm->_gnapSequenceId = 0x8F;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
gameSys.insertSequence(0x8F, 140, 0, 0, kSeqNone, 0, 0, 0);
gameSys.setAnimation(makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, 0);
_vm->_gnapActionStatus = kAS07Wait;
@@ -2747,8 +2743,8 @@ void Scene07::run() {
case kHS07ExitHouse:
_vm->_isLeavingScene = true;
- if (_vm->_gnapX > 8)
- _vm->gnapWalkTo(_vm->_gnapX, 7, 0, 0x107AD, 1);
+ if (_vm->_gnap->_pos.x > 8)
+ _vm->gnapWalkTo(_vm->_gnap->_pos.x, 7, 0, 0x107AD, 1);
else
_vm->gnapWalkTo(8, 7, 0, 0x107AD, 1);
_vm->_gnapActionStatus = kAS07LeaveScene;
@@ -2770,7 +2766,7 @@ void Scene07::run() {
gameSys.insertSequence(0x8E, 1, 141, 1, kSeqSyncWait, 0, 0, 0);
gameSys.insertSequence(_vm->getGnapSequenceId(gskUseDevice, 0, 0) | 0x10000, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceId = _vm->getGnapSequenceId(gskUseDevice, 0, 0);
_vm->_gnapSequenceDatNum = 1;
break;
@@ -3044,13 +3040,13 @@ void Scene08::run() {
_vm->gnapActionIdle(0x14D);
_vm->gnapWalkTo(6, 6, 0, 0x107BB, 1);
_vm->_gnapActionStatus = kAS08LookMan;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
break;
case GRAB_CURSOR:
_vm->playGnapImpossible(0, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapActionIdle(0x14D);
_vm->gnapWalkTo(8, 6, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS08TalkMan;
@@ -3082,10 +3078,10 @@ void Scene08::run() {
case GRAB_CURSOR:
_vm->gnapWalkTo(4, 7, 0, 0x107BB, 1);
_vm->_gnapActionStatus = kAS08GrabDog;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapActionIdle(0x14D);
_vm->gnapWalkTo(4, 7, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS08TalkDog;
@@ -3342,7 +3338,7 @@ void Scene08::updateAnimations() {
_vm->_platypusSequenceId = 0x148;
_vm->_platypusFacing = kDirUnk4;
_vm->_platypusSequenceDatNum = 0;
- if (_vm->_gnapX == 1 && _vm->_gnapY == 8)
+ if (_vm->_gnap->_pos == Common::Point(1, 8))
_vm->gnapWalkStep();
} else if (_nextDogSequenceId != -1) {
gameSys.setAnimation(_nextDogSequenceId, 100, 3);
@@ -3355,7 +3351,7 @@ void Scene08::updateAnimations() {
_vm->_timers[3] = _vm->getRandom(50) + 200;
gameSys.insertSequence(0x14D, _vm->_gnapId, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gnapSequenceId = 0x14D;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapSequenceDatNum = 0;
_vm->_gnapActionStatus = -1;
}
@@ -3543,10 +3539,9 @@ void Scene09::updateAnimations() {
gameSys.removeSequence(0x4B, 2, true);
_vm->_gnapSequenceId = 0x4C;
_vm->_gnapId = 120;
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapX = 9;
- _vm->_gnapY = 6;
+ _vm->_gnap->_pos = Common::Point(9, 6);
_vm->_gnapActionStatus = kAS09SearchTrashDone;
break;
case kAS09SearchTrashDone:
diff --git a/engines/gnap/scenes/group1.cpp b/engines/gnap/scenes/group1.cpp
index bd77c3c133..017858b24c 100644
--- a/engines/gnap/scenes/group1.cpp
+++ b/engines/gnap/scenes/group1.cpp
@@ -159,10 +159,10 @@ void Scene10::run() {
break;
case GRAB_CURSOR:
_vm->playGnapImpossible(0, 0);
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapActionIdle(0x10C);
_vm->gnapWalkTo(4, 8, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS10AnnoyCook;
@@ -265,10 +265,9 @@ void Scene10::run() {
gameSys.insertSequence(0x10E, 120, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gnapSequenceId = 0x10E;
_vm->_gnapId = 120;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapX = 9;
- _vm->_gnapY = 6;
+ _vm->_gnap->_pos = Common::Point(9, 6);
_vm->_timers[2] = 360;
break;
case TALK_CURSOR:
@@ -402,7 +401,7 @@ void Scene10::updateAnimations() {
_vm->setGrabCursorSprite(kItemTongs);
if (_vm->_platypusActionStatus == kAS10PlatWithBox)
_vm->_platypusActionStatus = -1;
- if (_vm->_gnapX == 4 && _vm->_gnapY == 8)
+ if (_vm->_gnap->_pos == Common::Point(4, 8))
_vm->gnapWalkStep();
break;
default:
@@ -459,7 +458,7 @@ void Scene10::updateAnimations() {
_vm->_timers[3] = 300;
gameSys.insertSequence(0x10C, _vm->_gnapId, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gnapSequenceId = 0x10C;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapSequenceDatNum = 0;
_vm->_gnapActionStatus = -1;
_vm->_platypusActionStatus = -1;
@@ -654,7 +653,7 @@ void Scene11::run() {
_vm->playGnapImpossible(0, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(3, 7, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS11TalkGoggleGuy;
break;
@@ -665,7 +664,7 @@ void Scene11::run() {
case kHS11HookGuy:
if (_vm->_gnapActionStatus < 0) {
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->gnapWalkTo(5, 6, 0, 0x107BC, 9);
_vm->_gnapActionStatus = kAS11ShowItemToHookGuy;
@@ -680,7 +679,7 @@ void Scene11::run() {
_vm->_gnapActionStatus = kAS11GrabHookGuy;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomLeft;
+ _vm->_gnap->_idleFacing = kDirBottomLeft;
_vm->gnapWalkTo(5, 6, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS11TalkHookGuy;
break;
@@ -1042,18 +1041,18 @@ void Scene12::run() {
if (_vm->_grabCursorSpriteIndex == kItemQuarter) {
_vm->_largeSprite = gameSys.createSurface(0x141);
_vm->gnapWalkTo(3, 7, 0, 0x107BC, 9);
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->_gnapActionStatus = kAS12QuarterToToothGuy;
_vm->playGnapShowItem(_vm->_grabCursorSpriteIndex, 2, 0);
_vm->setGrabCursorSprite(-1);
} else if (_vm->_grabCursorSpriteIndex == kItemQuarterWithHole) {
_vm->gnapWalkTo(3, 7, 0, 0x107BC, 9);
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->_gnapActionStatus = kAS12QuarterWithHoleToToothGuy;
_vm->playGnapShowItem(_vm->_grabCursorSpriteIndex, 2, 0);
} else if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->gnapWalkTo(3, 7, 0, 0x107BC, 9);
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->_gnapActionStatus = kAS12ShowItemToToothGuy;
_vm->playGnapShowItem(_vm->_grabCursorSpriteIndex, 2, 0);
} else {
@@ -1066,7 +1065,7 @@ void Scene12::run() {
_vm->_gnapActionStatus = kAS12GrabToothGuy;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(3, 7, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS12TalkToothGuy;
break;
@@ -1084,26 +1083,26 @@ void Scene12::run() {
case kHS12Barkeeper:
if (_vm->_grabCursorSpriteIndex == kItemQuarter || _vm->_grabCursorSpriteIndex == kItemQuarterWithHole) {
_vm->gnapWalkTo(6, 6, 0, 0x107BB, 9);
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapActionStatus = kAS12QuarterWithBarkeeper;
_vm->playGnapShowItem(_vm->_grabCursorSpriteIndex, 7, 0);
} else if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->gnapWalkTo(6, 6, 0, 0x107BB, 9);
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapActionStatus = kAS12ShowItemToBarkeeper;
_vm->playGnapShowItem(_vm->_grabCursorSpriteIndex, 7, 0);
} else {
switch (_vm->_verbCursor) {
case LOOK_CURSOR:
_vm->gnapWalkTo(6, 6, 0, 0x107BB, 1);
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapActionStatus = kAS12LookBarkeeper;
break;
case GRAB_CURSOR:
_vm->playGnapImpossible(0, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(6, 6, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS12TalkBarkeeper;
break;
@@ -1119,24 +1118,24 @@ void Scene12::run() {
case kHS12BeardGuy:
if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->gnapWalkTo(7, 6, 0, 0x107BB, 9);
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapActionStatus = kAS12ShowItemToBeardGuy;
_vm->playGnapShowItem(_vm->_grabCursorSpriteIndex, 8, 0);
} else {
switch (_vm->_verbCursor) {
case LOOK_CURSOR:
_vm->gnapWalkTo(7, 6, 0, 0x107BB, 1);
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapActionStatus = kAS12LookBeardGuy;
break;
case GRAB_CURSOR:
// NOTE Bug in the original. It has 9 as flags which seems wrong here.
_vm->gnapWalkTo(7, 6, 0, 0x107BB, 1);
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapActionStatus = kAS12GrabBeardGuy;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(7, 6, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS12TalkBeardGuy;
break;
@@ -1364,7 +1363,7 @@ void Scene12::updateAnimations() {
gameSys.insertSpriteDrawItem(_vm->_largeSprite, 0, 0, 300);
gameSys.insertSequence(0x10843, 301, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
gameSys.insertSequence(0x107B7, _vm->_gnapId, 0x10843, 301,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceId = 0x7B7;
_vm->_gnapSequenceDatNum = 1;
_vm->setFlag(kGFTwigTaken);
@@ -1560,7 +1559,7 @@ void Scene13::run() {
case LOOK_CURSOR:
case GRAB_CURSOR:
case TALK_CURSOR:
- if (_vm->_gnapX == 5 && _vm->_gnapY == 5) {
+ if (_vm->_gnap->_pos == Common::Point(5, 5)) {
_backToiletCtr = MIN(5, _backToiletCtr + 1);
gameSys.setAnimation(_backToiletCtr + 0xA3, _vm->_gnapId, 0);
gameSys.insertSequence(_backToiletCtr + 0xA3, _vm->_gnapId,
@@ -1568,12 +1567,12 @@ void Scene13::run() {
kSeqScale | kSeqSyncWait, 0, 0, 0);
_vm->_gnapActionStatus = kAS13Wait;
_vm->_gnapSequenceId = _backToiletCtr + 0xA3;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapSequenceDatNum = 0;
} else {
_vm->gnapWalkTo(5, 5, 0, 0x107BB, 1);
_vm->_gnapActionStatus = kAS13BackToilet;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
}
break;
case PLAT_CURSOR:
@@ -1594,7 +1593,7 @@ void Scene13::run() {
case PLAT_CURSOR:
_vm->gnapWalkTo(6, 7, 0, 0xA9, 5);
_vm->_gnapActionStatus = kAS13FrontToilet;
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
break;
}
}
@@ -1608,13 +1607,13 @@ void Scene13::run() {
case LOOK_CURSOR:
_vm->gnapWalkTo(7, 7, 0, 0x107BB, 1);
_vm->_gnapActionStatus = kAS13LookScribble;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
break;
case GRAB_CURSOR:
_vm->playGnapScratchingHead(0, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(7, 7, -1, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0), 1);
break;
case PLAT_CURSOR:
@@ -1631,7 +1630,7 @@ void Scene13::run() {
switch (_vm->_verbCursor) {
case LOOK_CURSOR:
_vm->playGnapSequence(_vm->getGnapSequenceId(gskDeflect, 9, 6));
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, -1, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, -1, 1);
_vm->_gnapActionStatus = kAS13Wait;
break;
case GRAB_CURSOR:
@@ -1653,7 +1652,7 @@ void Scene13::run() {
switch (_vm->_verbCursor) {
case LOOK_CURSOR:
_vm->playGnapSequence(_vm->getGnapSequenceId(gskDeflect, 5, 9));
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, -1, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, -1, 1);
_vm->_gnapActionStatus = kAS13Wait;
break;
case GRAB_CURSOR:
@@ -1791,10 +1790,9 @@ void Scene13::updateAnimations() {
gameSys.removeSequence(0xAA, 256, true);
_vm->_gnapSequenceId = 0xAB;
_vm->_gnapId = 160;
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapX = 4;
- _vm->_gnapY = 8;
+ _vm->_gnap->_pos = Common::Point(4, 8);
_vm->_timers[2] = 360;
_vm->_gnapActionStatus = kAS13GrabSinkDone;
break;
@@ -1810,10 +1808,9 @@ void Scene13::updateAnimations() {
gameSys.insertSequence(0xA2, 120, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gnapSequenceId = 0xA2;
_vm->_gnapId = 120;
- _vm->_gnapIdleFacing = kDirBottomLeft;
+ _vm->_gnap->_idleFacing = kDirBottomLeft;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapX = 4;
- _vm->_gnapY = 6;
+ _vm->_gnap->_pos = Common::Point(4, 6);
_vm->_timers[2] = 360;
_vm->_gnapActionStatus = kAS13Wait;
break;
@@ -2446,8 +2443,7 @@ void Scene17::run() {
_vm->clearFlag(kGFSpringTaken);
_vm->clearFlag(kGFUnk16);
_vm->initPlatypusPos(7, 9, kDirNone);
- _vm->_gnapX = _vm->_hotspotsWalkPos[2].x;
- _vm->_gnapY = _vm->_hotspotsWalkPos[2].y;
+ _vm->_gnap->_pos = _vm->_hotspotsWalkPos[2];
_vm->_gnapId = 20 * _vm->_hotspotsWalkPos[2].y;
gameSys.insertSequence(601, 20 * _vm->_hotspotsWalkPos[2].y, 0, 0, kSeqNone, 0, 0, 0);
_vm->_gnapSequenceDatNum = 0;
@@ -2496,12 +2492,11 @@ void Scene17::run() {
_vm->endSceneInit();
}
} else {
- _vm->_gnapX = 3;
- _vm->_gnapY = 6;
+ _vm->_gnap->_pos = Common::Point(3, 6);
_vm->_gnapId = 120;
_vm->_gnapSequenceId = 0x23D;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
gameSys.insertSequence(makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, 0, 0, kSeqNone, 0, 0, 0);
_vm->_platX = -1;
_vm->_platY = 8;
@@ -2614,7 +2609,7 @@ void Scene17::run() {
case GRAB_CURSOR:
if (_vm->isFlag(kGFUnk18)) {
platHangUpPhone();
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y) | 0x10000, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y) | 0x10000, 1);
_vm->_gnapActionStatus = kAS17GetCoinFromPhone;
} else
_vm->playGnapImpossible(0, 0);
@@ -2656,7 +2651,7 @@ void Scene17::run() {
if (_vm->isFlag(kGFUnk18)) {
platHangUpPhone();
_vm->_isLeavingScene = true;
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[2].x, _vm->_hotspotsWalkPos[2].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS17GnapUsePhone;
_vm->setFlag(kGFSpringTaken);
@@ -2688,7 +2683,7 @@ void Scene17::run() {
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
_vm->_newSceneNum = 18;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[5].x, _vm->_hotspotsWalkPos[5].y, 0, 0x107BB, 1);
_vm->_gnapActionStatus = kAS17LeaveScene;
if (_vm->_platypusActionStatus != kAS17PlatPhoningAssistant)
@@ -2701,7 +2696,7 @@ void Scene17::run() {
platHangUpPhone();
_vm->_isLeavingScene = true;
_vm->_newSceneNum = 20;
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[3].x, _vm->_hotspotsWalkPos[3].y, 0, 0x107BC, 1);
_vm->_gnapActionStatus = kAS17LeaveScene;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[3].x + 1, _vm->_hotspotsWalkPos[3].y, -1, 0x107C2, 1);
@@ -3166,7 +3161,7 @@ void Scene18::gnapCarryGarbageCanTo(int gridX) {
int curGridX = (_vm->_leftClickMouseX - _vm->_gridMinX + 37) / 75;
- if (curGridX >= _vm->_gnapX)
+ if (curGridX >= _vm->_gnap->_pos.x)
destGridX = curGridX - 1;
else
destGridX = curGridX + 1;
@@ -3181,30 +3176,30 @@ void Scene18::gnapCarryGarbageCanTo(int gridX) {
if (nextGridX >= destGridX)
nextGridX = destGridX;
- if (nextGridX == _vm->_gnapX) {
+ if (nextGridX == _vm->_gnap->_pos.x) {
gnapSeqId = _vm->_gnapSequenceId;
gnapId = _vm->_gnapId;
gnapDatNum = _vm->_gnapSequenceDatNum;
- gnapGridX = _vm->_gnapX;
- if (_vm->_gnapX <= curGridX)
+ gnapGridX = _vm->_gnap->_pos.x;
+ if (_vm->_gnap->_pos.x <= curGridX)
direction = 1;
else
direction = -1;
} else {
- if (_vm->_gnapY == _vm->_platY) {
- if (nextGridX >= _vm->_gnapX) {
- if (nextGridX >= _vm->_platX && _vm->_gnapX <= _vm->_platX)
+ if (_vm->_gnap->_pos.y == _vm->_platY) {
+ if (nextGridX >= _vm->_gnap->_pos.x) {
+ if (nextGridX >= _vm->_platX && _vm->_gnap->_pos.x <= _vm->_platX)
_vm->platypusMakeRoom();
- } else if (nextGridX <= _vm->_platX && _vm->_gnapX >= _vm->_platX) {
+ } else if (nextGridX <= _vm->_platX && _vm->_gnap->_pos.x >= _vm->_platX) {
_vm->platypusMakeRoom();
}
}
gnapSeqId = _vm->_gnapSequenceId;
gnapId = _vm->_gnapId;
gnapDatNum = _vm->_gnapSequenceDatNum;
- gnapGridX = _vm->_gnapX;
+ gnapGridX = _vm->_gnap->_pos.x;
int seqId;
- if (nextGridX < _vm->_gnapX) {
+ if (nextGridX < _vm->_gnap->_pos.x) {
direction = -1;
seqId = 0x204;
} else {
@@ -3212,14 +3207,14 @@ void Scene18::gnapCarryGarbageCanTo(int gridX) {
seqId = 0x203;
}
- int seqId2 = 20 * _vm->_gnapY + 1;
+ int seqId2 = 20 * _vm->_gnap->_pos.y + 1;
do {
- if (_vm->isPointBlocked(gnapGridX + direction, _vm->_gnapY))
+ if (_vm->isPointBlocked(gnapGridX + direction, _vm->_gnap->_pos.y))
break;
seqId2 += direction;
gameSys.insertSequence(seqId, seqId2,
gnapSeqId | (gnapDatNum << 16), gnapId,
- kSeqSyncWait, 0, 75 * gnapGridX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqSyncWait, 0, 75 * gnapGridX - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
gnapSeqId = seqId;
gnapId = seqId2;
gnapDatNum = 0;
@@ -3234,18 +3229,18 @@ void Scene18::gnapCarryGarbageCanTo(int gridX) {
_vm->_gnapSequenceDatNum = 0;
if (direction == 1)
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
else
- _vm->_gnapIdleFacing = kDirBottomLeft;
+ _vm->_gnap->_idleFacing = kDirBottomLeft;
- _vm->_gnapId = 20 * _vm->_gnapY + 1;
+ _vm->_gnapId = 20 * _vm->_gnap->_pos.y + 1;
gameSys.setAnimation(makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, 0);
gameSys.insertSequence(makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
gnapSeqId | (gnapDatNum << 16), gnapId,
- kSeqScale | kSeqSyncWait, 0, 75 * gnapGridX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqScale | kSeqSyncWait, 0, 75 * gnapGridX - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
- _vm->_gnapX = gnapGridX;
+ _vm->_gnap->_pos.x = gnapGridX;
}
void Scene18::putDownGarbageCan(int animationIndex) {
@@ -3255,21 +3250,21 @@ void Scene18::putDownGarbageCan(int animationIndex) {
while (gameSys.getAnimationStatus(animationIndex) != 2)
_vm->gameUpdateTick();
}
- if (_vm->_gnapIdleFacing != kDirNone && _vm->_gnapIdleFacing != kDirBottomRight && _vm->_gnapIdleFacing != kDirUpRight)
- _vm->_s18GarbageCanPos = _vm->_gnapX - 1;
+ if (_vm->_gnap->_idleFacing != kDirNone && _vm->_gnap->_idleFacing != kDirBottomRight && _vm->_gnap->_idleFacing != kDirUpRight)
+ _vm->_s18GarbageCanPos = _vm->_gnap->_pos.x - 1;
else
- _vm->_s18GarbageCanPos = _vm->_gnapX + 1;
+ _vm->_s18GarbageCanPos = _vm->_gnap->_pos.x + 1;
_vm->clearFlag(kGFPlatypusDisguised);
updateHotspots();
- if (_vm->_gnapIdleFacing != kDirNone && _vm->_gnapIdleFacing != kDirBottomRight && _vm->_gnapIdleFacing != kDirUpRight) {
+ if (_vm->_gnap->_idleFacing != kDirNone && _vm->_gnap->_idleFacing != kDirBottomRight && _vm->_gnap->_idleFacing != kDirUpRight) {
gameSys.insertSequence(0x107BA, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceId = 0x7BA;
} else {
gameSys.insertSequence(0x107B9, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceId = 0x7B9;
}
_vm->_gnapSequenceDatNum = 1;
@@ -3508,7 +3503,7 @@ void Scene18::run() {
platEndPhoning(true);
if (_vm->_grabCursorSpriteIndex >= 0) {
if (!_vm->isFlag(kGFTruckKeysUsed))
- _vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[kHS18GarbageCan].x - (_vm->_gnapX < _vm->_s18GarbageCanPos ? 1 : -1),
+ _vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[kHS18GarbageCan].x - (_vm->_gnap->_pos.x < _vm->_s18GarbageCanPos ? 1 : -1),
_vm->_hotspotsWalkPos[kHS18GarbageCan].y, _vm->_hotspotsWalkPos[kHS18GarbageCan].x, _vm->_hotspotsWalkPos[kHS18GarbageCan].y);
else
_vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[kHS18GarbageCan].x, _vm->_hotspotsWalkPos[kHS18GarbageCan].y, 2, 4);
@@ -3516,15 +3511,15 @@ void Scene18::run() {
switch (_vm->_verbCursor) {
case LOOK_CURSOR:
if (!_vm->isFlag(kGFTruckKeysUsed))
- _vm->playGnapScratchingHead(_vm->_hotspotsWalkPos[kHS18GarbageCan].x - (_vm->_gnapX < _vm->_s18GarbageCanPos ? 1 : -1), _vm->_hotspotsWalkPos[kHS18GarbageCan].y);
+ _vm->playGnapScratchingHead(_vm->_hotspotsWalkPos[kHS18GarbageCan].x - (_vm->_gnap->_pos.x < _vm->_s18GarbageCanPos ? 1 : -1), _vm->_hotspotsWalkPos[kHS18GarbageCan].y);
else if (!_vm->isFlag(kGFTruckFilledWithGas))
_vm->playGnapScratchingHead(2, 4);
break;
case GRAB_CURSOR:
if (!_vm->isFlag(kGFTruckKeysUsed)) {
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS18GarbageCan].x - (_vm->_gnapX < _vm->_s18GarbageCanPos ? 1 : -1), _vm->_hotspotsWalkPos[kHS18GarbageCan].y,
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS18GarbageCan].x - (_vm->_gnap->_pos.x < _vm->_s18GarbageCanPos ? 1 : -1), _vm->_hotspotsWalkPos[kHS18GarbageCan].y,
-1, -1, 1);
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, _vm->getGnapSequenceId(gskIdle, _vm->_s18GarbageCanPos, _vm->_gnapY) | 0x10000, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, _vm->getGnapSequenceId(gskIdle, _vm->_s18GarbageCanPos, _vm->_gnap->_pos.y) | 0x10000, 1);
_vm->_gnapActionStatus = kAS18GrabGarbageCanFromStreet;
} else if (!_vm->isFlag(kGFTruckFilledWithGas)) {
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS18GarbageCan].x, _vm->_hotspotsWalkPos[kHS18GarbageCan].y, 0, -1, 1))
@@ -3579,7 +3574,7 @@ void Scene18::run() {
}
} else {
if (_vm->_grabCursorSpriteIndex == kItemWrench) {
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, _vm->getGnapSequenceId(gskIdle, 2, 8) | 0x10000, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, _vm->getGnapSequenceId(gskIdle, 2, 8) | 0x10000, 1);
_vm->_gnapActionStatus = kAS18OpenTopValve;
} else if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[kHS18HydrantTopValve].x, _vm->_hotspotsWalkPos[kHS18HydrantTopValve].y, 1, 5);
@@ -3621,7 +3616,7 @@ void Scene18::run() {
putDownGarbageCan(0);
}
if (_vm->_grabCursorSpriteIndex == kItemWrench) {
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, _vm->getGnapSequenceId(gskIdle, 2, 8) | 0x10000, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, _vm->getGnapSequenceId(gskIdle, 2, 8) | 0x10000, 1);
if (_vm->isFlag(kGFTruckKeysUsed))
_vm->_gnapActionStatus = kAS18OpenRightValveWithGarbageCan;
else
@@ -3800,16 +3795,16 @@ void Scene18::updateAnimations() {
gameSys.setAnimation(0, 0, 0);
switch (_vm->_gnapActionStatus) {
case kAS18GrabGarbageCanFromStreet:
- if (_vm->_gnapIdleFacing != kDirUpRight && _vm->_gnapIdleFacing != kDirBottomRight) {
+ if (_vm->_gnap->_idleFacing != kDirUpRight && _vm->_gnap->_idleFacing != kDirBottomRight) {
gameSys.insertSequence(0x1FC, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - 675, 0);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - 675, 0);
_vm->_gnapSequenceDatNum = 0;
_vm->_gnapSequenceId = 0x1FC;
} else {
gameSys.insertSequence(0x1FD, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - 525, 0);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - 525, 0);
_vm->_gnapSequenceDatNum = 0;
_vm->_gnapSequenceId = 0x1FD;
}
@@ -3997,7 +3992,7 @@ void Scene18::updateAnimations() {
_vm->clearFlag(kGFTruckFilledWithGas);
_vm->invAdd(kItemWrench);
_vm->setGrabCursorSprite(kItemWrench);
- gameSys.insertSequence(0x107B5, _vm->_gnapId, 517, _vm->_gnapId, kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ gameSys.insertSequence(0x107B5, _vm->_gnapId, 517, _vm->_gnapId, kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
updateHotspots();
_vm->_gnapSequenceDatNum = 1;
_vm->_gnapSequenceId = 0x7B5;
@@ -4200,7 +4195,7 @@ void Scene19::run() {
break;
case GRAB_CURSOR:
if (!_vm->isFlag(kGFPictureTaken)) {
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].x, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].y) | 0x10000, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].x, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].y) | 0x10000, 1);
_vm->_gnapActionStatus = kAS19GrabPicture;
}
break;
@@ -4223,7 +4218,7 @@ void Scene19::run() {
_vm->playGnapScratchingHead(6, 2);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].x, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS19TalkShopAssistant;
break;
diff --git a/engines/gnap/scenes/group2.cpp b/engines/gnap/scenes/group2.cpp
index eeffa1664e..543b4fe23e 100644
--- a/engines/gnap/scenes/group2.cpp
+++ b/engines/gnap/scenes/group2.cpp
@@ -370,7 +370,7 @@ void Scene20::run() {
_vm->playGnapMoan2(5, 4);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS20StonerGuy].x, _vm->_hotspotsWalkPos[kHS20StonerGuy].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
if (_stonerGuyShowingJoint)
_vm->_gnapActionStatus = kAS20GrabJoint;
@@ -378,7 +378,7 @@ void Scene20::run() {
_vm->playGnapImpossible(0, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS20StonerGuy].x, _vm->_hotspotsWalkPos[kHS20StonerGuy].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
if (_vm->isFlag(kGFJointTaken))
_vm->_gnapActionStatus = kAS20TalkStonerGuyNoJoint;
@@ -404,12 +404,12 @@ void Scene20::run() {
break;
case GRAB_CURSOR:
_stonerGuyShowingJoint = false;
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS20GroceryStoreGuy].x, _vm->_hotspotsWalkPos[kHS20GroceryStoreGuy].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS20GrabGroceryStoreGuy;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS20GroceryStoreGuy].x, _vm->_hotspotsWalkPos[kHS20GroceryStoreGuy].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS20TalkGroceryStoreGuy;
break;
@@ -424,7 +424,7 @@ void Scene20::run() {
case kHS20GroceryStoreHat:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex == kItemCowboyHat) {
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS20GroceryStoreHat].x, _vm->_hotspotsWalkPos[kHS20GroceryStoreHat].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS20SwitchGroceryStoreHat;
} else if (_vm->_grabCursorSpriteIndex >= 0) {
@@ -436,7 +436,7 @@ void Scene20::run() {
break;
case GRAB_CURSOR:
_stonerGuyShowingJoint = false;
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS20GroceryStoreGuy].x, _vm->_hotspotsWalkPos[kHS20GroceryStoreGuy].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS20GrabGroceryStoreHat;
break;
@@ -624,7 +624,7 @@ void Scene20::updateAnimations() {
_vm->removeFullScreenSprite();
_vm->showCursor();
_vm->setGrabCursorSprite(kItemGroceryStoreHat);
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->gnapWalkTo(3, 8, -1, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = -1;
break;
@@ -824,7 +824,7 @@ void Scene21::run() {
_vm->playGnapScratchingHead(2, 5);
break;
case GRAB_CURSOR:
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS21Banana].x, _vm->_hotspotsWalkPos[kHS21Banana].y) | 0x10000, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS21Banana].x, _vm->_hotspotsWalkPos[kHS21Banana].y) | 0x10000, 1);
_vm->playGnapPullOutDevice(2, 5);
_vm->playGnapUseDevice(0, 0);
_vm->_gnapActionStatus = kAS21GrabBanana;
@@ -851,14 +851,14 @@ void Scene21::run() {
_vm->playGnapScratchingHead(7, 4);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->_hotspots[kHS21WalkArea1]._flags |= SF_WALKABLE;
_vm->gnapWalkTo(7, 6, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS21GrabOldLady;
_vm->_hotspots[kHS21WalkArea1]._flags &= ~SF_WALKABLE;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS21OldLady].x, _vm->_hotspotsWalkPos[kHS21OldLady].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS21TalkOldLady;
break;
@@ -1163,7 +1163,7 @@ void Scene22::run() {
_vm->playGnapImpossible(0, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS22Cashier].x, _vm->_hotspotsWalkPos[kHS22Cashier].y,
0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS22TalkCashier;
@@ -1373,7 +1373,7 @@ void Scene23::run() {
if (_vm->isFlag(kGFSceneFlag1))
_vm->playGnapImpossible(0, 0);
else {
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS23Cereals].x, _vm->_hotspotsWalkPos[kHS23Cereals].y,
0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->setFlag(kGFSceneFlag1);
@@ -1637,7 +1637,7 @@ void Scene24::run() {
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
_vm->_newSceneNum = 20;
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS24ExitOutsideGrubCity].x, _vm->_hotspotsWalkPos[kHS24ExitOutsideGrubCity].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS24LeaveScene;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS24ExitOutsideGrubCity].x + 1, _vm->_hotspotsWalkPos[kHS24ExitOutsideGrubCity].y, -1, 0x107C2, 1);
@@ -1887,7 +1887,7 @@ void Scene25::run() {
_nextTicketVendorSequenceId = (_vm->getRandom(2) == 1) ? 0x59 : 0x56;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS25TicketVendor].x, _vm->_hotspotsWalkPos[kHS25TicketVendor].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS25TalkTicketVendor;
break;
@@ -1941,11 +1941,11 @@ void Scene25::run() {
case LOOK_CURSOR:
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].x, _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot].y, -1, -1, 1);
if (_vm->_sceneClickedHotspot == 5 || _vm->_sceneClickedHotspot == 6)
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
else if (_vm->_sceneClickedHotspot == 8)
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
else
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->playGnapIdle(0, 0);
playAnims(8 - _vm->_sceneClickedHotspot + 1);
break;
@@ -2423,7 +2423,7 @@ void Scene27::run() {
case kHS27Janitor:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex == kItemPicture) {
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS27Janitor].x, _vm->_hotspotsWalkPos[kHS27Janitor].y, 0, 0x107BC, 1))
_vm->_gnapActionStatus = kAS27ShowPictureToJanitor;
} else if (_vm->_grabCursorSpriteIndex >= 0) {
@@ -2434,7 +2434,7 @@ void Scene27::run() {
_vm->playGnapScratchingHead(6, 3);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS27Janitor].x, _vm->_hotspotsWalkPos[kHS27Janitor].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS27TalkJanitor;
break;
@@ -2457,8 +2457,8 @@ void Scene27::run() {
_vm->playGnapScratchingHead(3, 3);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS27Bucket].x, _vm->_hotspotsWalkPos[kHS27Bucket].y) | 0x10000, 1);
+ _vm->_gnap->_idleFacing = kDirUpLeft;
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS27Bucket].x, _vm->_hotspotsWalkPos[kHS27Bucket].y) | 0x10000, 1);
_vm->_gnapActionStatus = kAS27GrabBucket;
break;
case TALK_CURSOR:
@@ -2623,7 +2623,7 @@ void Scene27::updateAnimations() {
_vm->_gnapActionStatus = -1;
break;
case kAS27EnterClownTent:
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, 0x107B2, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, 0x107B2, 1);
_vm->_gnapActionStatus = kAS27LeaveScene;
break;
case kAS27LeaveScene:
@@ -2803,11 +2803,11 @@ void Scene28::run() {
case GRAB_CURSOR:
if (_vm->isFlag(kGFUnk21)) {
if (!_vm->invHas(kItemHorn)) {
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS28Horn].x, _vm->_hotspotsWalkPos[kHS28Horn].y) | 0x10000, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS28Horn].x, _vm->_hotspotsWalkPos[kHS28Horn].y) | 0x10000, 1);
_vm->_gnapActionStatus = kAS28GrabHornSuccess;
}
} else {
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(2, 8, 0, 0x107BB, 1);
_vm->_hotspots[kHS28WalkArea1]._flags |= SF_WALKABLE;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS28Horn].x, _vm->_hotspotsWalkPos[kHS28Horn].y, 0, 0x107BB, 1);
@@ -2832,13 +2832,13 @@ void Scene28::run() {
else
_vm->playGnapImpossible(0, 0);
} else if (_vm->_grabCursorSpriteIndex == kItemBucketWithBeer) {
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS28Clown].x, _vm->_hotspotsWalkPos[kHS28Clown].y, 0, 0x107BC, 1);
_vm->playGnapPullOutDevice(0, 0);
_vm->playGnapUseDevice(0, 0);
_vm->_gnapActionStatus = kAS28UseBeerBucketWithClown;
} else if (_vm->_grabCursorSpriteIndex == kItemBucketWithPill) {
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS28Clown].x, _vm->_hotspotsWalkPos[kHS28Clown].y, 0, 0x107BC, 1);
_vm->playGnapPullOutDevice(0, 0);
_vm->playGnapUseDevice(0, 0);
@@ -2851,7 +2851,7 @@ void Scene28::run() {
_vm->playGnapScratchingHead(5, 2);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(5, 8, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS28TalkClown;
break;
@@ -2888,7 +2888,7 @@ void Scene28::run() {
_vm->playGnapScratchingHead(8, 6);
break;
case GRAB_CURSOR:
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS28EmptyBucket].x, _vm->_hotspotsWalkPos[kHS28EmptyBucket].y) | 0x10000, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS28EmptyBucket].x, _vm->_hotspotsWalkPos[kHS28EmptyBucket].y) | 0x10000, 1);
_vm->_gnapActionStatus = kAS28GrabEmptyBucket;
break;
case TALK_CURSOR:
@@ -3000,7 +3000,7 @@ void Scene28::updateAnimations() {
_vm->_gnapActionStatus = -1;
break;
case kAS28GrabHornFailsDone:
- gameSys.insertSequence(0x107B5, _vm->_gnapId, 281, 39, kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ gameSys.insertSequence(0x107B5, _vm->_gnapId, 281, 39, kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceId = 0x7B5;
_vm->_gnapSequenceDatNum = 1;
gameSys.insertSequence(0x11B, 39, 0, 0, kSeqNone, 0, 0, 0);
@@ -3185,7 +3185,7 @@ void Scene29::run() {
case kHS29Monkey:
if (_vm->_gnapActionStatus < 0) {
if (_vm->_grabCursorSpriteIndex == kItemBanana) {
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS29Monkey].x, _vm->_hotspotsWalkPos[kHS29Monkey].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS29UseBananaWithMonkey;
_vm->_newSceneNum = 51;
diff --git a/engines/gnap/scenes/group3.cpp b/engines/gnap/scenes/group3.cpp
index 20f798c84e..adec63a152 100644
--- a/engines/gnap/scenes/group3.cpp
+++ b/engines/gnap/scenes/group3.cpp
@@ -413,7 +413,7 @@ void Scene31::run() {
if (_vm->_gnapActionStatus < 0 || _vm->_gnapActionStatus == kAS31PlatMeasuringClown) {
if (_vm->_grabCursorSpriteIndex == kItemEmptyBucket && _beerGuyDistracted) {
_vm->setGrabCursorSprite(-1);
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, -1, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS31BeerBarrel].x, _vm->_hotspotsWalkPos[kHS31BeerBarrel].y) | 0x10000, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, -1, _vm->getGnapSequenceId(gskIdle, _vm->_hotspotsWalkPos[kHS31BeerBarrel].x, _vm->_hotspotsWalkPos[kHS31BeerBarrel].y) | 0x10000, 1);
_clerkMeasureMaxCtr += 5;
gameSys.insertSequence(0xF8, 59, 0, 0, kSeqNone, 0, 0, 0);
_vm->playGnapPullOutDevice(6, 8);
@@ -434,7 +434,7 @@ void Scene31::run() {
} else {
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS31BeerBarrel].x, _vm->_hotspotsWalkPos[kHS31BeerBarrel].y, 0, 0x107BC, 1);
_vm->_gnapActionStatus = kAS31UseBeerBarrel;
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
}
break;
case TALK_CURSOR:
@@ -544,15 +544,14 @@ void Scene31::updateAnimations() {
case kAS31FillEmptyBucketWithBeer:
gameSys.setAnimation(0x102, 59, 0);
gameSys.insertSequence(0x102, 59, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
- _vm->_gnapX = 5;
- _vm->_gnapY = 7;
+ _vm->_gnap->_pos = Common::Point(5, 7);
_vm->_gnapSequenceDatNum = 0;
_vm->_gnapSequenceId = 0x102;
_vm->_gnapId = 59;
_vm->_gnapActionStatus = kAS31FillEmptyBucketWithBeerDone;
break;
case kAS31FillEmptyBucketWithBeerDone:
- _vm->_gnapIdleFacing = kDirBottomLeft;
+ _vm->_gnap->_idleFacing = kDirBottomLeft;
_vm->playGnapPullOutDevice(0, 0);
_vm->playGnapUseDevice(0, 0);
gameSys.insertSequence(0xF9, 59, 0xF8, 59, kSeqSyncWait, 0, 0, 0);
@@ -899,14 +898,14 @@ void Scene33::run() {
} else {
switch (_vm->_verbCursor) {
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
if (_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS33Chicken].x, _vm->_hotspotsWalkPos[kHS33Chicken].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1))
_vm->_gnapActionStatus = kAS33UseChicken;
else
_vm->_gnapActionStatus = -1;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_idleFacing = kDirBottomRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS33Chicken].x, _vm->_hotspotsWalkPos[kHS33Chicken].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS33TalkChicken;
break;
@@ -924,8 +923,8 @@ void Scene33::run() {
_vm->_isLeavingScene = true;
_vm->_gnapActionStatus = kAS33LeaveScene;
_vm->_newSceneNum = 37;
- if (_vm->_gnapX > 6)
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, 0x107AD, 1);
+ if (_vm->_gnap->_pos.x > 6)
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, 0x107AD, 1);
else
_vm->gnapWalkTo(6, 7, 0, 0x107B1, 1);
}
@@ -936,8 +935,8 @@ void Scene33::run() {
_vm->_isLeavingScene = true;
_vm->_gnapActionStatus = kAS33LeaveScene;
_vm->_newSceneNum = 35;
- if (_vm->_gnapX > 7)
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, 0x107AD, 1);
+ if (_vm->_gnap->_pos.x > 7)
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, 0x107AD, 1);
else
_vm->gnapWalkTo(7, 7, 0, 0x107B1, 1);
}
@@ -1033,7 +1032,7 @@ void Scene33::updateAnimations() {
_vm->_timers[2] = 100;
break;
case kAS33UseChickenDone:
- gameSys.insertSequence(0x107B5, _vm->_gnapId, 0x81, 179, kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ gameSys.insertSequence(0x107B5, _vm->_gnapId, 0x81, 179, kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceId = 0x7B5;
_vm->_gnapSequenceDatNum = 1;
_currChickenSequenceId = 0x7E;
@@ -1324,9 +1323,8 @@ void Scene38::updateAnimations() {
gameSys.insertSequence(0xA0, _vm->_gnapId, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gnapSequenceId = 0xA0;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapX = 3;
- _vm->_gnapY = 6;
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_pos = Common::Point(3, 6);
+ _vm->_gnap->_idleFacing = kDirBottomRight;
if (_vm->_isLeavingScene) {
_vm->_sceneWaiting = false;
_vm->gnapWalkTo(5, 7, 0, 0x107BB, 1);
@@ -1339,9 +1337,8 @@ void Scene38::updateAnimations() {
gameSys.insertSequence(0x9E, _vm->_gnapId, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
_vm->_gnapSequenceId = 0x9E;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapX = 3;
- _vm->_gnapY = 6;
- _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->_gnap->_pos = Common::Point(3, 6);
+ _vm->_gnap->_idleFacing = kDirBottomRight;
gameSys.setAnimation(0x9E, _vm->_gnapId, 0);
_vm->_sceneWaiting = false;
updateHotspots();
@@ -1481,7 +1478,7 @@ void Scene39::run() {
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
_vm->_sceneDone = true;
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_gnapY, 0, 0x107AB, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos, 0, 0x107AB, 1);
_vm->_gnapActionStatus = kAS39LeaveScene;
_vm->_newSceneNum = 40;
}
diff --git a/engines/gnap/scenes/group4.cpp b/engines/gnap/scenes/group4.cpp
index b9119b72ff..008246aa9e 100644
--- a/engines/gnap/scenes/group4.cpp
+++ b/engines/gnap/scenes/group4.cpp
@@ -265,9 +265,8 @@ void Scene41::run() {
if (_vm->isFlag(kGFGnapControlsToyUFO)) {
_vm->_gnapSequenceId = 0x120;
_vm->_gnapSequenceDatNum = 0;
- _vm->_gnapIdleFacing = kDirUpRight;
- _vm->_gnapX = 7;
- _vm->_gnapY = 7;
+ _vm->_gnap->_idleFacing = kDirUpRight;
+ _vm->_gnap->_pos = Common::Point(7, 7);
_vm->_gnapId = 140;
gameSys.insertSequence(0x120, 140, 0, 0, kSeqNone, 0, 0, 0);
gameSys.setAnimation(makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, 0);
@@ -412,7 +411,7 @@ void Scene41::run() {
_vm->playGnapImpossible(0, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(4, 7, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS41TalkToyVendor;
break;
@@ -426,7 +425,7 @@ void Scene41::run() {
case kHS41Kid:
if (_vm->_grabCursorSpriteIndex == kItemChickenBucket) {
_vm->gnapWalkTo(7, 7, 0, 0x107BB, 1);
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapActionStatus = kAS41UseChickenBucketWithKid;
} else if (_vm->_grabCursorSpriteIndex >= 0) {
_vm->playGnapShowCurrItem(7, 7, 8, 0);
@@ -437,11 +436,11 @@ void Scene41::run() {
break;
case GRAB_CURSOR:
_vm->gnapWalkTo(7, 7, 0, 0x107BB, 1);
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->_gnapActionStatus = kAS41GrabKid;
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(7, 7, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
break;
case PLAT_CURSOR:
@@ -887,7 +886,7 @@ void Scene42::run() {
case kHS42ExitUfoParty:
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_hotspotsWalkPos[kHS42ExitUfoParty].y, 0, 0x107AE, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos.x, _vm->_hotspotsWalkPos[kHS42ExitUfoParty].y, 0, 0x107AE, 1);
_vm->_gnapActionStatus = kAS42LeaveScene;
_vm->platypusWalkTo(_vm->_platX, _vm->_hotspotsWalkPos[kHS42ExitUfoParty].y, -1, 0x107C7, 1);
_vm->_newSceneNum = 40;
@@ -895,7 +894,7 @@ void Scene42::run() {
case kHS42ExitToyStand:
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS42ExitToyStand].x, _vm->_gnapY, 0, 0x107AF, 1);
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS42ExitToyStand].x, _vm->_gnap->_pos.y, 0, 0x107AF, 1);
_vm->_gnapActionStatus = kAS42LeaveScene;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS42ExitToyStand].x, _vm->_hotspotsWalkPos[kHS42ExitToyStand].y, -1, 0x107CF, 1);
_vm->_newSceneNum = 41;
@@ -903,7 +902,7 @@ void Scene42::run() {
case kHS42ExitUfo:
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS42ExitUfo].x, _vm->_gnapY, 0, 0x107AB, 1);
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS42ExitUfo].x, _vm->_gnap->_pos.y, 0, 0x107AB, 1);
_vm->_gnapActionStatus = kAS42LeaveScene;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS42ExitUfo].x, _vm->_hotspotsWalkPos[kHS42ExitUfo].y, -1, 0x107CD, 1);
_vm->_newSceneNum = 43;
@@ -923,7 +922,7 @@ void Scene42::run() {
_vm->playGnapScratchingHead(_vm->_hotspotsWalkPos[kHS42BBQVendor].x - 1, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS42BBQVendor].x, _vm->_hotspotsWalkPos[kHS42BBQVendor].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = kAS42TalkBBQVendor;
break;
@@ -1066,7 +1065,7 @@ void Scene42::updateAnimations() {
gameSys.insertSequence(0x107B7, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
kSeqSyncWait, _vm->getSequenceTotalDuration(_nextBBQVendorSequenceId),
- 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->_gnapSequenceDatNum = 1;
} else {
gameSys.insertSequence(sequenceId, _vm->_gnapId,
@@ -1353,7 +1352,7 @@ void Scene43::run() {
case kHS43ExitBBQ:
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS43ExitBBQ].x, _vm->_gnapY, 0, 0x107AF, 1);
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS43ExitBBQ].x, _vm->_gnap->_pos.y, 0, 0x107AF, 1);
_vm->_gnapActionStatus = 0;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS43ExitBBQ].x, _vm->_hotspotsWalkPos[kHS43ExitBBQ].y, -1, 0x107CF, 1);
_vm->_newSceneNum = 42;
@@ -1361,7 +1360,7 @@ void Scene43::run() {
case kHS43ExitKissinBooth:
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS43ExitKissinBooth].x, _vm->_gnapY, 0, 0x107AB, 1);
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS43ExitKissinBooth].x, _vm->_gnap->_pos.y, 0, 0x107AB, 1);
_vm->_gnapActionStatus = 0;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS43ExitKissinBooth].x, _vm->_hotspotsWalkPos[kHS43ExitKissinBooth].y, -1, 0x107CD, 1);
_vm->_newSceneNum = 44;
@@ -1376,7 +1375,7 @@ void Scene43::run() {
_vm->playGnapScratchingHead(7, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(5, 8, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = 2;
break;
@@ -1398,7 +1397,7 @@ void Scene43::run() {
_vm->playGnapScratchingHead(0, 0);
break;
case GRAB_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(3, 7, 0, 67515, 1);
_vm->_gnapActionStatus = 1;
break;
@@ -1801,7 +1800,7 @@ void Scene44::run() {
case kHS44ExitUfo:
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS44ExitUfo].x, _vm->_gnapY, 0, 0x107AF, 1);
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS44ExitUfo].x, _vm->_gnap->_pos.y, 0, 0x107AF, 1);
_vm->_gnapActionStatus = 0;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS44ExitUfo].x, _vm->_platY, -1, 0x107CF, 1);
_vm->_newSceneNum = 43;
@@ -1828,14 +1827,14 @@ void Scene44::run() {
_vm->playGnapImpossible(0, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS44KissingLady].x, _vm->_hotspotsWalkPos[kHS44KissingLady].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = 1;
break;
case PLAT_CURSOR:
_vm->gnapUseDeviceOnPlatypus();
_vm->platypusWalkTo(6, 7, 1, 0x107D2, 1);
- if (_vm->_gnapX == 7 && _vm->_gnapY == 7)
+ if (_vm->_gnap->_pos == Common::Point(7, 7))
_vm->gnapWalkStep();
_vm->playGnapIdle(5, 7);
_vm->_platypusActionStatus = 4;
@@ -1882,7 +1881,7 @@ void Scene44::run() {
_vm->playGnapScratchingHead(8, 7);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS44SpringGuy].x, _vm->_hotspotsWalkPos[kHS44SpringGuy].y, -1, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
break;
case GRAB_CURSOR:
@@ -2203,7 +2202,7 @@ void Scene45::run() {
gameSys.setAnimation(0x107BD, _vm->_gnapId, 0);
gameSys.insertSequence(0x107BD, _vm->_gnapId,
makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId,
- kSeqSyncWait, 0, 75 * _vm->_gnapX - _vm->_gnapGridX, 48 * _vm->_gnapY - _vm->_gnapGridY);
+ kSeqSyncWait, 0, 75 * _vm->_gnap->_pos.x - _vm->_gnapGridX, 48 * _vm->_gnap->_pos.y - _vm->_gnapGridY);
_vm->removeFullScreenSprite();
_vm->showCursor();
_vm->_gnapSequenceId = 0x7BD;
@@ -2286,7 +2285,7 @@ void Scene45::run() {
case kHS45ExitUfoParty:
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_hotspotsWalkPos[kHS45ExitUfoParty].y, 0, 0x107AE, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos.x, _vm->_hotspotsWalkPos[kHS45ExitUfoParty].y, 0, 0x107AE, 1);
_vm->_gnapActionStatus = 0;
_vm->_newSceneNum = 40;
}
@@ -2295,7 +2294,7 @@ void Scene45::run() {
case kHS45ExitShoe:
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS45ExitShoe].x, _vm->_gnapY, 0, 0x107AF, 1);
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS45ExitShoe].x, _vm->_gnap->_pos.y, 0, 0x107AF, 1);
_vm->_gnapActionStatus = 0;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS45ExitShoe].x, _vm->_platY, -1, 0x107CF, 1);
_vm->_newSceneNum = 46;
@@ -2305,7 +2304,7 @@ void Scene45::run() {
case kHS45ExitRight:
if (_vm->_gnapActionStatus < 0) {
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS45ExitRight].x, _vm->_gnapY, 0, 0x107AB, 1);
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS45ExitRight].x, _vm->_gnap->_pos.y, 0, 0x107AB, 1);
_vm->_gnapActionStatus = 0;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS45ExitRight].x, _vm->_platY, -1, 0x107CD, 1);
_vm->_newSceneNum = 41;
@@ -2615,7 +2614,7 @@ void Scene46::run() {
_vm->playGnapMoan1(_vm->_hotspotsWalkPos[kHS46SackGuy].x + 1, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpLeft;
+ _vm->_gnap->_idleFacing = kDirUpLeft;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS46SackGuy].x, _vm->_hotspotsWalkPos[kHS46SackGuy].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = 2;
break;
@@ -2636,7 +2635,7 @@ void Scene46::run() {
_vm->playGnapMoan1(_vm->_hotspotsWalkPos[kHS46ItchyGuy].x - 1, 0);
break;
case TALK_CURSOR:
- _vm->_gnapIdleFacing = kDirUpRight;
+ _vm->_gnap->_idleFacing = kDirUpRight;
_vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS46ItchyGuy].x, _vm->_hotspotsWalkPos[kHS46ItchyGuy].y, 0, _vm->getGnapSequenceId(gskBrainPulsating, 0, 0) | 0x10000, 1);
_vm->_gnapActionStatus = 1;
break;
@@ -2650,14 +2649,14 @@ void Scene46::run() {
case kHS46ExitUfoParty:
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_gnapX, _vm->_hotspotsWalkPos[kHS46ExitUfoParty].y, 0, 0x107AE, 1);
+ _vm->gnapWalkTo(_vm->_gnap->_pos.x, _vm->_hotspotsWalkPos[kHS46ExitUfoParty].y, 0, 0x107AE, 1);
_vm->_gnapActionStatus = 0;
_vm->_newSceneNum = 40;
break;
case kHS46ExitKissinBooth:
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS46ExitKissinBooth].x, _vm->_gnapY, 0, 0x107AF, 1);
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS46ExitKissinBooth].x, _vm->_gnap->_pos.y, 0, 0x107AF, 1);
_vm->_gnapActionStatus = 0;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS46ExitKissinBooth].x, _vm->_platY, -1, 0x107CF, 1);
_vm->_newSceneNum = 44;
@@ -2665,7 +2664,7 @@ void Scene46::run() {
case kHS46ExitDisco:
_vm->_isLeavingScene = true;
- _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS46ExitDisco].x, _vm->_gnapY, 0, 0x107AB, 1);
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHS46ExitDisco].x, _vm->_gnap->_pos.y, 0, 0x107AB, 1);
_vm->_gnapActionStatus = 0;
_vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHS46ExitDisco].x, _vm->_platY, -1, 0x107CD, 1);
_vm->_newSceneNum = 45;