From a596d1241cf0b443d3c2f8099546bc620116dcb2 Mon Sep 17 00:00:00 2001 From: richiesams Date: Sat, 24 Aug 2013 00:25:21 -0500 Subject: ZVISION: Add console method to dump all .lev files --- engines/zvision/console.cpp | 13 +++++++++++++ engines/zvision/console.h | 1 + 2 files changed, 14 insertions(+) (limited to 'engines/zvision') diff --git a/engines/zvision/console.cpp b/engines/zvision/console.cpp index 69d19ab53a..fd8347e74f 100644 --- a/engines/zvision/console.cpp +++ b/engines/zvision/console.cpp @@ -53,6 +53,7 @@ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) { DCmd_Register("dumpfile", WRAP_METHOD(Console, cmdDumpFile)); DCmd_Register("dumpcursorfilenames", WRAP_METHOD(Console, cmdDumpAllCursorFileNames)); DCmd_Register("showcursor", WRAP_METHOD(Console, cmdShowCursor)); + DCmd_Register("dumpalllevfiles", WRAP_METHOD(Console, cmdDumpAllLevFiles)); } bool Console::cmdLoadImage(int argc, const char **argv) { @@ -212,4 +213,16 @@ bool Console::cmdShowCursor(int argc, const char **argv) { return true; } +bool Console::cmdDumpAllLevFiles(int argc, const char **argv) { + Common::ArchiveMemberList list; + SearchMan.listMatchingMembers(list, "*.lev"); + + for (Common::ArchiveMemberList::iterator iter = list.begin(); iter != list.end(); ++iter) { + Common::String fileName = (*iter)->getName(); + writeFileContentsToFile(fileName, fileName); + } + + return true; +} + } // End of namespace ZVision diff --git a/engines/zvision/console.h b/engines/zvision/console.h index 995c41881e..e518467438 100644 --- a/engines/zvision/console.h +++ b/engines/zvision/console.h @@ -49,6 +49,7 @@ private: bool cmdDumpFile(int argc, const char **argv); bool cmdDumpAllCursorFileNames(int argc, const char **argv); bool cmdShowCursor(int argc, const char **argv); + bool cmdDumpAllLevFiles(int argc, const char **argv); }; } // End of namespace ZVision -- cgit v1.2.3