From 5357724657bff809b10b1f2bfe8547d1b53d6dcb Mon Sep 17 00:00:00 2001 From: Kamil Zbróg Date: Thu, 24 Oct 2013 20:31:08 +0100 Subject: PRINCE: code cleanup --- engines/prince/debugger.cpp | 98 ++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'engines/prince/debugger.cpp') 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 \n", argv[0]); - return true; - } + // Check for a flag to set + if (argc != 2) { + DebugPrintf("Usage: %s \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 \n", argv[0]); - return true; - } + // Check for an flag to display + if (argc != 2) { + DebugPrintf("Usage: %s \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 \n", argv[0]); - return true; - } + // Check for a flag to clear + if (argc != 2) { + DebugPrintf("Usage: %s \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 \n", argv[0]); - return true; - } + // Check for a flag to clear + if (argc != 2) { + DebugPrintf("Usage: %s \n", argv[0]); + return true; + } - int flagNum = strToInt(argv[1]); + int flagNum = strToInt(argv[1]); _vm->loadAnim(flagNum); - return true; + return true; } } -- cgit v1.2.3