[Scummvm-git-logs] scummvm master -> a1816980d640077f843ab89a8e1ed086a245d146

dreammaster dreammaster at scummvm.org
Sun Dec 10 22:51:33 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a1816980d6 XEEN: Fix map display when at the edges of a map


Commit: a1816980d640077f843ab89a8e1ed086a245d146
    https://github.com/scummvm/scummvm/commit/a1816980d640077f843ab89a8e1ed086a245d146
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-10T16:51:21-05:00

Commit Message:
XEEN: Fix map display when at the edges of a map

Changed paths:
    engines/xeen/dialogs_map.cpp
    engines/xeen/dialogs_map.h
    engines/xeen/map.cpp


diff --git a/engines/xeen/dialogs_map.cpp b/engines/xeen/dialogs_map.cpp
index 084ee87..5964580 100644
--- a/engines/xeen/dialogs_map.cpp
+++ b/engines/xeen/dialogs_map.cpp
@@ -44,11 +44,12 @@ void MapDialog::execute() {
 
 	if (_pt.x < 8 && map.mazeData()._surroundingMazes._west == 0) {
 		_arrowPt.x = _pt.x * 10 + 4;
+		_pt.x = 7;
 	} else if (_pt.x > 23) {
-		_arrowPt.x = _pt.x * 10 + 100;
+		_arrowPt.x = (byte)(_pt.x * 10 + 100);
 		_pt.x = 23;
 	} else if (_pt.x > 8 && map.mazeData()._surroundingMazes._east == 0) {
-		_arrowPt.x = _pt.x * 10 + 4;
+		_arrowPt.x = (byte)(_pt.x * 10 + 4);
 		_pt.x = 7;
 	} else {
 		_arrowPt.x = 74;
@@ -58,7 +59,7 @@ void MapDialog::execute() {
 		_arrowPt.y = ((15 - _pt.y) << 3) + 13;
 		_pt.y = 8;
 	} else if (_pt.y > 24) {
-		_arrowPt.y = ((15 - (_pt.y - 24)) << 3) + 13;
+		_arrowPt.y = ((15 - (_pt.y - 16)) << 3) + 13;
 		_pt.y = 24;
 	} else if (_pt.y >= 8 && map.mazeData()._surroundingMazes._north == 0) {
 		_arrowPt.y = ((15 - _pt.y) << 3) + 13;
@@ -202,7 +203,7 @@ void MapDialog::drawIndoors() {
 
 	// Draw walls on left and top edges of map
 	for (int xp = 80, yp = 158, mazeX = _pt.x - 7, mazeY = _pt.y - 8; xp < 250;
-	xp += 10, yp -= 8, ++mazeX, ++mazeY) {
+			xp += 10, yp -= 8, ++mazeX, ++mazeY) {
 		// Draw walls on left edge of map
 		v = map.mazeLookup(Common::Point(_pt.x - 8, mazeY), 12);
 
diff --git a/engines/xeen/dialogs_map.h b/engines/xeen/dialogs_map.h
index 8ae24ee..3c12afa 100644
--- a/engines/xeen/dialogs_map.h
+++ b/engines/xeen/dialogs_map.h
@@ -36,7 +36,8 @@ private:
 	Common::Point _pt, _arrowPt;
 	bool _frameEndFlag;
 private:
-	MapDialog(XeenEngine *vm) : ButtonContainer(vm), _animFrame(0) {}
+	MapDialog(XeenEngine *vm) : ButtonContainer(vm),
+		_animFrame(0), _frameEndFlag(false) {}
 
 	/**
 	 * Draws the map contents when outdoors
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 1a33f1d..f24f99f 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -1263,8 +1263,10 @@ int Map::mazeLookup(const Common::Point &pt, int layerShift, int wallMask) {
 	Common::Point pos = pt;
 	int mapId = _vm->_party->_mazeId;
 
-	if (pt.x < -16 || pt.y < -16 || pt.x >= 32 || pt.y >= 32)
-		error("Invalid coordinate");
+	if (pt.x < -16 || pt.y < -16 || pt.x >= 32 || pt.y >= 32) {
+		_currentWall = INVALID_CELL;
+		return INVALID_CELL;
+	}
 
 	// Find the correct maze data out of the set to use
 	_mazeDataIndex = 0;





More information about the Scummvm-git-logs mailing list