aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorrichiesams2013-09-03 23:46:14 -0500
committerrichiesams2013-09-03 23:54:29 -0500
commit117eea1be6231ad26fe43f9080fa572b4deb73cb (patch)
tree2e6e192189952938e8c45a88a9a8b9e6dbff59a4 /engines
parent9ea91f5c9c311276339e93ef64eaa53fd4435692 (diff)
downloadscummvm-rg350-117eea1be6231ad26fe43f9080fa572b4deb73cb.tar.gz
scummvm-rg350-117eea1be6231ad26fe43f9080fa572b4deb73cb.tar.bz2
scummvm-rg350-117eea1be6231ad26fe43f9080fa572b4deb73cb.zip
ZVISION: Allow changeLocation to be executed right away instead of next frame
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/script_manager.cpp22
-rw-r--r--engines/zvision/script_manager.h4
2 files changed, 10 insertions, 16 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp
index b95f2636b0..f3c945d658 100644
--- a/engines/zvision/script_manager.cpp
+++ b/engines/zvision/script_manager.cpp
@@ -181,6 +181,9 @@ void ScriptManager::checkPuzzleCriteria() {
bool shouldContinue = true;
for (Common::List<ResultAction *>::iterator resultIter = puzzle->resultActions.begin(); resultIter != puzzle->resultActions.end(); resultIter++) {
shouldContinue = shouldContinue && (*resultIter)->execute(_engine);
+ if (!shouldContinue) {
+ break;
+ }
}
// Set the puzzle as completed
@@ -258,18 +261,11 @@ bool ScriptManager::onMouseMove(const Common::Point &screenSpacePos, const Commo
}
void ScriptManager::changeLocation(char world, char room, char node, char view, uint32 offset) {
- _nextLocation.world = world;
- _nextLocation.room = room;
- _nextLocation.node = node;
- _nextLocation.view = view;
- _nextLocation.offset = offset;
-
- _changeLocation = true;
-}
+ assert(world != 0);
+ debug("Changing location to: %c %c %c %c %u", world, room, node, view, offset);
-void ScriptManager::changeLocationIntern() {
- assert(_nextLocation.world != 0);
- debug("Changing location to: %c %c %c %c %u", _nextLocation.world, _nextLocation.room, _nextLocation.node, _nextLocation.view, _nextLocation.offset);
+ // Auto save
+ _engine->getSaveManager()->autoSave();
// Clear all the containers
_referenceTable.clear();
@@ -290,11 +286,11 @@ void ScriptManager::changeLocationIntern() {
_engine->getRenderManager()->setBackgroundVelocity(0);
// Parse into puzzles and controls
- Common::String fileName = Common::String::format("%c%c%c%c.scr", _nextLocation.world, _nextLocation.room, _nextLocation.node, _nextLocation.view);
+ Common::String fileName = Common::String::format("%c%c%c%c.scr", world, room, node, view);
parseScrFile(fileName);
// Change the background position
- _engine->getRenderManager()->setBackgroundPosition(_nextLocation.offset);
+ _engine->getRenderManager()->setBackgroundPosition(offset);
// Enable all the controls
for (Common::List<Control *>::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) {
diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h
index 1a272f1970..75be66c3f0 100644
--- a/engines/zvision/script_manager.h
+++ b/engines/zvision/script_manager.h
@@ -70,8 +70,7 @@ private:
/** Holds the currently active controls */
Common::List<Control *> _activeControls;
- Location _nextLocation;
- bool _changeLocation;
+ Location _currentLocation;
public:
void initialize();
@@ -113,7 +112,6 @@ public:
private:
void createReferenceTable();
- void changeLocationIntern();
void updateNodes(uint deltaTimeMillis);
void checkPuzzleCriteria();