XEEN: Change _currentWall to be MazeWallLayers union

This commit is contained in:
Paul Gilbert
2015-01-12 20:56:15 -05:00
parent 488847006c
commit 07f37cedf5
3 changed files with 20 additions and 20 deletions
+3 -3
View File
@@ -1311,7 +1311,7 @@ void Interface::setMazeBits() {
case 14:
++_wo[287];
break;
defualt:
default:
break;
}
@@ -1497,7 +1497,7 @@ void Interface::setMazeBits() {
break;
}
_thinWall = (_vm->_map->_currentWall != 0x8888 && _wo[27]);
_thinWall = (_vm->_map->_currentWall._data != 0x8888) && _wo[27];
switch (_vm->_map->getCell(8)) {
case 1:
@@ -1571,7 +1571,7 @@ void Interface::setMazeBits() {
switch (_vm->_map->getCell(10)) {
case 0:
+_wo[117];
++_wo[117];
break;
case 1:
++_wo[55];
+16 -16
View File
@@ -854,7 +854,7 @@ Map::Map(XeenEngine *vm) : _vm(vm), _mobData(vm) {
_mazeDataIndex = 0;
_currentSteppedOn = false;
_currentSurfaceId = 0;
_currentWall = 0;
_currentWall._data = 0;
_currentTile = 0;
_currentIsGrate = false;
_currentCantRest = false;
@@ -1239,8 +1239,8 @@ int Map::getCell(int idx) {
} else {
_currentSurfaceId = (mapId >= 25 && mapId <= 27) ? 7 : 0;
}
_currentWall = 0x8888;
return _currentWall;
_currentWall._data = 0x8888;
return 0x8888;
}
_mazeDataIndex = 0;
@@ -1259,7 +1259,7 @@ int Map::getCell(int idx) {
if (!mapId) {
if (_isOutdoors) {
_currentSurfaceId = SURFTYPE_SPACE;
_currentWall = 0;
_currentWall._data = 0;
return 0;
} else {
if (_vm->_files->_isDarkCc) {
@@ -1273,8 +1273,8 @@ int Map::getCell(int idx) {
_currentSurfaceId = (mapId >= 25 && mapId <= 27) ? SURFTYPE_ROAD : SURFTYPE_DEFAULT;
}
_currentWall = 0x8888;
return _currentWall;
_currentWall._data = 0x8888;
return 0x8888;
}
_mazeDataIndex = 0;
@@ -1295,8 +1295,8 @@ int Map::getCell(int idx) {
if (!mapId) {
if (_isOutdoors) {
_currentSurfaceId = SURFTYPE_SPACE;
_currentWall = 0;
return _currentWall;
_currentWall._data = 0;
return 0;
} else {
if (_vm->_files->_isDarkCc) {
if ((mapId >= 53 && mapId <= 88 && mapId != 73) || (mapId >= 74 && mapId <= 120) ||
@@ -1309,8 +1309,8 @@ int Map::getCell(int idx) {
_currentSurfaceId = (mapId >= 25 && mapId <= 27) ? SURFTYPE_ROAD : SURFTYPE_DEFAULT;
}
_currentWall = 0x8888;
return _currentWall;
_currentWall._data = 0x8888;
return 0x8888;
}
_mazeDataIndex = 0;
@@ -1324,15 +1324,15 @@ int Map::getCell(int idx) {
if (mapId) {
// TODO: tile is set to word of (wallLayers >> 8) && 0xff? Makes no sense
_currentTile = wallLayers._outdoors._surfaceId;
_currentWall = wallLayers._outdoors._iMiddle;
_currentWall = wallLayers;
_currentSurfaceId = wallLayers._outdoors._surfaceId;
} else {
_currentSurfaceId = SURFTYPE_DEFAULT;
_currentWall = 0;
_currentWall._data = 0;
_currentTile = 0;
}
} else {
if (!mapId)
if (!mapId)
return 0;
if (pt.x > 31 || pt.y > 31)
@@ -1340,11 +1340,11 @@ int Map::getCell(int idx) {
else
_currentSurfaceId = _mazeData[_mazeDataIndex]._cells[pt.y][pt.x]._surfaceId;
_currentWall = wallLayers._data;
return (_currentWall >> (WALL_NUMBERS[dir][idx * 2] * 4)) & 0xF;
_currentWall = wallLayers;
return (_currentWall._data >> (WALL_NUMBERS[dir][idx * 2] * 4)) & 0xF;
}
return _currentWall;
return _currentWall._data;
}
} // End of namespace Xeen
+1 -1
View File
@@ -367,7 +367,7 @@ public:
bool _currentIsEvent;
bool _currentIsObject;
int _currentMonsterFlags;
int _currentWall;
MazeWallLayers _currentWall;
int _currentTile;
public:
Map(XeenEngine *vm);