diff options
author | Martin Kiewitz | 2010-01-05 21:25:59 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-01-05 21:25:59 +0000 |
commit | d183420c8659181990dc8abf21ca9211473fd09e (patch) | |
tree | cda219c4e2c9f1dd9719b7d6507ad187eb63b3ec | |
parent | 083cab51573612f46e0a2aa6d65afb3c097fd7fa (diff) | |
download | scummvm-rg350-d183420c8659181990dc8abf21ca9211473fd09e.tar.gz scummvm-rg350-d183420c8659181990dc8abf21ca9211473fd09e.tar.bz2 scummvm-rg350-d183420c8659181990dc8abf21ca9211473fd09e.zip |
SCI: implemented debug command "set_palette"
svn-id: r47047
-rw-r--r-- | engines/sci/console.cpp | 16 | ||||
-rw-r--r-- | engines/sci/console.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 2e179a7cb9..d2e885c0f7 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -108,6 +108,7 @@ Console::Console(SciEngine *vm) : GUI::Debugger() { // Screen DCmd_Register("show_map", WRAP_METHOD(Console, cmdShowMap)); // Graphics + DCmd_Register("set_palette", WRAP_METHOD(Console, cmdSetPalette)); DCmd_Register("draw_pic", WRAP_METHOD(Console, cmdDrawPic)); DCmd_Register("draw_cel", WRAP_METHOD(Console, cmdDrawCel)); DCmd_Register("undither", WRAP_METHOD(Console, cmdUndither)); @@ -307,6 +308,7 @@ bool Console::cmdHelp(int argc, const char **argv) { DebugPrintf(" exit - Exits the game\n"); DebugPrintf("\n"); DebugPrintf("Graphics:\n"); + DebugPrintf(" set_palette - Sets a palette resource\n"); DebugPrintf(" draw_pic - Draws a pic resource\n"); DebugPrintf(" draw_cel - Draws a cel from a view resource\n"); DebugPrintf(" undither - Enable/disable undithering\n"); @@ -971,6 +973,20 @@ bool Console::cmdParserNodes(int argc, const char **argv) { return true; } +bool Console::cmdSetPalette(int argc, const char **argv) { + if (argc < 2) { + DebugPrintf("Sets a palette resource\n"); + DebugPrintf("Usage: %s <resourceId>\n", argv[0]); + DebugPrintf("where <resourceId> is the number of the palette resource to set\n"); + return true; + } + + uint16 resourceId = atoi(argv[1]); + + _vm->_gamestate->_gui->paletteSet(resourceId, 2); + return true; +} + bool Console::cmdDrawPic(int argc, const char **argv) { if (argc < 2) { DebugPrintf("Draws a pic resource\n"); diff --git a/engines/sci/console.h b/engines/sci/console.h index 5509bb05c6..de3d7e566f 100644 --- a/engines/sci/console.h +++ b/engines/sci/console.h @@ -83,6 +83,7 @@ private: // Screen bool cmdShowMap(int argc, const char **argv); // Graphics + bool cmdSetPalette(int argc, const char **argv); bool cmdDrawPic(int argc, const char **argv); bool cmdDrawCel(int argc, const char **argv); bool cmdUndither(int argc, const char **argv); |