[Scummvm-cvs-logs] scummvm master -> 001cf8ed509a93675b384fb406d21b05a7abef37

Strangerke Strangerke at scummvm.org
Mon Dec 2 07:23:14 CET 2013


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:
001cf8ed50 TSAGE: R2R - Move variable from scene 1337 to r2_globals, add command to debugger


Commit: 001cf8ed509a93675b384fb406d21b05a7abef37
    https://github.com/scummvm/scummvm/commit/001cf8ed509a93675b384fb406d21b05a7abef37
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-12-01T22:21:27-08:00

Commit Message:
TSAGE: R2R - Move variable from scene 1337 to r2_globals, add command to debugger

Changed paths:
    engines/tsage/debugger.cpp
    engines/tsage/debugger.h
    engines/tsage/globals.cpp
    engines/tsage/globals.h
    engines/tsage/ringworld2/ringworld2_scenes1.cpp
    engines/tsage/ringworld2/ringworld2_scenes1.h



diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index c7da5f5..e81e5cd 100644
--- a/engines/tsage/debugger.cpp
+++ b/engines/tsage/debugger.cpp
@@ -30,18 +30,19 @@
 namespace TsAGE {
 
 Debugger::Debugger() : GUI::Debugger() {
-	DCmd_Register("continue",		WRAP_METHOD(Debugger, Cmd_Exit));
-	DCmd_Register("scene",			WRAP_METHOD(Debugger, Cmd_Scene));
-	DCmd_Register("walk_regions",	WRAP_METHOD(Debugger, Cmd_WalkRegions));
-	DCmd_Register("priority_regions",	WRAP_METHOD(Debugger, Cmd_PriorityRegions));
-	DCmd_Register("scene_regions",	WRAP_METHOD(Debugger, Cmd_SceneRegions));
-	DCmd_Register("setflag",		WRAP_METHOD(Debugger, Cmd_SetFlag));
-	DCmd_Register("getflag",		WRAP_METHOD(Debugger, Cmd_GetFlag));
-	DCmd_Register("clearflag",		WRAP_METHOD(Debugger, Cmd_ClearFlag));
-	DCmd_Register("listobjects",	WRAP_METHOD(Debugger, Cmd_ListObjects));
-	DCmd_Register("moveobject",		WRAP_METHOD(Debugger, Cmd_MoveObject));
-	DCmd_Register("hotspots",		WRAP_METHOD(Debugger, Cmd_Hotspots));
-	DCmd_Register("sound",			WRAP_METHOD(Debugger, Cmd_Sound));
+	DCmd_Register("continue",         WRAP_METHOD(Debugger, Cmd_Exit));
+	DCmd_Register("scene",            WRAP_METHOD(Debugger, Cmd_Scene));
+	DCmd_Register("walk_regions",     WRAP_METHOD(Debugger, Cmd_WalkRegions));
+	DCmd_Register("priority_regions", WRAP_METHOD(Debugger, Cmd_PriorityRegions));
+	DCmd_Register("scene_regions",    WRAP_METHOD(Debugger, Cmd_SceneRegions));
+	DCmd_Register("setflag",          WRAP_METHOD(Debugger, Cmd_SetFlag));
+	DCmd_Register("getflag",          WRAP_METHOD(Debugger, Cmd_GetFlag));
+	DCmd_Register("clearflag",        WRAP_METHOD(Debugger, Cmd_ClearFlag));
+	DCmd_Register("listobjects",      WRAP_METHOD(Debugger, Cmd_ListObjects));
+	DCmd_Register("moveobject",       WRAP_METHOD(Debugger, Cmd_MoveObject));
+	DCmd_Register("hotspots",         WRAP_METHOD(Debugger, Cmd_Hotspots));
+	DCmd_Register("sound",            WRAP_METHOD(Debugger, Cmd_Sound));
+	DCmd_Register("setdebug",         WRAP_METHOD(Debugger, Cmd_SetDebug));
 }
 
 static int strToInt(const char *s) {
@@ -340,6 +341,14 @@ bool Debugger::Cmd_Sound(int argc, const char **argv) {
 	return false;
 }
 
+/**
+ * Activate internal debugger, when available
+ */
+bool Debugger::Cmd_SetDebug(int argc, const char **argv) {
+	DebugPrintf("Not available in this game\n");
+	return true;
+}
+
 /*
  * This command lists the objects available, and their ID
  */
@@ -707,4 +716,19 @@ bool Ringworld2Debugger::Cmd_MoveObject(int argc, const char **argv) {
 
 	return true;
 }
+
+/**
+ * Activate internal debugger, when available
+ */
+bool Ringworld2Debugger::Cmd_SetDebug(int argc, const char **argv) {
+	if (argc != 1) {
+		DebugPrintf("Usage: %s\n", argv[0]);
+		return true;
+	}
+
+	// Set the internal debugger flag(s?) to true
+	// _debugCardGame is reset by scene1337::subPostInit()
+	R2_GLOBALS._debugCardGame = true;
+	return true;
+}
 } // End of namespace TsAGE
diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h
index bf826a3..c9b7e75 100644
--- a/engines/tsage/debugger.h
+++ b/engines/tsage/debugger.h
@@ -45,6 +45,7 @@ protected:
 	bool Cmd_Sound(int argc, const char **argv);
 	virtual bool Cmd_ListObjects(int argc, const char **argv) = 0;
 	virtual bool Cmd_MoveObject(int argc, const char **argv) = 0;
+	virtual bool Cmd_SetDebug(int argc, const char **argv);
 };
 
 class DemoDebugger : public Debugger {
@@ -69,6 +70,7 @@ class Ringworld2Debugger : public Debugger {
 protected:
 	virtual bool Cmd_ListObjects(int argc, const char **argv);
 	virtual bool Cmd_MoveObject(int argc, const char **argv);
+	virtual bool Cmd_SetDebug(int argc, const char **argv);
 };
 
 } // End of namespace TsAGE
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 388f6f7..0f27164 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -457,6 +457,8 @@ Ringworld2Globals::Ringworld2Globals() {
 	_foodCount = 0;
 	_rimLocation = 0;
 	_rimTransportLocation = 0;
+
+	_debugCardGame = false;
 }
 
 Ringworld2Globals::~Ringworld2Globals() {
@@ -583,6 +585,8 @@ void Ringworld2Globals::reset() {
 	_player._characterScene[R2_QUINN] = 100;
 	_player._characterScene[R2_SEEKER] = 300;
 	_player._characterScene[R2_MIRANDA] = 300;
+
+	_debugCardGame = false;
 }
 
 void Ringworld2Globals::synchronize(Serializer &s) {
diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h
index 92c3d2e..f5543af 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -292,6 +292,7 @@ public:
 	byte _stripManager_lookupList[12];
 	byte _scene1550JunkLocations[508];
 	Common::Point _balloonPosition;
+	bool _debugCardGame;               // moved from scene 1337 so it can be easily set in the debugger
 
 	ScannerDialog *_scannerDialog;
 
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index 44bd864..d174d6f 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -2247,7 +2247,6 @@ Scene1337::Scene1337() {
 	_field4242 = 0;
 	_field4244 = false;
 	_field4246 = false;
-	_field4248 = 0;
 	_field424A = 0;
 	_instructionsDisplayedFl = 0;
 	_instructionsWaitCount = 0;
@@ -3398,7 +3397,7 @@ void Scene1337::Action4::signal() {
 			scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.fixPriority(170);
 		}
 
-		if ((scene->_field4248 == 1) || (scene->_currentPlayerNumb == 2))
+		if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2))
 			scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]);
 
 		scene->_animatedCard._card.hide();
