aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-08-29 01:49:01 -0500
committerWillem Jan Palenstijn2013-09-24 13:59:38 +0200
commitbb77333d4f4025b053ad311092ad0390368522ea (patch)
treec277b57a6405441eddfe0417022f7be951c15d68 /engines/zvision
parent6417192584873f98737a0928adefeb9aa9cad894 (diff)
downloadscummvm-rg350-bb77333d4f4025b053ad311092ad0390368522ea.tar.gz
scummvm-rg350-bb77333d4f4025b053ad311092ad0390368522ea.tar.bz2
scummvm-rg350-bb77333d4f4025b053ad311092ad0390368522ea.zip
ZVISION: Create console method for parsing ALL .scr files
Useful for putting a breakpoint at certain ResultActions/Controls to test out different instances of them.
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/console.cpp12
-rw-r--r--engines/zvision/console.h1
-rw-r--r--engines/zvision/script_manager.h3
3 files changed, 16 insertions, 0 deletions
diff --git a/engines/zvision/console.cpp b/engines/zvision/console.cpp
index fd8347e74f..8b4dffa98a 100644
--- a/engines/zvision/console.cpp
+++ b/engines/zvision/console.cpp
@@ -54,6 +54,7 @@ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) {
DCmd_Register("dumpcursorfilenames", WRAP_METHOD(Console, cmdDumpAllCursorFileNames));
DCmd_Register("showcursor", WRAP_METHOD(Console, cmdShowCursor));
DCmd_Register("dumpalllevfiles", WRAP_METHOD(Console, cmdDumpAllLevFiles));
+ DCmd_Register("parseallscrfiles", WRAP_METHOD(Console, cmdParseAllScrFiles));
}
bool Console::cmdLoadImage(int argc, const char **argv) {
@@ -225,4 +226,15 @@ bool Console::cmdDumpAllLevFiles(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) {
+ _engine->getScriptManager()->parseScrFile((*iter)->getName());
+ }
+
+ return true;
+}
+
} // End of namespace ZVision
diff --git a/engines/zvision/console.h b/engines/zvision/console.h
index e518467438..612e5eec00 100644
--- a/engines/zvision/console.h
+++ b/engines/zvision/console.h
@@ -50,6 +50,7 @@ private:
bool cmdDumpAllCursorFileNames(int argc, const char **argv);
bool cmdShowCursor(int argc, const char **argv);
bool cmdDumpAllLevFiles(int argc, const char **argv);
+ bool cmdParseAllScrFiles(int argc, const char **argv);
};
} // End of namespace ZVision
diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h
index 9b4763764f..1a272f1970 100644
--- a/engines/zvision/script_manager.h
+++ b/engines/zvision/script_manager.h
@@ -117,6 +117,8 @@ private:
void updateNodes(uint deltaTimeMillis);
void checkPuzzleCriteria();
+// TODO: Make this private. It was only made public so Console::cmdParseAllScrFiles() could use it
+public:
/**
* Parses a script file into triggers and events
*
@@ -125,6 +127,7 @@ private:
*/
void parseScrFile(const Common::String &fileName, bool isGlobal = false);
+private:
/**
* Parses the stream into a Puzzle object
* Helper method for parseScrFile.