From 2644d084480d537388cc7f585338ff2bf0490b38 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 11 Dec 2014 13:25:37 +0200 Subject: ZVISION: Add functionality to show the current location. Some cleanup --- engines/zvision/core/console.cpp | 38 ++++++++++++++++---------------------- engines/zvision/core/console.h | 3 +-- 2 files changed, 17 insertions(+), 24 deletions(-) (limited to 'engines/zvision/core') diff --git a/engines/zvision/core/console.cpp b/engines/zvision/core/console.cpp index e641783338..0f6cbfc96f 100644 --- a/engines/zvision/core/console.cpp +++ b/engines/zvision/core/console.cpp @@ -51,14 +51,13 @@ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) { registerCmd("generaterendertable", WRAP_METHOD(Console, cmdGenerateRenderTable)); registerCmd("setpanoramafov", WRAP_METHOD(Console, cmdSetPanoramaFoV)); registerCmd("setpanoramascale", WRAP_METHOD(Console, cmdSetPanoramaScale)); - registerCmd("changelocation", WRAP_METHOD(Console, cmdChangeLocation)); + registerCmd("location", WRAP_METHOD(Console, cmdLocation)); registerCmd("dumpfile", WRAP_METHOD(Console, cmdDumpFile)); - registerCmd("parseallscrfiles", WRAP_METHOD(Console, cmdParseAllScrFiles)); } bool Console::cmdLoadVideo(int argc, const char **argv) { if (argc != 2) { - debugPrintf("Use loadvideo to load a video to the screen\n"); + debugPrintf("Use %s to load a video to the screen\n", argv[0]); return true; } @@ -91,7 +90,7 @@ bool Console::cmdLoadSound(int argc, const char **argv) { Audio::SoundHandle handle; _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &handle, soundStream, -1, 100, 0, DisposeAfterUse::YES, false, false); } else { - debugPrintf("Use loadsound [ ] to load a sound\n"); + debugPrintf("Use %s [ ] to load a sound\n", argv[0]); return true; } @@ -100,7 +99,7 @@ bool Console::cmdLoadSound(int argc, const char **argv) { bool Console::cmdRawToWav(int argc, const char **argv) { if (argc != 3) { - debugPrintf("Use raw2wav to dump a .RAW file to .WAV\n"); + debugPrintf("Use %s to dump a .RAW file to .WAV\n", argv[0]); return true; } @@ -145,7 +144,7 @@ bool Console::cmdRawToWav(int argc, const char **argv) { bool Console::cmdSetRenderState(int argc, const char **argv) { if (argc != 2) { - debugPrintf("Use setrenderstate to change the current render state\n"); + debugPrintf("Use %s to change the current render state\n", argv[0]); return true; } @@ -158,7 +157,7 @@ bool Console::cmdSetRenderState(int argc, const char **argv) { else if (renderState.matchString("flat", true)) _engine->getRenderManager()->getRenderTable()->setRenderState(RenderTable::FLAT); else - debugPrintf("Use setrenderstate to change the current render state\n"); + debugPrintf("Use %s to change the current render state\n", argv[0]); return true; } @@ -171,7 +170,7 @@ bool Console::cmdGenerateRenderTable(int argc, const char **argv) { bool Console::cmdSetPanoramaFoV(int argc, const char **argv) { if (argc != 2) { - debugPrintf("Use setpanoramafov to change the current panorama field of view\n"); + debugPrintf("Use %s to change the current panorama field of view\n", argv[0]); return true; } @@ -182,7 +181,7 @@ bool Console::cmdSetPanoramaFoV(int argc, const char **argv) { bool Console::cmdSetPanoramaScale(int argc, const char **argv) { if (argc != 2) { - debugPrintf("Use setpanoramascale to change the current panorama scale\n"); + debugPrintf("Use %s to change the current panorama scale\n", argv[0]); return true; } @@ -191,9 +190,14 @@ bool Console::cmdSetPanoramaScale(int argc, const char **argv) { return true; } -bool Console::cmdChangeLocation(int argc, const char **argv) { +bool Console::cmdLocation(int argc, const char **argv) { + Location curLocation = _engine->getScriptManager()->getCurrentLocation(); + Common::String scrFile = Common::String::format("%c%c%c%c.scr", curLocation.world, curLocation.room, curLocation.node, curLocation.view); + debugPrintf("Current location: world '%c', room '%c', node '%c', view '%c', offset %d, script %s\n", + curLocation.world, curLocation.room, curLocation.node, curLocation.view, curLocation.offset, scrFile.c_str()); + if (argc != 6) { - debugPrintf("Use changelocation to change your location\n"); + debugPrintf("Use %s to change your location\n", argv[0]); return true; } @@ -204,7 +208,7 @@ bool Console::cmdChangeLocation(int argc, const char **argv) { bool Console::cmdDumpFile(int argc, const char **argv) { if (argc != 2) { - debugPrintf("Use dumpfile to dump a file\n"); + debugPrintf("Use %s to dump a file\n", argv[0]); return true; } @@ -229,14 +233,4 @@ bool Console::cmdDumpFile(int argc, const char **argv) { return true; } -bool Console::cmdParseAllScrFiles(int argc, const char **argv) { - Common::ArchiveMemberList list; - SearchMan.listMatchingMembers(list, "*.scr"); - - for (Common::ArchiveMemberList::iterator iter = list.begin(); iter != list.end(); ++iter) { - } - - return true; -} - } // End of namespace ZVision diff --git a/engines/zvision/core/console.h b/engines/zvision/core/console.h index 994e05ba35..299bd6127f 100644 --- a/engines/zvision/core/console.h +++ b/engines/zvision/core/console.h @@ -44,9 +44,8 @@ private: bool cmdGenerateRenderTable(int argc, const char **argv); bool cmdSetPanoramaFoV(int argc, const char **argv); bool cmdSetPanoramaScale(int argc, const char **argv); - bool cmdChangeLocation(int argc, const char **argv); + bool cmdLocation(int argc, const char **argv); bool cmdDumpFile(int argc, const char **argv); - bool cmdParseAllScrFiles(int argc, const char **argv); }; } // End of namespace ZVision -- cgit v1.2.3