aboutsummaryrefslogtreecommitdiff
path: root/engines/prince/debugger.cpp
diff options
context:
space:
mode:
authorKamil Zbróg2013-10-24 20:31:08 +0100
committerKamil Zbróg2013-10-24 20:31:08 +0100
commit5357724657bff809b10b1f2bfe8547d1b53d6dcb (patch)
tree30b80321182fea4cc375c8734402b84a34dd0e1b /engines/prince/debugger.cpp
parentaccb9e10e8ee0c607c9fd2ec048af34b5058336f (diff)
downloadscummvm-rg350-5357724657bff809b10b1f2bfe8547d1b53d6dcb.tar.gz
scummvm-rg350-5357724657bff809b10b1f2bfe8547d1b53d6dcb.tar.bz2
scummvm-rg350-5357724657bff809b10b1f2bfe8547d1b53d6dcb.zip
PRINCE: code cleanup
Diffstat (limited to 'engines/prince/debugger.cpp')
-rw-r--r--engines/prince/debugger.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/engines/prince/debugger.cpp b/engines/prince/debugger.cpp
index 56053afb28..5da11acd88 100644
--- a/engines/prince/debugger.cpp
+++ b/engines/prince/debugger.cpp
@@ -11,7 +11,7 @@
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
@@ -26,86 +26,86 @@
namespace Prince {
Debugger::Debugger(PrinceEngine *vm) : GUI::Debugger(), _vm(vm) {
- DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
- 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("viewflc", WRAP_METHOD(Debugger, Cmd_ViewFlc));
+ DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
+ 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("viewflc", WRAP_METHOD(Debugger, Cmd_ViewFlc));
}
static int strToInt(const char *s) {
- if (!*s)
- // No string at all
- return 0;
- else if (toupper(s[strlen(s) - 1]) != 'H')
- // Standard decimal string
- return atoi(s);
+ if (!*s)
+ // No string at all
+ return 0;
+ else if (toupper(s[strlen(s) - 1]) != 'H')
+ // Standard decimal string
+ return atoi(s);
- // Hexadecimal string
- uint tmp = 0;
- int read = sscanf(s, "%xh", &tmp);
- if (read < 1)
- error("strToInt failed on string \"%s\"", s);
- return (int)tmp;
+ // Hexadecimal string
+ uint tmp = 0;
+ int read = sscanf(s, "%xh", &tmp);
+ if (read < 1)
+ error("strToInt failed on string \"%s\"", s);
+ return (int)tmp;
}
/*
* 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;
- }
+ // Check for a flag to set
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+ return true;
+ }
- int flagNum = strToInt(argv[1]);
- //g_globals->setFlag(flagNum);
- return true;
+ int flagNum = strToInt(argv[1]);
+ //g_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;
- }
+ // 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", g_globals->getFlag(flagNum));
- return true;
+ int flagNum = strToInt(argv[1]);
+ //DebugPrintf("Value: %d\n", g_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;
- }
+ // Check for a flag to clear
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+ return true;
+ }
- int flagNum = strToInt(argv[1]);
- //g_globals->clearFlag(flagNum);
- return true;
+ int flagNum = strToInt(argv[1]);
+ //g_globals->clearFlag(flagNum);
+ return true;
}
/*
* This command starts new flc anim
*/
bool Debugger::Cmd_ViewFlc(int argc, const char **argv) {
- // Check for a flag to clear
- if (argc != 2) {
- DebugPrintf("Usage: %s <anim number>\n", argv[0]);
- return true;
- }
+ // Check for a flag to clear
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <anim number>\n", argv[0]);
+ return true;
+ }
- int flagNum = strToInt(argv[1]);
+ int flagNum = strToInt(argv[1]);
_vm->loadAnim(flagNum);
- return true;
+ return true;
}
}