From be93d7d67dcea18532917a6c1bd6004665973f4f Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Fri, 1 Nov 2013 16:55:19 +0700 Subject: ZVISION: Implement ActionStop. --- engines/zvision/actions.cpp | 15 +++++++++++++++ engines/zvision/actions.h | 9 +++++++++ engines/zvision/scr_file_handling.cpp | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index 2a79500427..06ceea2573 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -409,6 +409,21 @@ bool ActionSetScreen::execute() { return true; } +////////////////////////////////////////////////////////////////////////////// +// ActionStop +////////////////////////////////////////////////////////////////////////////// + +ActionStop::ActionStop(ZVision *engine, const Common::String &line) : + ResultAction(engine) { + _key = 0; + sscanf(line.c_str(), "%*[^(](%u)", &_key); +} + +bool ActionStop::execute() { + _engine->getScriptManager()->stopSideFx(_key); + return true; +} + ////////////////////////////////////////////////////////////////////////////// // ActionStreamVideo diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h index bcd7848c10..8a8412fed5 100644 --- a/engines/zvision/actions.h +++ b/engines/zvision/actions.h @@ -327,6 +327,15 @@ private: Common::String _fileName; }; +class ActionStop : public ResultAction { +public: + ActionStop(ZVision *engine, const Common::String &line); + bool execute(); + +private: + uint32 _key; +}; + class ActionStreamVideo : public ResultAction { public: ActionStreamVideo(ZVision *engine, const Common::String &line); diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp index edb496a0eb..bfa1481007 100644 --- a/engines/zvision/scr_file_handling.cpp +++ b/engines/zvision/scr_file_handling.cpp @@ -229,7 +229,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (line.matchString("*:set_venus*", true)) { // TODO: Implement ActionSetVenus } else if (line.matchString("*:stop*", true)) { - // TODO: Implement ActionStop + actionList.push_back(new ActionStop(_engine, line)); } else if (line.matchString("*:streamvideo*", true)) { actionList.push_back(new ActionStreamVideo(_engine, line)); } else if (line.matchString("*:syncsound*", true)) { -- cgit v1.2.3