aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-07-03 18:24:06 -0500
committerrichiesams2013-08-04 13:31:59 -0500
commit3822de2aec0d41df7c2beeb5a1269577e9c3df84 (patch)
tree74a349df8b9962e536108ead0e7c0ffb2e8182a8 /engines/zvision
parent0ba9ca8fa0614287bf4b7e666a07126fa8e1faad (diff)
downloadscummvm-rg350-3822de2aec0d41df7c2beeb5a1269577e9c3df84.tar.gz
scummvm-rg350-3822de2aec0d41df7c2beeb5a1269577e9c3df84.tar.bz2
scummvm-rg350-3822de2aec0d41df7c2beeb5a1269577e9c3df84.zip
ZVISION: Change Puzzle::resultActions to a List of pointers instead of ResultAction objects
ResultAction is abstract, therefore, it can't be directly stored in the list
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/puzzle.h3
-rw-r--r--engines/zvision/scr_file_handling.cpp8
-rw-r--r--engines/zvision/script_manager.h2
3 files changed, 7 insertions, 6 deletions
diff --git a/engines/zvision/puzzle.h b/engines/zvision/puzzle.h
index 75d3dc0826..fd9c61e8bc 100644
--- a/engines/zvision/puzzle.h
+++ b/engines/zvision/puzzle.h
@@ -61,7 +61,8 @@ enum StateFlags : byte {
struct Puzzle {
uint32 key;
Common::List<Criteria> criteriaList;
- Common::List<ResultAction> resultActions;
+ // This has to be list of pointers because ResultAction is abstract
+ Common::List<ResultAction *> resultActions;
byte flags;
};
diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp
index 3171492717..eb867fa0a2 100644
--- a/engines/zvision/scr_file_handling.cpp
+++ b/engines/zvision/scr_file_handling.cpp
@@ -126,7 +126,7 @@ Criteria ScriptManager::parseCriteria(Common::SeekableReadStream &stream) const
return criteria;
}
-void ScriptManager::parseResult(Common::SeekableReadStream &stream, Common::List<ResultAction> &actionList) const {
+void ScriptManager::parseResult(Common::SeekableReadStream &stream, Common::List<ResultAction *> &actionList) const {
// Loop until we find the closing brace
Common::String line = stream.readLine();
trimCommentsAndWhiteSpace(line);
@@ -135,11 +135,11 @@ void ScriptManager::parseResult(Common::SeekableReadStream &stream, Common::List
while (!line.contains('}')) {
// Parse for the action type
if (line.matchString("*:add*", true)) {
- actionList.push_back(ActionAdd(line));
+ actionList.push_back(new ActionAdd(line));
} else if (line.matchString("*:animplay*", true)) {
- actionList.push_back(ActionPlayAnimation(line));
+ actionList.push_back(new ActionPlayAnimation(line));
} else if (line.matchString("*:animpreload*", true)) {
- actionList.push_back(ActionPreloadAnimation(line));
+ actionList.push_back(new ActionPreloadAnimation(line));
} else if (line.matchString("*:animunload*", true)) {
diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h
index 7f46bd51fe..173705edf5 100644
--- a/engines/zvision/script_manager.h
+++ b/engines/zvision/script_manager.h
@@ -82,7 +82,7 @@ private:
* @param stream Scr file stream
* @return Created Results object
*/
- void parseResult(Common::SeekableReadStream &stream, Common::List<ResultAction> &actionList) const;
+ void parseResult(Common::SeekableReadStream &stream, Common::List<ResultAction *> &actionList) const;
/**
* Helper method for parsePuzzle. Parses the stream into a bitwise or of the StateFlags enum