@@ -3433,7 +3432,7 @@ void Scene1337::Action4::signal() {
 			scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.fixPriority(170);
 		}
 
-		if ((scene->_field4248 == 1) || (scene->_currentPlayerNumb == 2))
+		if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2))
 			scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]);
 
 		scene->_animatedCard._card.hide();
@@ -3468,7 +3467,7 @@ void Scene1337::Action4::signal() {
 			scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.fixPriority(170);
 		}
 
-		if ((scene->_field4248 == 1) || (scene->_currentPlayerNumb == 2))
+		if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2))
 			scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]);
 
 		scene->_animatedCard._card.hide();
@@ -3503,7 +3502,7 @@ void Scene1337::Action4::signal() {
 			scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.fixPriority(170);
 		}
 
-		if ((scene->_field4248 == 1) || (scene->_currentPlayerNumb == 2))
+		if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2))
 			scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]);
 
 		scene->_animatedCard._card.hide();
@@ -5529,7 +5528,6 @@ void Scene1337::subPostInit() {
 
 	_field4244 = true;
 	_field4246 = false;
-	_field4248 = 0;
 	_field424A = -1;
 
 	_background1.setup2(9531, 1, 1, 249, 168, 155, 0);
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h
index 0d4cf59..45ed746 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.h
@@ -312,7 +312,6 @@ public:
 	int _field4242;
 	bool _field4244;
 	bool _field4246;
-	int _field4248;
 	int _field424A;
 	int _instructionsDisplayedFl;
 	int _instructionsWaitCount;






More information about the Scummvm-git-logs mailing list