diff options
Diffstat (limited to 'engines/zvision/actions.cpp')
-rw-r--r-- | engines/zvision/actions.cpp | 24 |
1 files changed, 21 insertions, 3 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; } |