aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/zvision/script_manager.cpp17
-rw-r--r--engines/zvision/script_manager.h6
2 files changed, 8 insertions, 15 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp
index dcfcf02048..3cc4c92f0b 100644
--- a/engines/zvision/script_manager.cpp
+++ b/engines/zvision/script_manager.cpp
@@ -108,11 +108,10 @@ void ScriptManager::createReferenceTable() {
void ScriptManager::updateNodes(uint deltaTimeMillis) {
// If process() returns true, it means the node can be deleted
- for (Common::List<ActionNode *>::iterator iter = _activeNodes.begin(); iter != _activeNodes.end();) {
+ for (Common::List<Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end();) {
if ((*iter)->process(deltaTimeMillis)) {
- // Delete the node then remove the pointer
- delete (*iter);
- iter = _activeNodes.erase(iter);
+ // Remove the node
+ iter = _activeControls.erase(iter);
} else {
iter++;
}
@@ -257,12 +256,10 @@ void ScriptManager::changeLocationIntern() {
delete (*iter);
}
_activePuzzles.clear();
- for (Common::HashMap<uint32, Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) {
- delete (*iter)._value;
+ for (Common::List<Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) {
+ delete (*iter);
}
_activeControls.clear();
- _engine->clearAllMouseEvents();
- // TODO: See if we need to clear _activeNodes as well. And if so, remember to delete the nodes before clearing the list
// Revert to the idle cursor
_engine->getCursorManager()->revertToIdle();
@@ -278,8 +275,8 @@ void ScriptManager::changeLocationIntern() {
_engine->getRenderManager()->setBackgroundPosition(_nextLocation.offset);
// Enable all the controls
- for (Common::HashMap<uint32, Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) {
- (*iter)._value->enable();
+ for (Common::List<Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) {
+ (*iter)->enable();
}
// Add all the local puzzles to the queue to be checked
diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h
index 27e2e61238..0f3ea43dc3 100644
--- a/engines/zvision/script_manager.h
+++ b/engines/zvision/script_manager.h
@@ -37,7 +37,6 @@ class SeekableReadStream;
namespace ZVision {
class ZVision;
-class ActionNode;
struct Location {
char world;
@@ -60,8 +59,6 @@ private:
* particular state key are checked after the key is modified.
*/
Common::HashMap<uint32, uint> _globalState;
- /** Holds the currently active ActionNodes */
- 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 */
@@ -71,13 +68,12 @@ private:
/** Holds the global puzzles */
Common::List<Puzzle *>_globalPuzzles;
/** Holds the currently active controls */
- Common::HashMap<uint32, Control *> _activeControls;
+ Common::List<Control *> _activeControls;
Location _nextLocation;
bool _changeLocation;
public:
-
void initialize();
void update(uint deltaTimeMillis);