diff options
Diffstat (limited to 'engines/mohawk/console.cpp')
-rw-r--r-- | engines/mohawk/console.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 3eed08e3c1..e25ff030d0 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -502,7 +502,7 @@ bool RivenConsole::Cmd_DumpScript(int argc, const char **argv) { _vm->changeToStack(newStack); // Load in Variable Names - Common::SeekableReadStream *nameStream = _vm->getRawData(ID_NAME, VariableNames); + Common::SeekableReadStream *nameStream = _vm->getResource(ID_NAME, VariableNames); Common::StringArray varNames; uint16 namesCount = nameStream->readUint16BE(); @@ -523,7 +523,7 @@ bool RivenConsole::Cmd_DumpScript(int argc, const char **argv) { delete nameStream; // Load in External Command Names - nameStream = _vm->getRawData(ID_NAME, ExternalCommandNames); + nameStream = _vm->getResource(ID_NAME, ExternalCommandNames); Common::StringArray xNames; namesCount = nameStream->readUint16BE(); @@ -545,9 +545,15 @@ bool RivenConsole::Cmd_DumpScript(int argc, const char **argv) { // Get CARD/HSPT data and dump their scripts if (!scumm_stricmp(argv[2], "CARD")) { - printf ("\n\nDumping scripts for %s\'s card %d!\n", argv[1], (uint16)atoi(argv[3])); - printf ("==================================\n\n"); - Common::SeekableReadStream *cardStream = _vm->getRawData(MKID_BE('CARD'), (uint16)atoi(argv[3])); + // Use debugN to print these because the scripts can get very large and would + // really be useless if the the text console is not used. A DumpFile could also + // theoretically be used, but I (clone2727) typically use this dynamically and + // don't want countless files laying around without game context. If one would + // want a file of a script they could just redirect stdout to a file or use + // deriven. + debugN("\n\nDumping scripts for %s\'s card %d!\n", argv[1], (uint16)atoi(argv[3])); + debugN("==================================\n\n"); + Common::SeekableReadStream *cardStream = _vm->getResource(MKID_BE('CARD'), (uint16)atoi(argv[3])); cardStream->seek(4); RivenScriptList scriptList = _vm->_scriptMan->readScripts(cardStream, false); for (uint32 i = 0; i < scriptList.size(); i++) { @@ -556,15 +562,16 @@ bool RivenConsole::Cmd_DumpScript(int argc, const char **argv) { } delete cardStream; } else if (!scumm_stricmp(argv[2], "HSPT")) { - printf ("\n\nDumping scripts for %s\'s card %d hotspots!\n", argv[1], (uint16)atoi(argv[3])); - printf ("===========================================\n\n"); + // See above for why this is printed via debugN + debugN("\n\nDumping scripts for %s\'s card %d hotspots!\n", argv[1], (uint16)atoi(argv[3])); + debugN("===========================================\n\n"); - Common::SeekableReadStream *hsptStream = _vm->getRawData(MKID_BE('HSPT'), (uint16)atoi(argv[3])); + Common::SeekableReadStream *hsptStream = _vm->getResource(MKID_BE('HSPT'), (uint16)atoi(argv[3])); uint16 hotspotCount = hsptStream->readUint16BE(); for (uint16 i = 0; i < hotspotCount; i++) { - printf ("Hotspot %d:\n", i); + debugN("Hotspot %d:\n", i); hsptStream->seek(22, SEEK_CUR); // Skip non-script related stuff RivenScriptList scriptList = _vm->_scriptMan->readScripts(hsptStream, false); for (uint32 j = 0; j < scriptList.size(); j++) { @@ -578,7 +585,8 @@ bool RivenConsole::Cmd_DumpScript(int argc, const char **argv) { DebugPrintf("%s doesn't have any scripts!\n", argv[2]); } - printf("\n\n"); + // See above for why this is printed via debugN + debugN("\n\n"); _vm->changeToStack(oldStack); @@ -660,13 +668,11 @@ void LivingBooksConsole::postEnter() { bool LivingBooksConsole::Cmd_PlaySound(int argc, const char **argv) { if (argc == 1) { DebugPrintf("Usage: playSound <value>\n"); - return true; } _vm->_sound->stopSound(); _vm->_sound->playSound((uint16)atoi(argv[1])); - return false; } @@ -674,7 +680,6 @@ bool LivingBooksConsole::Cmd_StopSound(int argc, const char **argv) { DebugPrintf("Stopping Sound\n"); _vm->_sound->stopSound(); - return true; } @@ -684,11 +689,8 @@ bool LivingBooksConsole::Cmd_DrawImage(int argc, const char **argv) { return true; } - if (_vm->getGameType() == GType_LIVINGBOOKSV1) - DebugPrintf("This isn't supported in the old Living Books games (yet)!\n"); - _vm->_gfx->copyImageToScreen((uint16)atoi(argv[1])); - return _vm->getGameType() != GType_LIVINGBOOKSV1; + return false; } } // End of namespace Mohawk |