aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/xeen/interface.cpp2
-rw-r--r--engines/xeen/interface_map.cpp16
-rw-r--r--engines/xeen/map.cpp28
-rw-r--r--engines/xeen/map.h2
-rw-r--r--engines/xeen/scripts.cpp5
5 files changed, 28 insertions, 25 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 44e2326c1f..f85e19d99f 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -809,7 +809,7 @@ bool Interface::checkMoveDirection(int key) {
if (map._isOutdoors) {
party._mazeDirection = dir;
- switch ((int)map._currentWall._outdoors._surfaceId) {
+ switch (map._currentWall) {
case 5:
if (_vm->_files->_isDarkCc)
goto check;
diff --git a/engines/xeen/interface_map.cpp b/engines/xeen/interface_map.cpp
index 04f7355603..43a467df9b 100644
--- a/engines/xeen/interface_map.cpp
+++ b/engines/xeen/interface_map.cpp
@@ -1176,7 +1176,7 @@ void InterfaceMap::setMazeBits() {
break;
}
- _thinWall = (_vm->_map->_currentWall._data != INVALID_CELL) && _wo[27];
+ _thinWall = (_vm->_map->_currentWall != INVALID_CELL) && _wo[27];
switch (_vm->_map->getCell(8) - 1) {
case 1:
@@ -4423,25 +4423,25 @@ void InterfaceMap::drawOutdoors() {
for (int idx = 0; idx < 9; ++idx) {
map.getCell(TERRAIN_INDEXES1[idx]);
- _outdoorList[36 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall._data];
+ _outdoorList[36 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall];
}
for (int idx = 0; idx < 5; ++idx) {
map.getCell(TERRAIN_INDEXES2[idx]);
- _outdoorList[61 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall._data];
+ _outdoorList[61 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall];
}
for (int idx = 0; idx < 3; ++idx) {
map.getCell(TERRAIN_INDEXES3[idx]);
- _outdoorList[84 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall._data];
+ _outdoorList[84 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall];
}
for (int idx = 0; idx < 5; ++idx) {
map.getCell(TERRAIN_INDEXES4[idx]);
- _outdoorList[103 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall._data];
+ _outdoorList[103 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall];
}
map.getCell(1);
- _outdoorList[108]._sprites = &map._wallSprites._surfaces[map._currentWall._data];
- _outdoorList[109]._sprites = &map._wallSprites._surfaces[map._currentWall._data];
- _outdoorList[110]._sprites = &map._wallSprites._surfaces[map._currentWall._data];
+ _outdoorList[108]._sprites = &map._wallSprites._surfaces[map._currentWall];
+ _outdoorList[109]._sprites = &map._wallSprites._surfaces[map._currentWall];
+ _outdoorList[110]._sprites = &map._wallSprites._surfaces[map._currentWall];
_outdoorList._sky1._flags = _outdoorList._sky2._flags = _flipSky ? SPRFLAG_HORIZ_FLIPPED : 0;
_outdoorList._groundSprite._flags = _flipWater ? SPRFLAG_HORIZ_FLIPPED : 0;
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index ae38b77ed6..52dc4273aa 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -866,7 +866,7 @@ Map::Map(XeenEngine *vm) : _vm(vm), _mobData(vm) {
_mazeDataIndex = 0;
_currentSteppedOn = false;
_currentSurfaceId = 0;
- _currentWall._data = 0;
+ _currentWall = 0;
_currentTile = 0;
_currentIsGrate = false;
_currentCantRest = false;
@@ -1398,7 +1398,7 @@ int Map::getCell(int idx) {
} else {
_currentSurfaceId = (mapId >= 25 && mapId <= 27) ? 7 : 0;
}
- _currentWall._data = INVALID_CELL;
+ _currentWall = INVALID_CELL;
return INVALID_CELL;
}
@@ -1418,7 +1418,7 @@ int Map::getCell(int idx) {
if (!mapId) {
if (_isOutdoors) {
_currentSurfaceId = SURFTYPE_SPACE;
- _currentWall._data = 0;
+ _currentWall = 0;
return 0;
} else {
if (_vm->_files->_isDarkCc) {
@@ -1432,7 +1432,7 @@ int Map::getCell(int idx) {
_currentSurfaceId = (mapId >= 25 && mapId <= 27) ? SURFTYPE_ROAD : SURFTYPE_DEFAULT;
}
- _currentWall._data = INVALID_CELL;
+ _currentWall = INVALID_CELL;
return INVALID_CELL;
}
@@ -1454,7 +1454,7 @@ int Map::getCell(int idx) {
if (!mapId) {
if (_isOutdoors) {
_currentSurfaceId = SURFTYPE_SPACE;
- _currentWall._data = 0;
+ _currentWall = 0;
return 0;
} else {
if (_vm->_files->_isDarkCc) {
@@ -1468,7 +1468,7 @@ int Map::getCell(int idx) {
_currentSurfaceId = (mapId >= 25 && mapId <= 27) ? SURFTYPE_ROAD : SURFTYPE_DEFAULT;
}
- _currentWall._data = INVALID_CELL;
+ _currentWall = INVALID_CELL;
return INVALID_CELL;
}
}
@@ -1478,16 +1478,16 @@ int Map::getCell(int idx) {
++_mazeDataIndex;
}
- MazeWallLayers &wallLayers = _mazeData[_mazeDataIndex]._wallData[pt.y][pt.x];
+ int wallData = _mazeData[_mazeDataIndex]._wallData[pt.y][pt.x]._data;
if (_isOutdoors) {
if (mapId) {
// TODO: tile is set to word of (wallLayers >> 8) && 0xff? Makes no sense
- _currentTile = wallLayers._outdoors._surfaceId;
- _currentWall = wallLayers;
- _currentSurfaceId = wallLayers._outdoors._surfaceId;
+ _currentTile = (wallData >> 8) & 0xFF;
+ _currentWall = (wallData >> 4) & 0xF;
+ _currentSurfaceId = wallData & 0xF;
} else {
_currentSurfaceId = SURFTYPE_DEFAULT;
- _currentWall._data = 0;
+ _currentWall = 0;
_currentTile = 0;
}
} else {
@@ -1499,11 +1499,11 @@ int Map::getCell(int idx) {
else
_currentSurfaceId = _mazeData[_mazeDataIndex]._cells[pt.y][pt.x]._surfaceId;
- _currentWall = wallLayers;
- return (_currentWall._data >> WALL_SHIFTS[dir][idx]) & 0xF;
+ _currentWall = wallData;
+ return (_currentWall >> WALL_SHIFTS[dir][idx]) & 0xF;
}
- return _currentWall._data;
+ return _currentWall;
}
void Map::loadSky() {
diff --git a/engines/xeen/map.h b/engines/xeen/map.h
index 499b451bbc..f878a0d0d5 100644
--- a/engines/xeen/map.h
+++ b/engines/xeen/map.h
@@ -370,7 +370,7 @@ public:
bool _currentIsEvent;
int _currentSky;
int _currentMonsterFlags;
- MazeWallLayers _currentWall;
+ int _currentWall;
int _currentTile;
int _currentSurfaceId;
bool _currentSteppedOn;
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 39202c089d..ad24985b31 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -322,7 +322,10 @@ void Scripts::cmdTeleport(Common::Array<byte> &params) {
party._stepped = true;
if (mapId != party._mazeId) {
- switch (map._mobData._objects[intf._objNumber - 1]._spriteId) {
+ int spriteId = (intf._objNumber == 0) ? -1 :
+ map._mobData._objects[intf._objNumber - 1]._spriteId;
+
+ switch (spriteId) {
case 47:
sound.playFX(45);
break;