[Scummvm-cvs-logs] scummvm master -> e2f34d19c88a9a0b37c57afbaa07d44c85f1f205

Strangerke arnaud.boutonne at gmail.com
Sun Apr 17 09:34:57 CEST 2011


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:
e2f34d19c8 TSAGE: Add flag commands to the debugger


Commit: e2f34d19c88a9a0b37c57afbaa07d44c85f1f205
    https://github.com/scummvm/scummvm/commit/e2f34d19c88a9a0b37c57afbaa07d44c85f1f205
Author: strangerke (arnaud.boutonne at gmail.com)
Date: 2011-04-17T00:33:53-07:00

Commit Message:
TSAGE: Add flag commands to the debugger

Changed paths:
    engines/tsage/debugger.cpp
    engines/tsage/debugger.h



diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index 9f4d197..730a8f2 100644
--- a/engines/tsage/debugger.cpp
+++ b/engines/tsage/debugger.cpp
@@ -37,6 +37,10 @@ Debugger::Debugger() : GUI::Debugger() {
 	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("setflag",		WRAP_METHOD(Debugger, Cmd_SetFlag));
+	DCmd_Register("getflag",		WRAP_METHOD(Debugger, Cmd_GetFlag));
+	DCmd_Register("clearflag",		WRAP_METHOD(Debugger, Cmd_ClearFlag));
+
 	DCmd_Register("item",			WRAP_METHOD(Debugger, Cmd_Item));
 }
 
@@ -161,6 +165,51 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) {
 	return true;
 }
 
+/*
+ * This command sets a flag
+ */
+bool Debugger::Cmd_SetFlag(int argc, const char **argv) {
+	// Check for a flag to set
+	if (argc != 2) {
+		DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+		return true;
+	}
+
+	int flagNum = strToInt(argv[1]);
+	_globals->setFlag(flagNum);
+	return true;
+}
+
+/*
+ * This command gets the value of a flag
+ */
+bool Debugger::Cmd_GetFlag(int argc, const char **argv) {
+	// Check for an flag to display
+	if (argc != 2) {
+		DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+		return true;
+	}
+
+	int flagNum = strToInt(argv[1]);
+	DebugPrintf("Value: %d\n", _globals->getFlag(flagNum));
+	return true;
+}
+
+/*
+ * This command clears a flag
+ */
+bool Debugger::Cmd_ClearFlag(int argc, const char **argv) {
+	// Check for a flag to clear
+	if (argc != 2) {
+		DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+		return true;
+	}
+
+	int flagNum = strToInt(argv[1]);
+	_globals->clearFlag(flagNum);
+	return true;
+}
+
 /**
  * Give a specified item to the player
  */
@@ -169,4 +218,5 @@ bool Debugger::Cmd_Item(int argc, const char **argv) {
 	return true;
 }
 
+
 } // End of namespace tSage
diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h
index c94d77b..ee097e1 100644
--- a/engines/tsage/debugger.h
+++ b/engines/tsage/debugger.h
@@ -41,6 +41,10 @@ protected:
 	bool Cmd_WalkRegions(int argc, const char **argv);
 	bool Cmd_PriorityRegions(int argc, const char **argv);
 	bool Cmd_Item(int argc, const char **argv);
+	bool Cmd_SetFlag(int argc, const char **argv);
+	bool Cmd_GetFlag(int argc, const char **argv);
+	bool Cmd_ClearFlag(int argc, const char **argv);
+
 };
 
 } // End of namespace tSage






More information about the Scummvm-git-logs mailing list