diff options
author | richiesams | 2013-08-18 15:29:23 -0500 |
---|---|---|
committer | richiesams | 2013-08-18 19:53:03 -0500 |
commit | 5a86355e7dae3b00924ce95275f1fea9346a6211 (patch) | |
tree | 400a5f9373791a9ca0755559b4c9e277416d3959 | |
parent | 908e784957ec3cf01bc54a5c76c18f5ed6a8faa6 (diff) | |
download | scummvm-rg350-5a86355e7dae3b00924ce95275f1fea9346a6211.tar.gz scummvm-rg350-5a86355e7dae3b00924ce95275f1fea9346a6211.tar.bz2 scummvm-rg350-5a86355e7dae3b00924ce95275f1fea9346a6211.zip |
ZVISION: Implement ActionEnableControl and ActionDisableControl
-rw-r--r-- | engines/zvision/actions.cpp | 34 | ||||
-rw-r--r-- | engines/zvision/actions.h | 6 | ||||
-rw-r--r-- | engines/zvision/scr_file_handling.cpp | 6 |
3 files changed, 39 insertions, 7 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index 504c250597..affa8f5a9c 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -111,6 +111,40 @@ bool ActionCrossfade::execute(ZVision *engine) { ////////////////////////////////////////////////////////////////////////////// +// ActionDisableControl +////////////////////////////////////////////////////////////////////////////// + +ActionDisableControl::ActionDisableControl(const Common::String &line) { + sscanf(line.c_str(), "%*[^(](%u)", &_key); +} + +bool ActionDisableControl::execute(ZVision *engine) { + debug("Disabling control %u", _key); + + engine->getScriptManager()->disableControl(_key); + + return true; +} + + +////////////////////////////////////////////////////////////////////////////// +// ActionEnableControl +////////////////////////////////////////////////////////////////////////////// + +ActionEnableControl::ActionEnableControl(const Common::String &line) { + sscanf(line.c_str(), "%*[^(](%u)", &_key); +} + +bool ActionEnableControl::execute(ZVision *engine) { + debug("Enabling control %u", _key); + + engine->getScriptManager()->enableControl(_key); + + return true; +} + + +////////////////////////////////////////////////////////////////////////////// // ActionMusic ////////////////////////////////////////////////////////////////////////////// diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h index aa67be20c7..1d87b8025c 100644 --- a/engines/zvision/actions.h +++ b/engines/zvision/actions.h @@ -168,6 +168,7 @@ public: bool execute(ZVision *engine); private: + uint32 _key; }; class ActionDisableVenus : public ResultAction { @@ -188,10 +189,8 @@ private: class ActionDissolve : public ResultAction { public: - ActionDissolve(const Common::String &line); + ActionDissolve(); bool execute(ZVision *engine); - -private: }; class ActionDistort : public ResultAction { @@ -208,6 +207,7 @@ public: bool execute(ZVision *engine); private: + uint32 _key; }; class ActionMusic : public ResultAction { diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp index 10e5c8f0eb..3fee767135 100644 --- a/engines/zvision/scr_file_handling.cpp +++ b/engines/zvision/scr_file_handling.cpp @@ -177,8 +177,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (line.matchString("*:disable_control*", true)) { - - + actionList.push_back(Common::SharedPtr<ResultAction>(new ActionDisableControl(line))); } else if (line.matchString("*:disable_venus*", true)) { @@ -192,8 +191,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (line.matchString("*:enable_control*", true)) { - - + actionList.push_back(Common::SharedPtr<ResultAction>(new ActionEnableControl(line))); } else if (line.matchString("*:flush_mouse_events*", true)) { |