[Scummvm-git-logs] scummvm master -> 4586cee0ab61aa7eaf93f7ec9777d1c750a91ab2

dreammaster dreammaster at scummvm.org
Sat Apr 7 01:13:35 CEST 2018


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

Summary:
37b9de6d25 XEEN: Cleanup of monster move check method
4586cee0ab XEEN: Fix Space tiles not appearing in the map & minimap


Commit: 37b9de6d2564a9170b99711a7dd2327a882a5609
    https://github.com/scummvm/scummvm/commit/37b9de6d2564a9170b99711a7dd2327a882a5609
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-06T19:11:26-04:00

Commit Message:
XEEN: Cleanup of monster move check method

Changed paths:
    engines/xeen/combat.cpp
    engines/xeen/combat.h
    engines/xeen/saves.cpp


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index e8ae670..2293dcd 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -491,12 +491,12 @@ void Combat::moveMonsters() {
 							switch (party._mazeDirection) {
 							case DIR_NORTH:
 							case DIR_SOUTH:
-								if (monsterCanMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX1[arrIndex]],
+								if (canMonsterMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX1[arrIndex]],
 										MONSTER_GRID_X[arrIndex], MONSTER_GRID_Y[arrIndex], idx)) {
 									// Move the monster
 									moveMonster(idx, Common::Point(MONSTER_GRID_X[arrIndex], MONSTER_GRID_Y[arrIndex]));
 								} else {
-									if (monsterCanMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX2[arrIndex]],
+									if (canMonsterMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX2[arrIndex]],
 										arrIndex >= 21 && arrIndex <= 27 ? MONSTER_GRID3[arrIndex] : 0,
 										arrIndex >= 21 && arrIndex <= 27 ? 0 : MONSTER_GRID3[arrIndex],
 										idx)) {
@@ -511,7 +511,7 @@ void Combat::moveMonsters() {
 
 							case DIR_EAST:
 							case DIR_WEST:
-								if (monsterCanMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX2[arrIndex]],
+								if (canMonsterMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX2[arrIndex]],
 									arrIndex >= 21 && arrIndex <= 27 ? MONSTER_GRID3[arrIndex] : 0,
 									arrIndex >= 21 && arrIndex <= 27 ? 0 : MONSTER_GRID3[arrIndex],
 									idx)) {
@@ -520,7 +520,7 @@ void Combat::moveMonsters() {
 									} else {
 										moveMonster(idx, Common::Point(0, MONSTER_GRID3[arrIndex]));
 									}
-								} else if (monsterCanMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX1[arrIndex]],
+								} else if (canMonsterMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX1[arrIndex]],
 										MONSTER_GRID_X[arrIndex], MONSTER_GRID_Y[arrIndex], idx)) {
 									moveMonster(idx, Common::Point(MONSTER_GRID_X[arrIndex], MONSTER_GRID_Y[arrIndex]));
 								}
@@ -670,8 +670,7 @@ void Combat::setupMonsterAttack(int monsterDataIndex, const Common::Point &pt) {
 	}
 }
 
-bool Combat::monsterCanMove(const Common::Point &pt, int wallShift,
-		int xDiff, int yDiff, int monsterId) {
+bool Combat::canMonsterMove(const Common::Point &pt, int wallShift, int xDiff, int yDiff, int monsterId) {
 	Map &map = *_vm->_map;
 	MazeMonster &monster = map._mobData._monsters[monsterId];
 	MonsterStruct &monsterData = *monster._monsterData;
diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h
index deefe33..c3fa987 100644
--- a/engines/xeen/combat.h
+++ b/engines/xeen/combat.h
@@ -273,9 +273,13 @@ public:
 
 	/**
 	 * Determines whether a given monster can move
+	 * @param pt			Monster position
+	 * @param wallShift		Shift mask for determining direction being moved
+	 * @param xDiff			X Delta for move
+	 * @param yDiff			Y Delta for move
+	 * @param monsterId		Monster number being tested
 	 */
-	bool monsterCanMove(const Common::Point &pt, int wallShift,
-		int v1, int v2, int monsterId);
+	bool canMonsterMove(const Common::Point &pt, int wallShift, int xDiff, int yDiff, int monsterId);
 
 	/**
 	 * Moves a monster by a given delta amount if it's a valid move
diff --git a/engines/xeen/saves.cpp b/engines/xeen/saves.cpp
index 7eadac1..1f58562 100644
--- a/engines/xeen/saves.cpp
+++ b/engines/xeen/saves.cpp
@@ -259,7 +259,6 @@ bool SavesManager::loadGame() {
 
 bool SavesManager::saveGame() {
 	Map &map = *g_vm->_map;
-	Windows &windows = *g_vm->_windows;
 	
 	if (map.mazeData()._mazeFlags & RESTRICTION_SAVE) {
 		ErrorScroll::show(g_vm, Res.SAVE_OFF_LIMITS, WT_NONFREEZED_WAIT);


Commit: 4586cee0ab61aa7eaf93f7ec9777d1c750a91ab2
    https://github.com/scummvm/scummvm/commit/4586cee0ab61aa7eaf93f7ec9777d1c750a91ab2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-06T19:13:32-04:00

Commit Message:
XEEN: Fix Space tiles not appearing in the map & minimap

Changed paths:
    engines/xeen/map.h


diff --git a/engines/xeen/map.h b/engines/xeen/map.h
index a84c338..727c2e0 100644
--- a/engines/xeen/map.h
+++ b/engines/xeen/map.h
@@ -165,16 +165,16 @@ enum SurfaceType {
 
 union MazeWallLayers {
 	struct MazeWallIndoors {
-		int _wallNorth : 4;
-		int _wallEast : 4;
-		int _wallSouth : 4;
-		int _wallWest : 4;
+		uint _wallNorth : 4;
+		uint _wallEast : 4;
+		uint _wallSouth : 4;
+		uint _wallWest : 4;
 	} _indoors;
 	struct MazeWallOutdoors {
-		SurfaceType _surfaceId : 4;
-		int _iMiddle : 4;
-		int _iTop : 4;
-		int _iOverlay : 4;
+		uint _surfaceId : 4;		// SurfaceType, but needs to be unsigned
+		uint _iMiddle : 4;
+		uint _iTop : 4;
+		uint _iOverlay : 4;
 	} _outdoors;
 	uint16 _data;
 };





More information about the Scummvm-git-logs mailing list