From 1f312098ade02210345a5adffcc2dd531d24ee7f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 19 Jan 2015 16:20:40 -0500 Subject: XEEN: Minor minimap fixes --- engines/xeen/interface.cpp | 28 ++++++++++++++++------------ engines/xeen/map.cpp | 16 ++++++++-------- engines/xeen/map.h | 1 + 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index bcb406dcbe..c017514012 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -1115,7 +1115,7 @@ void Interface::setMazeBits() { break; } - _thinWall = (_vm->_map->_currentWall._data != 0x8888) && _wo[27]; + _thinWall = (_vm->_map->_currentWall._data != INVALID_CELL) && _wo[27]; switch (_vm->_map->getCell(8) - 1) { case 1: @@ -2315,9 +2315,13 @@ void Interface::drawMiniMap() { Screen &screen = *_vm->_screen; Window &window1 = screen._windows[1]; - if (screen._windows[2]._enabled || screen._windows[10]._enabled || - (!party._automapOn && !party._wizardEyeActive)) + if (screen._windows[2]._enabled || screen._windows[10]._enabled) return; + if (!party._automapOn && !party._wizardEyeActive) { + // Draw the Might & Magic logo + _globalSprites.draw(window1, 5, Common::Point(232, 9)); + return; + } int v, frame; int frame2 = _overallFrame * 2; @@ -2365,9 +2369,13 @@ void Interface::drawMiniMap() { } } } + + // Draw the direction arrow + _globalSprites.draw(window1, party._mazeDirection + 1, + Common::Point(267, 36)); } else { frame2 = (frame2 + 2) % 8; - + party._wizardEyeActive = true; //**DEBUG** // First draw cell back for positions in the map that have been revealed for (int rowNum = 0, yp = 12, yDiff = 3; rowNum < MINIMAP_SIZE; ++rowNum, yp += 8, --yDiff) { for (int colNum = 0, xp = 237, xDiff = -3; colNum < MINIMAP_SIZE; ++colNum, xp += 10, ++xDiff) { @@ -2375,7 +2383,7 @@ void Interface::drawMiniMap() { Common::Point(party._mazePosition.x + xDiff, party._mazePosition.y + yDiff), 0, 0xffff); - if (v != 0xffff && (map._currentSteppedOn || party._wizardEyeActive)) { + if (v != INVALID_CELL && (map._currentSteppedOn || party._wizardEyeActive)) { map._tileSprites.draw(window1, 0, Common::Point(xp, yp)); } } @@ -2396,7 +2404,7 @@ void Interface::drawMiniMap() { } } } - + v = map.mazeLookup(Common::Point(party._mazePosition.x - 4, party._mazePosition.y + 4), 0xffff, 0); if (v != 0xffff && !map._currentSurfaceId && (map._currentSteppedOn || party._wizardEyeActive)) { @@ -2548,7 +2556,7 @@ void Interface::drawMiniMap() { for (int colNum = 0, xp = 237, xDiff = -3; colNum < MINIMAP_SIZE; ++colNum, ++xDiff, xp += 10) { if (colNum == 4 && rowNum == 4) { - // Center of the minimap + // Center of the minimap. Draw the direction arrow _globalSprites.draw(window1, party._mazeDirection + 1, Common::Point(272, 40)); } @@ -2673,11 +2681,7 @@ void Interface::drawMiniMap() { } } - if (map._isOutdoors) { - _globalSprites.draw(window1, party._mazeDirection + 1, - Common::Point(267, 36)); - } - + // Draw outer rectangle around the automap _globalSprites.draw(window1, 6, Common::Point(223, 3)); party._wizardEyeActive = eyeActive; } diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index 17c49bef80..2bc610721a 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -1225,7 +1225,7 @@ int Map::mazeLookup(const Common::Point &pt, int layerShift, int wallMask) { } else { // No map, so reached outside indoor area or outer space outdoors _currentSteppedOn = true; - return _isOutdoors ? SURFTYPE_SPACE : 0x8888; + return _isOutdoors ? SURFTYPE_SPACE : INVALID_CELL; } } @@ -1263,7 +1263,7 @@ int Map::mazeLookup(const Common::Point &pt, int layerShift, int wallMask) { } else { _currentSteppedOn = _isOutdoors; - return _isOutdoors ? SURFTYPE_SPACE : 0x8888; + return _isOutdoors ? SURFTYPE_SPACE : INVALID_CELL; } } @@ -1382,8 +1382,8 @@ int Map::getCell(int idx) { } else { _currentSurfaceId = (mapId >= 25 && mapId <= 27) ? 7 : 0; } - _currentWall._data = 0x8888; - return 0x8888; + _currentWall._data = INVALID_CELL; + return INVALID_CELL; } _mazeDataIndex = 0; @@ -1416,8 +1416,8 @@ int Map::getCell(int idx) { _currentSurfaceId = (mapId >= 25 && mapId <= 27) ? SURFTYPE_ROAD : SURFTYPE_DEFAULT; } - _currentWall._data = 0x8888; - return 0x8888; + _currentWall._data = INVALID_CELL; + return INVALID_CELL; } _mazeDataIndex = 0; @@ -1452,8 +1452,8 @@ int Map::getCell(int idx) { _currentSurfaceId = (mapId >= 25 && mapId <= 27) ? SURFTYPE_ROAD : SURFTYPE_DEFAULT; } - _currentWall._data = 0x8888; - return 0x8888; + _currentWall._data = INVALID_CELL; + return INVALID_CELL; } } diff --git a/engines/xeen/map.h b/engines/xeen/map.h index 16ef15cbdb..9b19b3a53a 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -35,6 +35,7 @@ namespace Xeen { #define MAP_WIDTH 16 #define MAP_HEIGHT 16 #define TOTAL_SURFACES 16 +#define INVALID_CELL 0x8888 class XeenEngine; -- cgit v1.2.3