diff options
author | Travis Howell | 2006-11-09 10:41:29 +0000 |
---|---|---|
committer | Travis Howell | 2006-11-09 10:41:29 +0000 |
commit | f334797caa7ab377b2b9be0d6b9115ae263facdc (patch) | |
tree | b4db168cbf7edf43b3e355cb200dd0428a8eb4ba | |
parent | 3213bc322bd0790b8bbeddbb6ef76e7091ba8730 (diff) | |
download | scummvm-rg350-f334797caa7ab377b2b9be0d6b9115ae263facdc.tar.gz scummvm-rg350-f334797caa7ab377b2b9be0d6b9115ae263facdc.tar.bz2 scummvm-rg350-f334797caa7ab377b2b9be0d6b9115ae263facdc.zip |
Add debugger command, to allow object flag vlaues to be altered.
svn-id: r24663
-rw-r--r-- | engines/agos/debugger.cpp | 36 | ||||
-rw-r--r-- | engines/agos/debugger.h | 1 |
2 files changed, 37 insertions, 0 deletions
diff --git a/engines/agos/debugger.cpp b/engines/agos/debugger.cpp index 485eac4483..f0d6d9a53b 100644 --- a/engines/agos/debugger.cpp +++ b/engines/agos/debugger.cpp @@ -41,6 +41,7 @@ Debugger::Debugger(AGOSEngine *vm) DCmd_Register("voice", WRAP_METHOD(Debugger, Cmd_PlayVoice)); DCmd_Register("bit", WRAP_METHOD(Debugger, Cmd_SetBit)); DCmd_Register("var", WRAP_METHOD(Debugger, Cmd_SetVar)); + DCmd_Register("obj", WRAP_METHOD(Debugger, Cmd_SetObjectFlag)); DCmd_Register("sub", WRAP_METHOD(Debugger, Cmd_StartSubroutine)); } @@ -162,6 +163,41 @@ bool Debugger::Cmd_SetVar(int argc, const char **argv) { return true; } +bool Debugger::Cmd_SetObjectFlag(int argc, const char **argv) { + uint obj, prop, value; + if (argc > 2) { + obj = atoi(argv[1]); + prop = atoi(argv[2]); + + if (obj >= 1 && obj < _vm->_itemArraySize) { + SubObject *o = (SubObject *)_vm->findChildOfType(_vm->derefItem(obj), 2); + if (o != NULL) { + if (o->objectFlags & (1 << prop) && prop < 16) { + uint offs = _vm->getOffsetOfChild2Param(o, 1 << prop); + if (argc > 3) { + value = atoi(argv[3]); + o->objectFlagValue[offs] = value; + DebugPrintf("Object %d Flag %d set to %d\n", obj, prop, value); + } else { + value = o->objectFlagValue[offs]; + DebugPrintf("Object %d Flag %d is %d\n", obj, prop, value); + } + } else { + DebugPrintf("Object flag out of range\n"); + } + } else { + DebugPrintf("Item isn't an object\n"); + } + } else { + DebugPrintf("Item out of range (1 - %d)\n", _vm->_itemArraySize - 1); + } + } else { + DebugPrintf("Syntax: obj <itemnum> <flag> <value>\n"); + } + + return true; +} + bool Debugger::Cmd_StartSubroutine(int argc, const char **argv) { if (argc > 1) { uint subroutine = atoi(argv[1]); diff --git a/engines/agos/debugger.h b/engines/agos/debugger.h index fc1ae748ac..78791649de 100644 --- a/engines/agos/debugger.h +++ b/engines/agos/debugger.h @@ -47,6 +47,7 @@ protected: bool Cmd_PlayVoice(int argc, const char **argv); bool Cmd_SetBit(int argc, const char **argv); bool Cmd_SetVar(int argc, const char **argv); + bool Cmd_SetObjectFlag(int argc, const char **argv); bool Cmd_StartSubroutine(int argc, const char **argv); }; |