diff options
author | richiesams | 2013-08-26 14:10:37 -0500 |
---|---|---|
committer | richiesams | 2013-08-28 16:44:22 -0500 |
commit | b66700212479bb05ce1367a43fe6341cdfca1b00 (patch) | |
tree | e16bd89edd762d5189e8dc92c89e5d8b4d58d860 /engines | |
parent | a1d11054b52822e3d85e0ad88e6d2ebbbeca8518 (diff) | |
download | scummvm-rg350-b66700212479bb05ce1367a43fe6341cdfca1b00.tar.gz scummvm-rg350-b66700212479bb05ce1367a43fe6341cdfca1b00.tar.bz2 scummvm-rg350-b66700212479bb05ce1367a43fe6341cdfca1b00.zip |
ZVISION: Update ScriptManager::enableControl()/disableControl() to fit new Control syntax
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/script_manager.cpp | 28 | ||||
-rw-r--r-- | engines/zvision/script_manager.h | 6 |
2 files changed, 19 insertions, 15 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp index 50d7e58091..dcfcf02048 100644 --- a/engines/zvision/script_manager.cpp +++ b/engines/zvision/script_manager.cpp @@ -212,24 +212,28 @@ void ScriptManager::addToStateValue(uint32 key, uint valueToAdd) { _globalState[key] += valueToAdd; } -bool ScriptManager::enableControl(uint32 key) { - if (!_activeControls.contains(key)) { - return false; - } else { - return _activeControls[key]->enable(); +void ScriptManager::addControl(Control *control) { + _activeControls.push_back(control); +} + +void ScriptManager::enableControl(uint32 key) { + for (Common::List<Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) { + if ((*iter)->getKey() == key) { + (*iter)->enable(); + break; + } } } -bool ScriptManager::disableControl(uint32 key) { - if (!_activeControls.contains(key)) { - return false; - } else { - return _activeControls[key]->disable(); +void ScriptManager::disableControl(uint32 key) { + for (Common::List<Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) { + if ((*iter)->getKey() == key) { + (*iter)->disable(); + break; + } } } -void ScriptManager::addActionNode(ActionNode *node) { - _activeNodes.push_back(node); } void ScriptManager::changeLocation(char world, char room, char node, char view, uint32 offset) { diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h index 28bce07dc8..27e2e61238 100644 --- a/engines/zvision/script_manager.h +++ b/engines/zvision/script_manager.h @@ -85,10 +85,10 @@ public: void setStateValue(uint32 key, uint value); void addToStateValue(uint32 key, uint valueToAdd); - bool enableControl(uint32 key); - bool disableControl(uint32 key); + void addControl(Control *control); - void addActionNode(ActionNode *node); + void enableControl(uint32 key); + void disableControl(uint32 key); void changeLocation(char world, char room, char node, char view, uint32 offset); |