aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/scr_file_handling.cpp21
-rw-r--r--engines/zvision/script_manager.h4
2 files changed, 9 insertions, 16 deletions
diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp
index 9c99ce184d..10e5c8f0eb 100644
--- a/engines/zvision/scr_file_handling.cpp
+++ b/engines/zvision/scr_file_handling.cpp
@@ -62,12 +62,7 @@ void ScriptManager::parseScrFile(const Common::String &fileName, bool isGlobal)
_activePuzzles.push_back(puzzle);
}
} else if (line.matchString("control:*", true)) {
- Common::SharedPtr<Control> control;
-
- // Some controls don't require nodes. They just initialize the scene
- if (parseControl(line, file, control)) {
- _activeControls.push_back(control);
- }
+ parseControl(line, file);
}
}
}
@@ -300,7 +295,7 @@ uint ScriptManager::parseFlags(Common::SeekableReadStream &stream) const {
return flags;
}
-bool ScriptManager::parseControl(Common::String &line, Common::SeekableReadStream &stream, Common::SharedPtr<Control> &control) {
+void ScriptManager::parseControl(Common::String &line, Common::SeekableReadStream &stream) {
uint32 key;
char controlTypeBuffer[20];
@@ -309,21 +304,19 @@ bool ScriptManager::parseControl(Common::String &line, Common::SeekableReadStrea
Common::String controlType(controlTypeBuffer);
if (controlType.equalsIgnoreCase("push_toggle")) {
- Control::parsePushToggleControl(key, _engine, stream);
- return false;
+ _activeControls[key] = new PushToggleControl(key, stream);
+ return;
} else if (controlType.equalsIgnoreCase("flat")) {
Control::parseFlatControl(_engine);
- return false;
+ return;
} else if (controlType.equalsIgnoreCase("pana")) {
Control::parsePanoramaControl(_engine, stream);
- return false;
+ return;
}
else if (controlType.equalsIgnoreCase("tilt")) {
Control::parseTiltControl(_engine, stream);
- return false;
+ return;
}
-
- return true;
}
} // End of namespace ZVision
diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h
index c0801edd5e..3d64727506 100644
--- a/engines/zvision/script_manager.h
+++ b/engines/zvision/script_manager.h
@@ -70,7 +70,7 @@ private:
/** Holds the global puzzles */
Common::List<Puzzle>_globalPuzzles;
/** Holds the currently active controls */
- Common::List<Common::SharedPtr<Control> > _activeControls;
+ Common::HashMap<uint32, Control *> _activeControls;
Location _nextLocation;
bool _changeLocation;
@@ -145,7 +145,7 @@ private:
* @param line The line initially read
* @param stream Scr file stream
*/
- bool parseControl(Common::String &line, Common::SeekableReadStream &stream, Common::SharedPtr<Control> &control);
+ void parseControl(Common::String &line, Common::SeekableReadStream &stream);
};