aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/actions.cpp24
-rw-r--r--engines/zvision/actions.h9
-rw-r--r--engines/zvision/scr_file_handling.cpp3
3 files changed, 31 insertions, 5 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp
index a1ea96707b..9a8dee0e32 100644
--- a/engines/zvision/actions.cpp
+++ b/engines/zvision/actions.cpp
@@ -25,6 +25,7 @@
#include "zvision/actions.h"
#include "zvision/zvision.h"
#include "zvision/script_manager.h"
+#include "zvision/render_manager.h"
#include "zvision/action_node.h"
namespace ZVision {
@@ -157,17 +158,34 @@ bool ActionRandom::execute(ZVision *engine) {
//////////////////////////////////////////////////////////////////////////////
-// ActionTimer
+// ActionSetScreen
//////////////////////////////////////////////////////////////////////////////
-ActionTimer::ActionTimer(const Common::String &line) {
+ActionSetScreen::ActionSetScreen(const Common::String &line) {
+ char fileName[25];
+ sscanf(line.c_str(), "%*[^(](%25[^)])", fileName);
+
+ _fileName = Common::String(fileName);
}
+bool ActionSetScreen::execute(ZVision *engine) {
+ RenderManager *renderManager = engine->getRenderManager();
+ renderManager->setBackgroundImage(_fileName);
+
+ return true;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+// ActionTimer
+//////////////////////////////////////////////////////////////////////////////
+
+ActionTimer::ActionTimer(const Common::String &line) {
sscanf(line.c_str(), "%*[^:]:%*[^:]:%u(%u)", &_key, &_time);
}
bool ActionTimer::execute(ZVision *engine) {
- engine->getScriptManager()->addActionNode(new NodeTimer(_key, _time));
+ engine->getScriptManager()->addActionNode(Common::SharedPtr<ActionNode>(new NodeTimer(_key, _time)));
return true;
}
diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h
index 7ee51ad279..3922f92b44 100644
--- a/engines/zvision/actions.h
+++ b/engines/zvision/actions.h
@@ -186,6 +186,15 @@ private:
uint _max;
};
+class ActionSetScreen : public ResultAction {
+public:
+ ActionSetScreen(const Common::String &line);
+ bool execute(ZVision *engine);
+
+private:
+ Common::String _fileName;
+};
+
class ActionTimer : public ResultAction {
public:
ActionTimer(const Common::String &line);
diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp
index 8c8c6c488a..1dc8ee5d4e 100644
--- a/engines/zvision/scr_file_handling.cpp
+++ b/engines/zvision/scr_file_handling.cpp
@@ -233,8 +233,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
} else if (line.matchString("*:set_screen*", true)) {
-
-
+ actionList.push_back(Common::SharedPtr<ResultAction>(new ActionSetScreen(line)));
} else if (line.matchString("*:set_venus*", true)) {