aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mohawk/riven_scripts.cpp8
-rw-r--r--engines/mohawk/riven_scripts.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index c26d4bd827..67a56af1af 100644
--- a/engines/mohawk/riven_scripts.cpp
+++ b/engines/mohawk/riven_scripts.cpp
@@ -153,6 +153,14 @@ RivenScriptPtr RivenScriptManager::createScriptFromData(uint16 commandCount, ...
return readScript(&readStream);
}
+RivenScriptPtr RivenScriptManager::createScriptWithCommand(RivenCommand *command) {
+ assert(command);
+
+ RivenScriptPtr script = RivenScriptPtr(new RivenScript());
+ script->addCommand(command);
+ return script;
+}
+
RivenScript::RivenScript() {
_continueRunning = true;
}
diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h
index cfe0f3a048..cac7955612 100644
--- a/engines/mohawk/riven_scripts.h
+++ b/engines/mohawk/riven_scripts.h
@@ -130,6 +130,13 @@ public:
/** Create a script from the caller provided arguments containing raw data */
RivenScriptPtr createScriptFromData(uint16 commandCount, ...);
+ /**
+ * Create a script with a single user provided command
+ *
+ * The script takes ownership of the command.
+ */
+ RivenScriptPtr createScriptWithCommand(RivenCommand *command);
+
/** Read a list of typed scripts from a stream */
RivenScriptList readScripts(Common::ReadStream *stream);