aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins
diff options
context:
space:
mode:
authorStrangerke2013-02-18 01:19:41 +0100
committerStrangerke2013-02-18 01:19:41 +0100
commitccf07b8956aa6865f4b8c0ff52cbb89d50e0421f (patch)
treed8a187f81d2a2ee703ccdf03d8d14143e6a9662e /engines/hopkins
parent979328ebdb1195fc7263c5ebea0e65531a472243 (diff)
downloadscummvm-rg350-ccf07b8956aa6865f4b8c0ff52cbb89d50e0421f.tar.gz
scummvm-rg350-ccf07b8956aa6865f4b8c0ff52cbb89d50e0421f.tar.bz2
scummvm-rg350-ccf07b8956aa6865f4b8c0ff52cbb89d50e0421f.zip
HOPKINS: More Direction refactoring
Diffstat (limited to 'engines/hopkins')
-rw-r--r--engines/hopkins/globals.cpp5
-rw-r--r--engines/hopkins/globals.h2
-rw-r--r--engines/hopkins/hopkins.cpp92
-rw-r--r--engines/hopkins/hopkins.h2
-rw-r--r--engines/hopkins/lines.cpp236
-rw-r--r--engines/hopkins/lines.h10
-rw-r--r--engines/hopkins/objects.cpp14
-rw-r--r--engines/hopkins/script.cpp144
8 files changed, 256 insertions, 249 deletions
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index dbd23709e6..ac903ddd00 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -130,8 +130,7 @@ Globals::Globals() {
PERSO_TYPE = 0;
GOACTION = false;
Compteur = 0;
- _actionDirection = 0;
- _actionDirection = 0;
+ _actionDirection = DIR_NONE;
Credit_bx = -1;
Credit_bx1 = -1;
@@ -142,7 +141,7 @@ Globals::Globals() {
memset(_creditsItem, 0, 12000);
_creditsStep = 0;
- _oceanDirection = 0;
+ _oceanDirection = DIR_NONE;
// Initialize pointers
BUF_ZONE = NULL;
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h
index f49d9180f1..bfd5d01307 100644
--- a/engines/hopkins/globals.h
+++ b/engines/hopkins/globals.h
@@ -251,7 +251,7 @@ public:
bool _cacheFl;
bool _forceHideText;
int _exitId;
- int _oceanDirection;
+ Directions _oceanDirection;
Directions _oldDirection;
int _oldDirectionSpriteIdx;
int _actionDirection;
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index ab3fe1fc56..ece6271442 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -1285,55 +1285,55 @@ bool HopkinsEngine::runFull() {
break;
case 77:
- OCEAN(77, "OCEAN01", 3, 0, 84, 0, 0, 25);
+ OCEAN(77, "OCEAN01", DIR_RIGHT, 0, 84, 0, 0, 25);
break;
case 78:
- OCEAN(78, "OCEAN02", 1, 0, 91, 84, 0, 25);
+ OCEAN(78, "OCEAN02", DIR_UP, 0, 91, 84, 0, 25);
break;
case 79:
- OCEAN(79, "OCEAN03", 7, 87, 0, 0, 83, 25);
+ OCEAN(79, "OCEAN03", DIR_LEFT, 87, 0, 0, 83, 25);
break;
case 80:
- OCEAN(80, "OCEAN04", 1, 86, 88, 0, 81, 25);
+ OCEAN(80, "OCEAN04", DIR_UP, 86, 88, 0, 81, 25);
break;
case 81:
- OCEAN(81, "OCEAN05", 1, 91, 82, 80, 85, 25);
+ OCEAN(81, "OCEAN05", DIR_UP, 91, 82, 80, 85, 25);
break;
case 82:
- OCEAN(82, "OCEAN06", 7, 81, 0, 88, 0, 25);
+ OCEAN(82, "OCEAN06", DIR_LEFT, 81, 0, 88, 0, 25);
break;
case 83:
- OCEAN(83, "OCEAN07", 1, 89, 0, 79, 88, 25);
+ OCEAN(83, "OCEAN07", DIR_UP, 89, 0, 79, 88, 25);
break;
case 84:
- OCEAN(84, "OCEAN08", 1, 77, 0, 0, 78, 25);
+ OCEAN(84, "OCEAN08", DIR_UP, 77, 0, 0, 78, 25);
break;
case 85:
- OCEAN(85, "OCEAN09", 1, 0, 0, 81, 0, 25);
+ OCEAN(85, "OCEAN09", DIR_UP, 0, 0, 81, 0, 25);
break;
case 86:
- OCEAN(86, "OCEAN10", 1, 0, 80, 0, 91, 25);
+ OCEAN(86, "OCEAN10", DIR_UP, 0, 80, 0, 91, 25);
break;
case 87:
- OCEAN(87, "OCEAN11", 3, 0, 79, 90, 0, 25);
+ OCEAN(87, "OCEAN11", DIR_RIGHT, 0, 79, 90, 0, 25);
break;
case 88:
- OCEAN(88, "OCEAN12", 1, 80, 0, 83, 82, 25);
+ OCEAN(88, "OCEAN12", DIR_UP, 80, 0, 83, 82, 25);
break;
case 89:
- OCEAN(89, "OCEAN13", 3, 0, 83, 0, 0, 25);
+ OCEAN(89, "OCEAN13", DIR_RIGHT, 0, 83, 0, 0, 25);
break;
case 90:
@@ -1341,7 +1341,7 @@ bool HopkinsEngine::runFull() {
break;
case 91:
- OCEAN(91, "OCEAN15", 3, 78, 81, 86, 0, 25);
+ OCEAN(91, "OCEAN15", DIR_RIGHT, 78, 81, 86, 0, 25);
break;
case 93:
@@ -2540,18 +2540,18 @@ void HopkinsEngine::BTOCEAN() {
switch (_objectsManager._zoneNum) {
case 1:
switch (_globals._oceanDirection) {
- case 1:
- _objectsManager.SPACTION(_globals.PERSO, "27,26,25,24,23,22,21,20,19,18,-1,", 0, 0, 6, false);
- break;
- case 3:
+ case DIR_UP:
+ _objectsManager.SPACTION(_globals.PERSO, "27,26,25,24,23,22,21,20,19,18,-1,", 0, 0, 6, false);
+ break;
+ case DIR_RIGHT:
_objectsManager.SPACTION(_globals.PERSO, "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,-1,", 0, 0, 6, false);
break;
- case 5:
+ case DIR_DOWN:
_objectsManager.SPACTION(_globals.PERSO, "9,10,11,12,13,14,15,16,17,18,-1,", 0, 0, 6, false);
break;
}
- _globals._oceanDirection = 7;
+ _globals._oceanDirection = DIR_LEFT;
_globals._exitId = 1;
oldX = _objectsManager.getSpriteX(0);
for (;;) {
@@ -2575,17 +2575,17 @@ void HopkinsEngine::BTOCEAN() {
break;
case 2:
switch (_globals._oceanDirection) {
- case 1:
+ case DIR_UP:
_objectsManager.SPACTION(_globals.PERSO, "27,28,29,30,31,32,33,34,35,36,-1,", 0, 0, 6, false);
break;
- case 5:
+ case DIR_DOWN:
_objectsManager.SPACTION(_globals.PERSO, "9,8,7,6,5,4,3,2,1,0,-1,", 0, 0, 6, false);
break;
- case 7:
+ case DIR_LEFT:
_objectsManager.SPACTION(_globals.PERSO, "18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,-1,", 0, 0, 6, false);
break;
}
- _globals._oceanDirection = 3;
+ _globals._oceanDirection = DIR_RIGHT;
_globals._exitId = 2;
oldX = _objectsManager.getSpriteX(0);
for (;;) {
@@ -2608,7 +2608,7 @@ void HopkinsEngine::BTOCEAN() {
break;
case 3:
switch (_globals._oceanDirection) {
- case 3:
+ case DIR_RIGHT:
oldX = _objectsManager.getSpriteX(0);
do {
if (_globals._speed == 1)
@@ -2628,10 +2628,10 @@ void HopkinsEngine::BTOCEAN() {
if (!displAnim)
_objectsManager.SPACTION(_globals.PERSO, "36,35,34,33,32,31,30,29,28,27,-1,", 0, 0, 6, false);
break;
- case 5:
+ case DIR_DOWN:
_objectsManager.SPACTION(_globals.PERSO, "9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,", 0, 0, 6, false);
break;
- case 7:
+ case DIR_LEFT:
oldX = _objectsManager.getSpriteX(0);
do {
if (_globals._speed == 1)
@@ -2652,15 +2652,15 @@ void HopkinsEngine::BTOCEAN() {
_objectsManager.SPACTION(_globals.PERSO, "18,19,20,21,22,23,24,25,26,27,-1,", 0, 0, 6, false);
break;
}
- _globals._oceanDirection = 1;
+ _globals._oceanDirection = DIR_UP;
_globals._exitId = 3;
break;
case 4:
switch (_globals._oceanDirection) {
- case 1:
+ case DIR_UP:
_objectsManager.SPACTION(_globals.PERSO, "27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,-1,", 0, 0, 6, false);
break;
- case 3:
+ case DIR_RIGHT:
oldX = _objectsManager.getSpriteX(0);
do {
if (_globals._speed == 1)
@@ -2680,7 +2680,7 @@ void HopkinsEngine::BTOCEAN() {
if (!displAnim)
_objectsManager.SPACTION(_globals.PERSO, "0,1,2,3,4,5,6,7,8,9,-1,", 0, 0, 6, false);
break;
- case 7:
+ case DIR_LEFT:
oldX = _objectsManager.getSpriteX(0);
for (;;) {
if (_globals._speed == 1)
@@ -2703,24 +2703,30 @@ void HopkinsEngine::BTOCEAN() {
}
break;
}
- _globals._oceanDirection = 5;
+ _globals._oceanDirection = DIR_DOWN;
_globals._exitId = 4;
break;
}
}
void HopkinsEngine::OCEAN_HOME() {
- if (_globals._oceanDirection == 3)
- _objectsManager.setSpriteIndex(0, 0);
- else if (_globals._oceanDirection == 7)
- _objectsManager.setSpriteIndex(0, 18);
- else if (_globals._oceanDirection == 1)
+ switch (_globals._oceanDirection) {
+ case DIR_UP:
_objectsManager.setSpriteIndex(0, 27);
- else if (_globals._oceanDirection == 5)
+ break;
+ case DIR_RIGHT:
+ _objectsManager.setSpriteIndex(0, 0);
+ break;
+ case DIR_DOWN:
_objectsManager.setSpriteIndex(0, 9);
+ break;
+ case DIR_LEFT:
+ _objectsManager.setSpriteIndex(0, 18);
+ break;
+ }
}
-void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, int16 defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId) {
+void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, Directions defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId) {
_globals._cityMapEnabledFl = false;
_graphicsManager._noFadingFl = false;
_globals.NOMARCHE = false;
@@ -2753,19 +2759,19 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in
_globals._oceanDirection = defaultDirection;
switch (_globals._oceanDirection) {
- case 1:
+ case DIR_UP:
_objectsManager._characterPos.x = 236;
_objectsManager._startSpriteIndex = 27;
break;
- case 3:
+ case DIR_RIGHT:
_objectsManager._characterPos.x = -20;
_objectsManager._startSpriteIndex = 0;
break;
- case 5:
+ case DIR_DOWN:
_objectsManager._characterPos.x = 236;
_objectsManager._startSpriteIndex = 9;
break;
- case 7:
+ case DIR_LEFT:
_objectsManager._characterPos.x = 415;
_objectsManager._startSpriteIndex = 18;
break;
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index d3e735df10..fe14b23a9a 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -120,7 +120,7 @@ private:
void BTOCEAN();
void OCEAN_HOME();
- void OCEAN(int16 curExitId, Common::String backgroundFilename, int16 defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId);
+ void OCEAN(int16 curExitId, Common::String backgroundFilename, Directions defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId);
void loadCredits();
void displayCredits(int startPosY, byte *buffer, char colour);
void displayCredits();
diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp
index 4e57a1ee4c..c4441e0da7 100644
--- a/engines/hopkins/lines.cpp
+++ b/engines/hopkins/lines.cpp
@@ -61,7 +61,7 @@ LinesManager::LinesManager() {
NV_POSI = 0;
NVPX = 0;
NVPY = 0;
- _smoothMoveDirection = 0;
+ _smoothMoveDirection = DIR_NONE;
_lastLine = 0;
_maxLineIdx = 0;
_pathFindingMaxDepth = 0;
@@ -92,7 +92,7 @@ void LinesManager::loadLines(const Common::String &file) {
byte *ptr = _vm->_fileManager.loadFile(file);
for (int idx = 0; (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5)) != -1; idx++) {
addLine(idx,
- (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5)),
+ (Directions)(int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5)),
(int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 1),
(int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 2),
(int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 3),
@@ -218,7 +218,7 @@ void LinesManager::addZoneLine(int idx, int a2, int a3, int a4, int a5, int bobZ
/**
* Add Line
*/
-void LinesManager::addLine(int idx, int direction, int a3, int a4, int a5, int a6) {
+void LinesManager::addLine(int idx, Directions direction, int a3, int a4, int a5, int a6) {
assert (idx <= MAX_LINES);
if (_linesNumb < idx)
@@ -249,59 +249,59 @@ void LinesManager::addLine(int idx, int direction, int a3, int a4, int a5, int a
int v12 = (int)v37 / 1000;
if (!v11) {
if (v12 == -1) {
- Ligne[idx].field6 = 1;
+ Ligne[idx].field6 = DIR_UP;
Ligne[idx].field8 = 5;
}
if (v12 == 1) {
- Ligne[idx].field6 = 5;
+ Ligne[idx].field6 = DIR_DOWN;
Ligne[idx].field8 = 1;
}
}
if (v11 == 1) {
if (v12 == -1) {
- Ligne[idx].field6 = 2;
+ Ligne[idx].field6 = DIR_UP_RIGHT;
Ligne[idx].field8 = 6;
}
if (!v12) {
- Ligne[idx].field6 = 3;
+ Ligne[idx].field6 = DIR_RIGHT;
Ligne[idx].field8 = 7;
}
if (v12 == 1) {
- Ligne[idx].field6 = 4;
+ Ligne[idx].field6 = DIR_DOWN_RIGHT;
Ligne[idx].field8 = 8;
}
}
if (v11 == -1) {
if (v12 == 1) {
- Ligne[idx].field6 = 6;
+ Ligne[idx].field6 = DIR_DOWN_LEFT;
Ligne[idx].field8 = 2;
}
if (!v12) {
- Ligne[idx].field6 = 7;
+ Ligne[idx].field6 = DIR_LEFT;
Ligne[idx].field8 = 3;
}
if (v12 == -1) {
- Ligne[idx].field6 = 8;
+ Ligne[idx].field6 = DIR_UP_LEFT;
Ligne[idx].field8 = 4;
}
}
if (v11 == 1 && v37 > 250 && v37 <= 999) {
- Ligne[idx].field6 = 4;
+ Ligne[idx].field6 = DIR_DOWN_RIGHT;
Ligne[idx].field8 = 8;
}
if (v11 == -1 && v37 > 250 && v37 <= 999) {
- Ligne[idx].field6 = 6;
+ Ligne[idx].field6 = DIR_DOWN_LEFT;
Ligne[idx].field8 = 2;
}
if (v11 == 1 && v37 < -250 && v37 > -1000) {
- Ligne[idx].field6 = 2;
+ Ligne[idx].field6 = DIR_UP_RIGHT;
Ligne[idx].field8 = 6;
}
// This condition is impossible to meet!
// Code present in the Linux and BeOS executables
// CHECKME: maybe it should be checking negative values?
if (v11 == -1 && v37 <= 249 && v37 > 1000) {
- Ligne[idx].field6 = 8;
+ Ligne[idx].field6 = DIR_UP_LEFT;
Ligne[idx].field8 = 4;
}
int v40 = v36 / v34;
@@ -589,31 +589,31 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
int v51;
if (checkCollisionLine(fromX, fromY, &v51, &v50, 0, _linesNumb)) {
switch (Ligne[v50]._direction) {
- case 1:
+ case DIR_UP:
curY -= 2;
break;
- case 2:
+ case DIR_UP_RIGHT:
curY -= 2;
curX += 2;
break;
- case 3:
+ case DIR_RIGHT:
curX += 2;
break;
- case 4:
+ case DIR_DOWN_RIGHT:
curY += 2;
curX += 2;
break;
- case 5:
+ case DIR_DOWN:
curY += 2;
break;
- case 6:
+ case DIR_DOWN_LEFT:
curY += 2;
curX -= 2;
break;
- case 7:
+ case DIR_LEFT:
curX -= 2;
break;
- case 8:
+ case DIR_UP_LEFT:
curY -= 2;
curX -= 2;
break;
@@ -700,16 +700,16 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
v42 = -1;
}
if (v46 != -1 || v44 != -1 || v48 != -1 || v42 != -1) {
- int v21 = 0;
+ Directions newDir = DIR_NONE;
if (a4 > v50) {
if (v48 <= v46 && v44 <= v46 && v42 <= v46 && v46 > v50)
- v21 = 1;
+ newDir = DIR_UP;
if (v48 <= v44 && v46 <= v44 && v42 <= v44 && v50 < v44)
- v21 = 3;
+ newDir = DIR_RIGHT;
if (v46 <= v48 && v44 <= v48 && v42 <= v48 && v50 < v48)
- v21 = 5;
+ newDir = DIR_DOWN;
if (v48 <= v42 && v44 <= v42 && v46 <= v42 && v50 < v42)
- v21 = 7;
+ newDir = DIR_LEFT;
} else if (a4 < v50) {
if (v46 == -1)
v46 = 1300;
@@ -720,17 +720,17 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
if (v42 == -1)
v42 = 1300;
if (v46 != 1300 && v48 >= v46 && v44 >= v46 && v42 >= v46 && v46 < v50)
- v21 = 1;
+ newDir = DIR_UP;
if (v44 != 1300 && v48 >= v44 && v46 >= v44 && v42 >= v44 && v50 > v44)
- v21 = 3;
+ newDir = DIR_RIGHT;
if (v48 != 1300 && v46 >= v48 && v44 >= v48 && v42 >= v48 && v50 > v48)
- v21 = 5;
+ newDir = DIR_DOWN;
if (v42 != 1300 && v48 >= v42 && v44 >= v42 && v46 >= v42 && v50 > v42)
- v21 = 7;
+ newDir = DIR_LEFT;
}
- switch(v21) {
- case 1:
+ switch(newDir) {
+ case DIR_UP:
v36 = v46;
v35 = v47;
for (int v22 = 0; v22 < v39; v22++) {
@@ -744,7 +744,7 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
}
super_parcours[v7] = v41;
super_parcours[v7 + 1] = v40 - v22;
- super_parcours[v7 + 2] = 1;
+ super_parcours[v7 + 2] = DIR_UP;
super_parcours[v7 + 3] = 0;
v7 += 4;
}
@@ -753,7 +753,7 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
NV_POSI = v7;
return true;
break;
- case 3:
+ case DIR_RIGHT:
v36 = v44;
v35 = v45;
for (int v31 = 0; v31 < v38; v31++) {
@@ -767,7 +767,7 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
}
super_parcours[v7] = v31 + v41;
super_parcours[v7 + 1] = v40;
- super_parcours[v7 + 2] = 3;
+ super_parcours[v7 + 2] = DIR_RIGHT;
super_parcours[v7 + 3] = 0;
v7 += 4;
}
@@ -776,7 +776,7 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
NV_POSI = v7;
return true;
break;
- case 5:
+ case DIR_DOWN:
v36 = v48;
v35 = v49;
for (int v25 = 0; v25 < v37; v25++) {
@@ -790,7 +790,7 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
}
super_parcours[v7] = v41;
super_parcours[v7 + 1] = v25 + v40;
- super_parcours[v7 + 2] = 5;
+ super_parcours[v7 + 2] = DIR_DOWN;
super_parcours[v7 + 3] = 0;
v7 += 4;
}
@@ -799,7 +799,7 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
NV_POSI = v7;
return true;
break;
- case 7:
+ case DIR_LEFT:
v36 = v42;
v35 = v43;
for (int v28 = 0; v28 < v18; v28++) {
@@ -813,7 +813,7 @@ bool LinesManager::MIRACLE(int fromX, int fromY, int a3, int a4, int a5) {
}
super_parcours[v7] = v41 - v28;
super_parcours[v7 + 1] = v40;
- super_parcours[v7 + 2] = 7;
+ super_parcours[v7 + 2] = DIR_LEFT;
super_parcours[v7 + 3] = 0;
v7 += 4;
}
@@ -1104,31 +1104,31 @@ int LinesManager::GENIAL(int lineIdx, int dataIdx, int a3, int a4, int a5, int a
break;
switch (Ligne[foundLineIdx]._direction) {
- case 1:
+ case DIR_UP:
--NVPY;
break;
- case 2:
+ case DIR_UP_RIGHT:
--NVPY;
++NVPX;
break;
- case 3:
+ case DIR_RIGHT:
++NVPX;
break;
- case 4:
+ case DIR_DOWN_RIGHT:
++NVPY;
++NVPX;
break;
- case 5:
+ case DIR_DOWN:
++NVPY;
break;
- case 6:
+ case DIR_DOWN_LEFT:
++NVPY;
--NVPX;
break;
- case 7:
+ case DIR_LEFT:
--NVPX;
break;
- case 8:
+ case DIR_UP_LEFT:
--NVPY;
--NVPX;
break;
@@ -1158,7 +1158,7 @@ int16 *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) {
int v120 = 0;
int v115 = 0;
int v114 = 0;
- int v113 = 0;
+ Directions newDir = DIR_NONE;
int v111 = 0;
if (destY <= 24)
clipDestY = 25;
@@ -1356,22 +1356,22 @@ int16 *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) {
if (v141[1] != -1 && v126[3] >= v126[1] && v126[5] >= v126[1] && v126[7] >= v126[1]) {
v115 = v141[1];
v111 = v131[1];
- v113 = 1;
+ newDir = DIR_UP;
v114 = v136[1];
} else if (v141[5] != -1 && v126[3] >= v126[5] && v126[1] >= v126[5] && v126[7] >= v126[5]) {
v115 = v141[5];
v111 = v131[5];
- v113 = 5;
+ newDir = DIR_DOWN;
v114 = v136[5];
} else if (v141[3] != -1 && v126[1] >= v126[3] && v126[5] >= v126[3] && v126[7] >= v126[3]) {
v115 = v141[3];
v111 = v131[3];
- v113 = 3;
+ newDir = DIR_RIGHT;
v114 = v136[3];
} else if (v141[7] != -1 && v126[1] >= v126[7] && v126[5] >= v126[7] && v126[3] >= v126[7]) {
v115 = v141[7];
v111 = v131[7];
- v113 = 7;
+ newDir = DIR_LEFT;
v114 = v136[7];
}
@@ -1385,14 +1385,14 @@ int16 *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) {
v114 = NV_LIGNEOFS;
v112 = NV_POSI;
} else {
- if (v113 == 1) {
+ if (newDir == DIR_UP) {
for (int deltaY = 0; deltaY < v111; deltaY++) {
if (checkCollisionLine(fromX, fromY - deltaY, &foundDataIdx, &foundLineIdx, _lastLine + 1, _linesNumb) && _lastLine < foundLineIdx) {
int v58 = GENIAL(foundLineIdx, foundDataIdx, fromX, fromY - deltaY, fromX, fromY - v111, v112, &super_parcours[0], 4);
if (v58 == -1) {
super_parcours[v112] = -1;
super_parcours[v112 + 1] = -1;
- super_parcours[v112 + 2] = -1;
+ super_parcours[v112 + 2] = DIR_NONE;
super_parcours[v112 + 3] = -1;
return &super_parcours[0];
}
@@ -1402,12 +1402,12 @@ int16 *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) {
}
super_parcours[v112] = fromX;
super_parcours[v112 + 1] = fromY - deltaY;
- super_parcours[v112 + 2] = 1;
+ super_parcours[v112 + 2] = DIR_UP;
super_parcours[v112 + 3] = 0;
v112 += 4;
}
}
- if (v113 == 5) {
+ if (newDir == DIR_DOWN) {
for (int deltaY = 0; deltaY < v111; deltaY++) {
if (checkCollisionLine(fromX, deltaY + fromY, &foundDataIdx, &foundLineIdx, _lastLine + 1, _linesNumb)
&& _lastLine < foundLineIdx) {
@@ -1415,7 +1415,7 @@ int16 *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) {
if (v61 == -1) {
super_parcours[v112] = -1;
super_parcours[v112 + 1] = -1;
- super_parcours[v112 + 2] = -1;
+ super_parcours[v112 + 2] = DIR_NONE;
super_parcours[v112 + 3] = -1;
return &super_parcours[0];
}
@@ -1425,19 +1425,19 @@ int16 *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) {
}
super_parcours[v112] = fromX;
super_parcours[v112 + 1] = deltaY + fromY;
- super_parcours[v112 + 2] = 5;
+ super_parcours[v112 + 2] = DIR_DOWN;
super_parcours[v112 + 3] = 0;
v112 += 4;
}
}
- if (v113 == 7) {
+ if (newDir == DIR_LEFT) {
for (int deltaX = 0; deltaX < v111; deltaX++) {
if (checkCollisionLine(fromX - deltaX, fromY, &foundDataIdx, &foundLineIdx, _lastLine + 1, _linesNumb) && _lastLine < foundLineIdx) {
int v64 = GENIAL(foundLineIdx, foundDataIdx, fromX - deltaX, fromY, fromX - v111, fromY, v112, &super_parcours[0], 4);
if (v64 == -1) {
super_parcours[v112] = -1;
super_parcours[v112 + 1] = -1;
- super_parcours[v112 + 2] = -1;
+ super_parcours[v112 + 2] = DIR_NONE;
super_parcours[v112 + 3] = -1;
return &super_parcours[0];
}
@@ -1447,19 +1447,19 @@ int16 *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) {
}
super_parcours[v112] = fromX - deltaX;
super_parcours[v112 + 1] = fromY;
- super_parcours[v112 + 2] = 7;
+ super_parcours[v112 + 2] = DIR_LEFT;
super_parcours[v112 + 3] = 0;
v112 += 4;
}
}
- if (v113 == 3) {
+ if (newDir == DIR_RIGHT) {
for (int deltaX = 0; deltaX < v111; deltaX++) {
if (checkCollisionLine(deltaX + fromX, fromY, &foundDataIdx, &foundLineIdx, _lastLine + 1, _linesNumb) && _lastLine < foundLineIdx) {
int v67 = GENIAL(foundLineIdx, foundDataIdx, deltaX + fromX, fromY, v111 + fromX, fromY, v112, &super_parcours[0], 4);
if (v67 == -1) {
super_parcours[v112] = -1;
super_parcours[v112 + 1] = -1;
- super_parcours[v112 + 2] = -1;
+ super_parcours[v112 + 2] = DIR_NONE;
super_parcours[v112 + 3] = -1;
return &super_parcours[0];
}
@@ -1469,7 +1469,7 @@ int16 *LinesManager::PARCOURS2(int fromX, int fromY, int destX, int destY) {
}
super_parcours[v112] = deltaX + fromX;
super_parcours[v112 + 1] = fromY;
- super_parcours[v112 + 2] = 3;
+ super_parcours[v112 + 2] = DIR_RIGHT;
super_parcours[v112 + 3] = 0;
v112 += 4;
}
@@ -1637,7 +1637,7 @@ int LinesManager::PARC_PERS(int fromX, int fromY, int destX, int destY, int a5,
int v55;
int v58;
int v66;
- int newDirection;
+ Directions newDirection;
int v92;
int v93;
int v94;
@@ -1689,30 +1689,30 @@ int LinesManager::PARC_PERS(int fromX, int fromY, int destX, int destY, int a5,
int foundLineIdx = a5;
if (checkCollisionLine(fromX, fromY, &foundDataIdx, &foundLineIdx, 0, _linesNumb)) {
switch (Ligne[foundLineIdx]._direction) {
- case 1:
+ case DIR_UP:
curY -= 2;
break;
- case 2:
+ case DIR_UP_RIGHT:
curY -= 2;
curX += 2;
break;
- case 3:
+ case DIR_RIGHT:
curX += 2;
break;
- case 4:
+ case DIR_DOWN_RIGHT:
curY += 2;
curX += 2;
- case 5:
+ case DIR_DOWN:
curY += 2;
break;
- case 6:
+ case DIR_DOWN_LEFT:
curY += 2;
curX -= 2;
break;
- case 7:
+ case DIR_LEFT:
curX -= 2;
break;
- case 8:
+ case DIR_UP_LEFT:
curY -= 2;
curX -= 2;
break;
@@ -1772,19 +1772,19 @@ LABEL_150:
v99 = -v99;
v13 = (int16)v101 / 1000;
v94 = (int16)v99 / 1000;
- newDirection = -1;
+ newDirection = DIR_NONE;
if (v94 == -1 && (v101 >= 0 && v101 <= 150))
- newDirection = 1;
+ newDirection = DIR_UP;
if (v13 == 1 && (v99 >= -1 && v99 <= 150))
- newDirection = 3;
+ newDirection = DIR_RIGHT;
if (v94 == 1 && (v101 >= -150 && v101 <= 150))
- newDirection = 5;
+ newDirection = DIR_DOWN;
if (v13 == -1 && (v99 >= -150 && v99 <= 150))
- newDirection = 7;
+ newDirection = DIR_LEFT;
if (v94 == -1 && (v101 >= -150 && v101 <= 0))
- newDirection = 1;
+ newDirection = DIR_UP;
- if (newDirection == -1 && !checkSmoothMove(curX, v109, destX, destY) && !makeSmoothMove(curX, v109, destX, destY))
+ if (newDirection == DIR_NONE && !checkSmoothMove(curX, v109, destX, destY) && !makeSmoothMove(curX, v109, destX, destY))
break;
LABEL_72:
v19 = abs(v111 - destX);
@@ -1809,72 +1809,72 @@ LABEL_72:
v104 = 1000 * v111 / 1000;
v103 = v105 / 1000;
if (!(v102 / 1000) && v96 == -1)
- newDirection = 1;
+ newDirection = DIR_UP;
if (v22 == 1) {
if (v96 == -1)
- newDirection = 2;
+ newDirection = DIR_UP_RIGHT;
if (!v96)
- newDirection = 3;
+ newDirection = DIR_RIGHT;
if (v96 == 1)
- newDirection = 4;
+ newDirection = DIR_DOWN_RIGHT;
}
if (!v22 && v96 == 1)
- newDirection = 5;
+ newDirection = DIR_DOWN;
if ((v22 != -1) && (v96 == -1)) {
if (v102 >= 0 && v102 < 510)
- newDirection = 1;
+ newDirection = DIR_UP;
else if (v102 >= 510 && v102 <= 1000)
- newDirection = 2;
+ newDirection = DIR_UP_RIGHT;
} else {
if (v96 == 1)
- newDirection = 6;
+ newDirection = DIR_DOWN_LEFT;
else if (!v96)
- newDirection = 7;
+ newDirection = DIR_LEFT;
else if (v96 == -1) {
if (v102 >= 0 && v102 < 510)
- newDirection = 1;
+ newDirection = DIR_UP;
else if (v102 >= 510 && v102 <= 1000)
- newDirection = 2;
+ newDirection = DIR_UP_RIGHT;
else
- newDirection = 8;
+ newDirection = DIR_UP_LEFT;
}
}
if (v22 == 1) {
if (v100 >= -1 && v100 <= 510)
- newDirection = 2;
+ newDirection = DIR_UP_RIGHT;
if (v100 >= -510 && v100 <= 0)
- newDirection = 3;
+ newDirection = DIR_RIGHT;
if (v100 >= 0 && v100 <= 510)
- newDirection = 3;
+ newDirection = DIR_RIGHT;
if (v100 >= 510 && v100 <= 1000)
- newDirection = 4;
+ newDirection = DIR_DOWN_RIGHT;
}
if (v96 == 1) {
if (v102 >= 510 && v102 <= 1000)
- newDirection = 4;
+ newDirection = DIR_DOWN_RIGHT;
if (v102 >= 0 && v102 <= 510)
- newDirection = 5;
+ newDirection = DIR_DOWN;
// CHECKME: The two conditions on v102 are not compatible!
if (v102 >= -1 && v102 <= -510)
- newDirection = 6;
+ newDirection = DIR_DOWN_LEFT;
if (v102 >= -510 && v102 <= 0)
- newDirection = 5;
+ newDirection = DIR_DOWN;
}
if (v22 == -1) {
if (v100 >= 510 && v100 <= 1000)
- newDirection = 6;
+ newDirection = DIR_DOWN_LEFT;
if (v100 >= 0 && v100 <= 510)
- newDirection = 7;
+ newDirection = DIR_LEFT;
if (v100 >= -1000 && v100 <= -510)
- newDirection = 8;
+ newDirection = DIR_UP_LEFT;
if (v100 >= -510 && v100 <= 0)
- newDirection = 7;
+ newDirection = DIR_LEFT;
}
if (v96 == -1) {
if (v102 >= -1000 && v102 <= -510)
- newDirection = 8;
+ newDirection = DIR_UP_LEFT;
if (v102 >= -510 && v102 <= 0)
- newDirection = 1;
+ newDirection = DIR_UP;
}
v23 = 0;
if (v108 + 1 <= 0)
@@ -2610,7 +2610,7 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) {
if (stepCount > 5) {
_smoothRoute[smoothIdx]._posX = -1;
_smoothRoute[smoothIdx]._posY = -1;
- _smoothMoveDirection = 6;
+ _smoothMoveDirection = DIR_DOWN_LEFT;
return false;
}
} else if (fromX < destX && destY > fromY) {
@@ -2644,7 +2644,7 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) {
if (stepCount > 5) {
_smoothRoute[smoothIdx]._posX = -1;
_smoothRoute[smoothIdx]._posY = -1;
- _smoothMoveDirection = 4;
+ _smoothMoveDirection = DIR_DOWN_RIGHT;
return false;
}
} else if (fromX > destX && destY < fromY) {
@@ -2671,7 +2671,7 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) {
if (stepCount > 5) {
_smoothRoute[smoothIdx]._posX = -1;
_smoothRoute[smoothIdx]._posY = -1;
- _smoothMoveDirection = 8;
+ _smoothMoveDirection = DIR_UP_LEFT;
return false;
}
} else if (fromX < destX && destY < fromY) {
@@ -2699,7 +2699,7 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) {
if (stepCount > 5) {
_smoothRoute[smoothIdx]._posX = -1;
_smoothRoute[smoothIdx]._posY = -1;
- _smoothMoveDirection = 2;
+ _smoothMoveDirection = DIR_UP_RIGHT;
return false;
}
}
@@ -2830,9 +2830,9 @@ int LinesManager::TEST_LIGNE(int paramX, int paramY, int *a3, int *foundLineIdx,
*a3 = 1;
int posX = lineData[2 * (lineDataEndIdx - 1)];
int posY = lineData[2 * (lineDataEndIdx - 1) + 1];
- if (Ligne[idx].field6 == 5 || Ligne[idx].field6 == 1)
+ if (Ligne[idx].field6 == DIR_DOWN || Ligne[idx].field6 == DIR_UP)
posY += 2;
- if (Ligne[idx].field6 == 3 || Ligne[idx].field8 == 7)
+ if (Ligne[idx].field6 == DIR_RIGHT || Ligne[idx].field8 == 7)
posX += 2;
if (!checkCollisionLine(posX, posY, &collDataIdx, &collLineIdx, 0, _lastLine))
error("Error in test line");
@@ -2844,9 +2844,9 @@ int LinesManager::TEST_LIGNE(int paramX, int paramY, int *a3, int *foundLineIdx,
*a3 = 2;
int posX = lineData[0];
int posY = lineData[1];
- if (Ligne[idx].field6 == 5 || Ligne[idx].field6 == 1)
+ if (Ligne[idx].field6 == DIR_DOWN || Ligne[idx].field6 == DIR_UP)
posY -= 2;
- if (Ligne[idx].field6 == 3 || Ligne[idx].field8 == 7)
+ if (Ligne[idx].field6 == DIR_RIGHT || Ligne[idx].field8 == 7)
posX -= 2;
if (!checkCollisionLine(posX, posY, &collDataIdx, &collLineIdx, 0, _lastLine))
error("Error in test line");
@@ -3134,8 +3134,8 @@ void LinesManager::clearAll() {
for (int idx = 0; idx < MAX_LINES; ++idx) {
Ligne[idx]._lineDataEndIdx = 0;
- Ligne[idx]._direction = 0;
- Ligne[idx].field6 = 0;
+ Ligne[idx]._direction = DIR_NONE;
+ Ligne[idx].field6 = DIR_NONE;
Ligne[idx].field8 = 0;
Ligne[idx]._lineData = (int16 *)g_PTRNUL;
diff --git a/engines/hopkins/lines.h b/engines/hopkins/lines.h
index 3d064a56ca..8f02a9cb60 100644
--- a/engines/hopkins/lines.h
+++ b/engines/hopkins/lines.h
@@ -23,6 +23,8 @@
#ifndef HOPKINS_LINES_H
#define HOPKINS_LINES_H
+#include "hopkins/globals.h"
+
#include "common/scummsys.h"
#include "common/str.h"
@@ -38,8 +40,8 @@ struct LigneZoneItem {
struct LigneItem {
int _lineDataEndIdx;
- int _direction;
- int field6;
+ Directions _direction;
+ Directions field6;
int field8;
int16 *_lineData;
};
@@ -94,7 +96,7 @@ private:
int NV_POSI;
int NVPX;
int NVPY;
- int _smoothMoveDirection;
+ Directions _smoothMoveDirection;
int16 super_parcours[32002];
byte *BUFFERTAPE;
int16 *essai0;
@@ -143,7 +145,7 @@ public:
int checkInventoryHotspots(int posX, int posY);
void addZoneLine(int idx, int a2, int a3, int a4, int a5, int bobZoneIdx);
void loadLines(const Common::String &file);
- void addLine(int idx, int direction, int a3, int a4, int a5, int a6);
+ void addLine(int idx, Directions direction, int a3, int a4, int a5, int a6);
void initRoute();
int16 *cityMapCarRoute(int x1, int y1, int x2, int y2);
void clearAllZones();
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 7b7ffc2aef..7c39d271c4 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -1305,7 +1305,7 @@ void ObjectsManager::GOHOME() {
_oldCharacterPosY = newPosY;
} else {
setSpriteIndex(0, _vm->_globals._oldDirection + 59);
- _vm->_globals._actionDirection = 0;
+ _vm->_globals._actionDirection = DIR_NONE;
int zoneId;
if (_vm->_globals.GOACTION)
zoneId = _vm->_globals._saveData->_data[svField2];
@@ -1530,7 +1530,7 @@ void ObjectsManager::GOHOME() {
else
zoneId = _zoneNum;
setSpriteIndex(0, _vm->_globals._oldDirection + 59);
- _vm->_globals._actionDirection = 0;
+ _vm->_globals._actionDirection = DIR_NONE;
_vm->_linesManager._route = (int16 *)g_PTRNUL;
computeAndSetSpriteSize();
setFlipSprite(0, false);
@@ -1909,7 +1909,7 @@ void ObjectsManager::handleLeftButton() {
if (getSpriteY(0) > 374 && getSpriteY(0) <= 410) {
_vm->_linesManager._route = (int16 *)g_PTRNUL;
setSpriteIndex(0, _vm->_globals._oldDirectionSpriteIdx);
- _vm->_globals._actionDirection = 0;
+ _vm->_globals._actionDirection = DIR_NONE;
_vm->_linesManager._route = (int16 *)g_PTRNUL;
computeAndSetSpriteSize();
setFlipSprite(0, false);
@@ -3117,10 +3117,10 @@ void ObjectsManager::INILINK(const Common::String &file) {
int lineDataIdx = 0;
int curLineIdx = 0;
_vm->_linesManager.resetLinesNumb();
- int curDirection;
+ Directions curDirection;
do {
- curDirection = (int16)READ_LE_UINT16(curDataPtr + 2 * lineDataIdx);
- if (curDirection != -1) {
+ curDirection = (Directions)(int16)READ_LE_UINT16(curDataPtr + 2 * lineDataIdx);
+ if (curDirection != DIR_NONE) {
_vm->_linesManager.addLine(
curLineIdx,
curDirection,
@@ -3131,7 +3131,7 @@ void ObjectsManager::INILINK(const Common::String &file) {
}
lineDataIdx += 5;
++curLineIdx;
- } while (curDirection != -1);
+ } while (curDirection != DIR_NONE);
_vm->_linesManager.initRoute();
}
}
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index 2d4f3e30ba..80383aaf6e 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -277,172 +277,172 @@ int ScriptManager::handleOpcode(byte *dataP) {
switch (specialOpcode) {
case 1:
case 14:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(4);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(4);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(4);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(4);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(4);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(4);
break;
case 2:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(7);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(7);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(7);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(7);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(7);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(7);
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(8);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(8);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(8);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(8);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(8);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(8);
break;
case 19:
case 4:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(1);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(1);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(1);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(1);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(1);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(1);
break;
case 5:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(5);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(5);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(5);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(5);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(5);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(5);
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(6);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(6);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(6);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(6);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(6);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(6);
break;
case 17:
case 7:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(2);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(2);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(2);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(2);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(2);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(2);
break;
case 18:
case 8:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(3);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(3);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(3);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(3);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(3);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(3);
break;
case 9:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(5);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(5);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(5);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(5);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(5);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(5);
break;
case 10:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(6);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(6);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(6);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(6);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(6);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(6);
break;
case 15:
case 11:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(7);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(7);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(7);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(7);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(7);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(7);
break;
case 16:
case 12:
- if (_vm->_globals._actionDirection == 1)
+ if (_vm->_globals._actionDirection == DIR_UP)
_vm->_objectsManager.doActionBack(8);
- if (_vm->_globals._actionDirection == 3)
+ if (_vm->_globals._actionDirection == DIR_RIGHT)
_vm->_objectsManager.doActionRight(8);
- if (_vm->_globals._actionDirection == 2)
+ if (_vm->_globals._actionDirection == DIR_UP_RIGHT)
_vm->_objectsManager.doActionDiagRight(8);
- if (_vm->_globals._actionDirection == 5)
+ if (_vm->_globals._actionDirection == DIR_DOWN)
_vm->_objectsManager.doActionFront(8);
- if (_vm->_globals._actionDirection == 8)
+ if (_vm->_globals._actionDirection == DIR_UP_LEFT)
_vm->_objectsManager.doActionDiagLeft(8);
- if (_vm->_globals._actionDirection == 7)
+ if (_vm->_globals._actionDirection == DIR_LEFT)
_vm->_objectsManager.doActionLeft(8);
break;
}