aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/actions.cpp2
-rw-r--r--engines/zvision/script_manager.cpp11
-rw-r--r--engines/zvision/script_manager.h4
3 files changed, 9 insertions, 8 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp
index 16499138c7..baa89aa165 100644
--- a/engines/zvision/actions.cpp
+++ b/engines/zvision/actions.cpp
@@ -354,7 +354,7 @@ ActionTimer::ActionTimer(const Common::String &line) {
}
bool ActionTimer::execute(ZVision *engine) {
- engine->getScriptManager()->addActionNode(Common::SharedPtr<ActionNode>(new NodeTimer(_key, _time)));
+ engine->getScriptManager()->addActionNode(new TimerNode(engine, _key, _time));
return true;
}
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp
index c217cb8612..9a4e9d13be 100644
--- a/engines/zvision/script_manager.cpp
+++ b/engines/zvision/script_manager.cpp
@@ -108,9 +108,10 @@ void ScriptManager::createReferenceTable() {
void ScriptManager::updateNodes(uint deltaTimeMillis) {
// If process() returns true, it means the node can be deleted
- for (Common::List<Common::SharedPtr<ActionNode> >::iterator iter = _activeNodes.begin(); iter != _activeNodes.end();) {
- if ((*iter)->process(_engine, deltaTimeMillis)) {
- // Remove the node from _activeNodes, the SharedPtr destructor will delete the actual ActionNode
+ for (Common::List<ActionNode *>::iterator iter = _activeNodes.begin(); iter != _activeNodes.end();) {
+ if ((*iter)->process(deltaTimeMillis)) {
+ // Delete the node then remove the pointer
+ delete (*iter);
iter = _activeNodes.erase(iter);
} else {
iter++;
@@ -223,11 +224,11 @@ bool ScriptManager::disableControl(uint32 key) {
if (!_activeControls.contains(key)) {
return false;
} else {
- return _activeControls[key]->disable(_engine);
+ return _activeControls[key]->disable();
}
}
-void ScriptManager::addActionNode(const Common::SharedPtr<ActionNode> &node) {
+void ScriptManager::addActionNode(ActionNode *node) {
_activeNodes.push_back(node);
}
diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h
index 2372703cbe..28bce07dc8 100644
--- a/engines/zvision/script_manager.h
+++ b/engines/zvision/script_manager.h
@@ -61,7 +61,7 @@ private:
*/
Common::HashMap<uint32, uint> _globalState;
/** Holds the currently active ActionNodes */
- Common::List<Common::SharedPtr<ActionNode> > _activeNodes;
+ Common::List<ActionNode *> _activeNodes;
/** References _globalState keys to Puzzles */
Common::HashMap<uint32, Common::Array<Puzzle *> > _referenceTable;
/** Holds the Puzzles that should be checked this frame */
@@ -88,7 +88,7 @@ public:
bool enableControl(uint32 key);
bool disableControl(uint32 key);
- void addActionNode(const Common::SharedPtr<ActionNode> &node);
+ void addActionNode(ActionNode *node);
void changeLocation(char world, char room, char node, char view, uint32 offset);