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

dreammaster dreammaster at scummvm.org
Thu Jan 25 04:04:07 CET 2018


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:
f1170a4ab1 XEEN: Extra comments for map code


Commit: f1170a4ab1f2fee7f0b502f0c2f5f2c14f6aac4d
    https://github.com/scummvm/scummvm/commit/f1170a4ab1f2fee7f0b502f0c2f5f2c14f6aac4d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-01-24T22:04:01-05:00

Commit Message:
XEEN: Extra comments for map code

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


diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index b00642b..9da9fef 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -791,7 +791,7 @@ void MonsterObjectData::synchronize(XeenSerializer &s, MonsterData &monsterData)
 
 	} else {
 		// Load monster/obbject data and merge together with sprite Ids
-		// Merge together object data
+		// Load objects
 		mobStruct.synchronize(s);
 		do {
 			MazeObject obj;
@@ -811,7 +811,7 @@ void MonsterObjectData::synchronize(XeenSerializer &s, MonsterData &monsterData)
 			mobStruct.synchronize(s);
 		} while (mobStruct._id != 255 || mobStruct._pos.x != -1);
 
-		// Merge together monster data
+		// Load monsters
 		mobStruct.synchronize(s);
 		do {
 			MazeMonster mon;
@@ -838,7 +838,7 @@ void MonsterObjectData::synchronize(XeenSerializer &s, MonsterData &monsterData)
 			mobStruct.synchronize(s);
 		} while (mobStruct._id != 255 || mobStruct._pos.x != -1);
 
-		// Merge together wall item data
+		// Load wall items
 		mobStruct.synchronize(s);
 		do {
 			if (mobStruct._id < (int)_wallItemSprites.size()) {
diff --git a/engines/xeen/map.h b/engines/xeen/map.h
index e4cf148..71af89e 100644
--- a/engines/xeen/map.h
+++ b/engines/xeen/map.h
@@ -459,14 +459,23 @@ public:
 public:
 	Map(XeenEngine *vm);
 
+	/**
+	 * Loads a specified map
+	 */
 	void load(int mapId);
 
 	int mazeLookup(const Common::Point &pt, int layerShift, int wallMask = 0xf);
 
 	void cellFlagLookup(const Common::Point &pt);
 
+	/**
+	 * Sets the surface flags for a given position
+	 */
 	void setCellSurfaceFlags(const Common::Point &pt, int bits);
 
+	/**
+	 * Sets the value for the wall in a given direction from a given point
+	 */
 	void setWall(const Common::Point &pt, Direction dir, int v);
 
 	/**
@@ -474,14 +483,32 @@ public:
 	 */
 	void saveMaze();
 
+	/**
+	 * Gets the data for a map position at one of the relative indexes
+	 * surrounding the current position
+	 */
 	int getCell(int idx);
 
+	/**
+	 * Returns the data for the primary active map
+	 */
 	MazeData &mazeData() { return _mazeData[0]; }
 
+	/**
+	 * Returns the data for the currently indexed map
+	 */
 	MazeData &mazeDataCurrent() { return _mazeData[_mazeDataIndex]; }
 
+	/**
+	 * Loads the sprites needed for rendering the skyline
+	 */
 	void loadSky();
 
+	/**
+	 * Tests the current position, and if it's moved beyond the valid (0,0) to (15,15)
+	 * range for a map, loads in the correct surrounding map, and adjusts the
+	 * position to the relative position on the new map
+	 */
 	void getNewMaze();
 };
 





More information about the Scummvm-git-logs mailing list