[Scummvm-git-logs] scummvm master -> 2be2339a21eb244d5122f798397efe23cffebdc7

dreammaster dreammaster at scummvm.org
Wed Mar 28 03:52:25 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:
5b5abd4743 XEEN: Change Map _loadDarkSide bool to int _loadCcNum
2be2339a21 XEEN: Simplify debugger map command


Commit: 5b5abd47434c3d0680f7ca7df7eb6f7291dc4599
    https://github.com/scummvm/scummvm/commit/5b5abd47434c3d0680f7ca7df7eb6f7291dc4599
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-03-27T21:45:17-04:00

Commit Message:
XEEN: Change Map _loadDarkSide bool to int _loadCcNum

Changed paths:
    engines/xeen/debugger.cpp
    engines/xeen/dialogs/dialogs_control_panel.cpp
    engines/xeen/dialogs/dialogs_create_char.cpp
    engines/xeen/dialogs/dialogs_party.cpp
    engines/xeen/dialogs/dialogs_spells.cpp
    engines/xeen/interface.cpp
    engines/xeen/locations.cpp
    engines/xeen/map.cpp
    engines/xeen/map.h
    engines/xeen/saves.cpp
    engines/xeen/scripts.cpp
    engines/xeen/spells.cpp
    engines/xeen/xeen.cpp


