Skip to content

Commit

Permalink
XEEN: Fix Coverity identified warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 12, 2017
1 parent a912979 commit 171a86a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engines/xeen/dialogs_map.cpp
Expand Up @@ -127,6 +127,7 @@ void MapDialog::drawOutdoors() {
for (int xp = MAP_XSTART, mazeX = _pt.x - (MAP_DIFF - 1); mazeX <= (_pt.x + MAP_DIFF);
xp += TILE_WIDTH, ++mazeX) {
v = map.mazeLookup(Common::Point(mazeX, mazeY), 0);
assert(v != INVALID_CELL);
frame = map.mazeDataCurrent()._surfaceTypes[v];

if (map._currentSteppedOn) {
Expand All @@ -140,6 +141,7 @@ void MapDialog::drawOutdoors() {
for (int xp = MAP_XSTART, mazeX = _pt.x - (MAP_DIFF - 1); mazeX <= (_pt.x + MAP_DIFF);
xp += TILE_WIDTH, ++mazeX) {
v = map.mazeLookup(Common::Point(mazeX, mazeY), 4);
assert(v != INVALID_CELL);
frame = map.mazeDataCurrent()._wallTypes[v];

if (frame && map._currentSteppedOn)
Expand Down
2 changes: 2 additions & 0 deletions engines/xeen/interface_minimap.cpp
Expand Up @@ -75,6 +75,7 @@ void InterfaceMinimap::drawOutdoorsMinimap() {
for (int xp = MINIMAP_XSTART, mazeX = pt.x - MINIMAP_DIFF; mazeX <= (pt.x + MINIMAP_DIFF);
xp += TILE_WIDTH, ++mazeX) {
v = map.mazeLookup(Common::Point(mazeX, mazeY), 0);
assert(v != INVALID_CELL);
frame = map.mazeDataCurrent()._surfaceTypes[v];

if (frame && (map._currentSteppedOn || party._wizardEyeActive)) {
Expand All @@ -88,6 +89,7 @@ void InterfaceMinimap::drawOutdoorsMinimap() {
for (int xp = MINIMAP_XSTART, mazeX = pt.x - MINIMAP_DIFF; mazeX <= (pt.x + MINIMAP_DIFF);
xp += TILE_WIDTH, ++mazeX) {
v = map.mazeLookup(Common::Point(mazeX, mazeY), 4);
assert(v != INVALID_CELL);
frame = map.mazeData()._wallTypes[v];

if (frame && (map._currentSteppedOn || party._wizardEyeActive)) {
Expand Down
5 changes: 5 additions & 0 deletions engines/xeen/interface_scene.cpp
Expand Up @@ -4419,26 +4419,31 @@ void InterfaceScene::drawOutdoors() {
assert(map._currentWall != INVALID_CELL);
for (int idx = 0; idx < 9; ++idx) {
map.getCell(TERRAIN_INDEXES1[idx]);
assert(map._currentWall != INVALID_CELL);
SpriteResource &spr = map._wallSprites._surfaces[map._currentWall];
_outdoorList[28 + idx]._sprites = spr.size() == 0 ? (SpriteResource *)nullptr : &spr;
}
for (int idx = 0; idx < 5; ++idx) {
map.getCell(TERRAIN_INDEXES2[idx]);
assert(map._currentWall != INVALID_CELL);
SpriteResource &spr = map._wallSprites._surfaces[map._currentWall];
_outdoorList[61 + idx]._sprites = spr.size() == 0 ? (SpriteResource *)nullptr : &spr;
}
for (int idx = 0; idx < 3; ++idx) {
map.getCell(TERRAIN_INDEXES3[idx]);
assert(map._currentWall != INVALID_CELL);
SpriteResource &spr = map._wallSprites._surfaces[map._currentWall];
_outdoorList[84 + idx]._sprites = spr.size() == 0 ? (SpriteResource *)nullptr : &spr;
}
for (int idx = 0; idx < 5; ++idx) {
map.getCell(TERRAIN_INDEXES4[idx]);
assert(map._currentWall != INVALID_CELL);
SpriteResource &spr = map._wallSprites._surfaces[map._currentWall];
_outdoorList[103 + idx]._sprites = spr.size() == 0 ? (SpriteResource *)nullptr : &spr;
}

map.getCell(1);
assert(map._currentWall != INVALID_CELL);
SpriteResource &surface = map._wallSprites._surfaces[map._currentWall];
_outdoorList[108]._sprites = surface.size() == 0 ? (SpriteResource *)nullptr : &surface;
_outdoorList[109]._sprites = _outdoorList[108]._sprites;
Expand Down

0 comments on commit 171a86a

Please sign in to comment.