diff --git a/engines/xeen/debugger.cpp b/engines/xeen/debugger.cpp
index d5f1b40..bd6c8ad 100644
--- a/engines/xeen/debugger.cpp
+++ b/engines/xeen/debugger.cpp
@@ -169,11 +169,11 @@ bool Debugger::cmdMap(int argc, const char **argv) {
 		return true;
 	} else {
 		int mapId = strToInt(argv[1]);
-		bool side = argc < 3 ? files._ccNum : strToInt(argv[2]) != 0;
+		int side = argc < 3 ? files._ccNum : strToInt(argv[2]);
 		int x = argc < 4 ? 8 : strToInt(argv[3]);
 		int y = argc < 5 ? 8 : strToInt(argv[4]);
 
-		map._loadDarkSide = side;
+		map._loadCcNum = side;
 		map.load(mapId);
 		party._mazePosition.x = x;
 		party._mazePosition.y = y;
diff --git a/engines/xeen/dialogs/dialogs_control_panel.cpp b/engines/xeen/dialogs/dialogs_control_panel.cpp
index 17c86ad..5c4ed16 100644
--- a/engines/xeen/dialogs/dialogs_control_panel.cpp
+++ b/engines/xeen/dialogs/dialogs_control_panel.cpp
@@ -97,11 +97,11 @@ int ControlPanel::execute() {
 					sound.playFX(51);
 
 					if (g_vm->getGameID() == GType_WorldOfXeen) {
-						map._loadDarkSide = false;
+						map._loadCcNum = 0;
 						map.load(28);
 						party._mazeDirection = DIR_EAST;
 					} else {
-						map._loadDarkSide = true;
+						map._loadCcNum = 1;
 						map.load(29);
 						party._mazeDirection = DIR_SOUTH;
 					}
diff --git a/engines/xeen/dialogs/dialogs_create_char.cpp b/engines/xeen/dialogs/dialogs_create_char.cpp
index 72f1b74..3115fbd 100644
--- a/engines/xeen/dialogs/dialogs_create_char.cpp
+++ b/engines/xeen/dialogs/dialogs_create_char.cpp
@@ -597,7 +597,7 @@ bool CreateCharacterDialog::saveCharacter(Character &c, int classId, Race race,
 	c.clear();
 	c._name = name;
 	c._savedMazeId = party._priorMazeId;
-	c._xeenSide = map._loadDarkSide;
+	c._xeenSide = map._loadCcNum;
 	c._sex = sex;
 	c._race = race;
 	c._class = (CharacterClass)classId;
diff --git a/engines/xeen/dialogs/dialogs_party.cpp b/engines/xeen/dialogs/dialogs_party.cpp
index c3d6843..306d1f9 100644
--- a/engines/xeen/dialogs/dialogs_party.cpp
+++ b/engines/xeen/dialogs/dialogs_party.cpp
@@ -65,7 +65,7 @@ void PartyDialog::execute() {
 		_charList.clear();
 		for (int i = 0; i < XEEN_TOTAL_CHARACTERS; ++i) {
 			Character &player = party._roster[i];
-			if (player._name.empty() || player._xeenSide != (map._loadDarkSide ? 1 : 0))
+			if (player._name.empty() || player._xeenSide != map._loadCcNum)
 				continue;
 
 			_charList.push_back(i);
diff --git a/engines/xeen/dialogs/dialogs_spells.cpp b/engines/xeen/dialogs/dialogs_spells.cpp
index 11c4998..296bf29 100644
--- a/engines/xeen/dialogs/dialogs_spells.cpp
+++ b/engines/xeen/dialogs/dialogs_spells.cpp
@@ -777,7 +777,7 @@ bool LloydsBeacon::execute() {
 				result = false;
 			} else {
 				sound.playFX(51);
-				map._loadDarkSide = ccNum;
+				map._loadCcNum = ccNum;
 				if (c._lloydMap != party._mazeId || c._lloydSide != ccNum) {
 					map.load(c._lloydMap);
 				}
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index afa0bbb..201f98c 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -850,7 +850,7 @@ void Interface::startFalling(bool flag) {
 				break;
 			case 103:
 			case 104:
-				map._loadDarkSide = false;
+				map._loadCcNum = 0;
 				party._mazeId = 8;
 				party._mazePosition = Common::Point(11, 15);
 				party._mazeDirection = DIR_NORTH;
@@ -1729,7 +1729,7 @@ void Interface::doCombat() {
 
 	if (reloadMap) {
 		sound.playFX(51);
-		map._loadDarkSide = _vm->getGameID() != GType_WorldOfXeen;
+		map._loadCcNum = _vm->getGameID() != GType_WorldOfXeen ? 1 : 0;
 		map.load(_vm->getGameID() == GType_WorldOfXeen ? 28 : 29);
 		party._mazeDirection = _vm->getGameID() == GType_WorldOfXeen ?
 			DIR_EAST : DIR_SOUTH;
diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp
index f22a438..f1d5348 100644
--- a/engines/xeen/locations.cpp
+++ b/engines/xeen/locations.cpp
@@ -710,7 +710,7 @@ Character *TavernLocation::doOptions(Character *c) {
 		party._priorMazeId = party._mazeId;
 		for (idx = 0; idx < (int)party._activeParty.size(); ++idx) {
 			party._activeParty[idx]._savedMazeId = party._mazeId;
-			party._activeParty[idx]._xeenSide = map._loadDarkSide;
+			party._activeParty[idx]._xeenSide = map._loadCcNum;
 		}
 
 		g_vm->_mode = MODE_17;
@@ -1472,7 +1472,7 @@ void ReaperCutscene::getNewLocation() {
 		switch (party._mazeId) {
 		case 7:
 			if (party._questItems[30]) {
-				map._loadDarkSide = true;
+				map._loadCcNum = 1;
 				_mazeId = 113;
 				_mazePos = Common::Point(7, 4);
 				_mazeDir = DIR_NORTH;
@@ -1491,7 +1491,7 @@ void ReaperCutscene::getNewLocation() {
 
 		case 13:
 			if (party._questItems[29]) {
-				map._loadDarkSide = true;
+				map._loadCcNum = 1;
 				_mazeId = 117;
 				_mazePos = Common::Point(7, 4);
 				_mazeDir = DIR_NORTH;
@@ -1778,7 +1778,7 @@ void GolemCutscene::getNewLocation() {
 
 		case 19:
 			if (party._questItems[50]) {
-				map._loadDarkSide = true;
+				map._loadCcNum = 1;
 				_mazeId = 121;
 				_mazePos = Common::Point(18, 0);
 				_mazeDir = DIR_NORTH;
@@ -2138,7 +2138,7 @@ void SphinxCutscene::getNewLocation() {
 	switch (party._mazeId) {
 	case 2:
 		if (party._questItems[51]) {
-			map._loadDarkSide = true;
+			map._loadCcNum = 1;
 			_mazeId = 125;
 			_mazePos = Common::Point(7, 6);
 			_mazeDir = DIR_NORTH;
@@ -2195,7 +2195,7 @@ int PyramidLocation::show() {
 		}
 
 		// Load the destination map and set position and direction
-		map._loadDarkSide = !_ccNum;
+		map._loadCcNum = _ccNum ? 0 : 1;
 		map.load(mapId);
 		party._mazePosition = pt;
 		party._mazeDirection = dir;
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index c286d2a..ca17ba0 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -604,7 +604,7 @@ void AnimationInfo::load(const Common::String &name) {
 /*------------------------------------------------------------------------*/
 
 Map::Map(XeenEngine *vm) : _vm(vm), _mobData(vm) {
-	_loadDarkSide = false;
+	_loadCcNum = 0;
 	_sideTownPortal = 0;
 	_sideObjects = 0;
 	_sideMonsters = 0;
@@ -648,7 +648,7 @@ void Map::load(int mapId) {
 	if (mapId >= 113 && mapId <= 127) {
 		_sideTownPortal = 0;
 	} else {
-		_sideTownPortal = _loadDarkSide ? 1 : 0;
+		_sideTownPortal = _loadCcNum;
 	}
 
 	if (_vm->getGameID() == GType_Swords || _vm->getGameID() == GType_DarkSide) {
@@ -662,7 +662,7 @@ void Map::load(int mapId) {
 	} else if (_vm->getGameID() == GType_WorldOfXeen) {
 		files.setGameCc(1);
 
-		if (!_loadDarkSide) {
+		if (!_loadCcNum) {
 			_animationInfo.load("clouds.dat");
 			_monsterData.load("xeen.mon");
 			_wallPicSprites.load("xeenpic.dat");
@@ -709,7 +709,7 @@ void Map::load(int mapId) {
 			}
 		}
 
-		files.setGameCc(_loadDarkSide);
+		files.setGameCc(_loadCcNum);
 	}
 
 	// Load any events for the new map
diff --git a/engines/xeen/map.h b/engines/xeen/map.h
index a0bc77a..fc591fc 100644
--- a/engines/xeen/map.h
+++ b/engines/xeen/map.h
@@ -454,7 +454,7 @@ public:
 	int _currentTile;
 	int _currentSurfaceId;
 	bool _currentSteppedOn;
-	bool _loadDarkSide;
+	int _loadCcNum;
 	int _sideTownPortal;
 public:
 	Map(XeenEngine *vm);
diff --git a/engines/xeen/saves.cpp b/engines/xeen/saves.cpp
index a87bba6..a055627 100644
--- a/engines/xeen/saves.cpp
+++ b/engines/xeen/saves.cpp
@@ -195,7 +195,7 @@ Common::Error SavesManager::loadGameState(int slot) {
 
 	// Load the new map
 	map.clearMaze();
-	map._loadDarkSide = files._ccNum;
+	map._loadCcNum = files._ccNum;
 	map.load(party._mazeId);
 
 	delete saveFile;
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 1425f03..2ffdcd1 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -1446,7 +1446,7 @@ bool Scripts::cmdCutsceneEndWorld(ParamsIterator &params) {
 }
 
 bool Scripts::cmdFlipWorld(ParamsIterator &params) {
-	_vm->_map->_loadDarkSide = params.readByte() != 0;
+	_vm->_map->_loadCcNum = params.readByte();
 	return true;
 }
 
diff --git a/engines/xeen/spells.cpp b/engines/xeen/spells.cpp
index d85241a..2ec2e70 100644
--- a/engines/xeen/spells.cpp
+++ b/engines/xeen/spells.cpp
@@ -1246,7 +1246,7 @@ void Spells::townPortal() {
 		return;
 
 	sound.playFX(51);
-	map._loadDarkSide = map._sideTownPortal;
+	map._loadCcNum = map._sideTownPortal;
 	_vm->_files->_ccNum = map._sideTownPortal > 0;
 	map.load(Res.TOWN_MAP_NUMBERS[map._sideTownPortal][townNumber - 1]);
 
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index bf71c8e..d86cc43 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -209,8 +209,8 @@ void XeenEngine::play() {
 	_screen->loadBackground("back.raw");
 	_screen->loadPalette("mm4.pal");
 
-	if (getGameID() == GType_DarkSide && !_map->_loadDarkSide) {
-		_map->_loadDarkSide = true;
+	if (getGameID() == GType_DarkSide && !_map->_loadCcNum) {
+		_map->_loadCcNum = 1;
 		_party->_mazeId = 29;
 		_party->_mazeDirection = DIR_NORTH;
 		_party->_mazePosition.x = 25;


Commit: 2be2339a21eb244d5122f798397efe23cffebdc7
    https://github.com/scummvm/scummvm/commit/2be2339a21eb244d5122f798397efe23cffebdc7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-03-27T21:52:20-04:00

Commit Message:
XEEN: Simplify debugger map command

Changed paths:
    engines/xeen/debugger.cpp


diff --git a/engines/xeen/debugger.cpp b/engines/xeen/debugger.cpp
index bd6c8ad..4fbef4f 100644
--- a/engines/xeen/debugger.cpp
+++ b/engines/xeen/debugger.cpp
@@ -165,15 +165,15 @@ bool Debugger::cmdMap(int argc, const char **argv) {
 	Party &party = *g_vm->_party;
 
 	if (argc < 2) {
-		debugPrintf("map mapId [ sideNum [ xp, yp ]]\n");
+		debugPrintf("map mapId [ xp, yp ] [ sideNum ]\n");
 		return true;
 	} else {
 		int mapId = strToInt(argv[1]);
-		int side = argc < 3 ? files._ccNum : strToInt(argv[2]);
-		int x = argc < 4 ? 8 : strToInt(argv[3]);
-		int y = argc < 5 ? 8 : strToInt(argv[4]);
-
-		map._loadCcNum = side;
+		int x = argc < 3 ? 8 : strToInt(argv[2]);
+		int y = argc < 4 ? 8 : strToInt(argv[3]);
+		
+		if (argc == 5)
+			map._loadCcNum = strToInt(argv[4]);
 		map.load(mapId);
 		party._mazePosition.x = x;
 		party._mazePosition.y = y;





More information about the Scummvm-git-logs mailing list