aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-09-03 23:56:06 -0500
committerrichiesams2013-09-04 00:16:27 -0500
commitb45c9e7c2683ee73ca1f54718b630597e9bc42c9 (patch)
tree246678fcb430a3b1807f52d8f7da53a05cc56c89 /engines/zvision
parent9dd54a16e00be09cf549e38b03387e28efe9195d (diff)
downloadscummvm-rg350-b45c9e7c2683ee73ca1f54718b630597e9bc42c9.tar.gz
scummvm-rg350-b45c9e7c2683ee73ca1f54718b630597e9bc42c9.tar.bz2
scummvm-rg350-b45c9e7c2683ee73ca1f54718b630597e9bc42c9.zip
ZVISION: Create method for getting the current location
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/script_manager.cpp22
-rw-r--r--engines/zvision/script_manager.h2
2 files changed, 17 insertions, 7 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp
index 45e1459293..6330e206be 100644
--- a/engines/zvision/script_manager.cpp
+++ b/engines/zvision/script_manager.cpp
@@ -37,8 +37,7 @@
namespace ZVision {
ScriptManager::ScriptManager(ZVision *engine)
- : _engine(engine),
- _changeLocation(false) {
+ : _engine(engine) {
}
ScriptManager::~ScriptManager() {
@@ -61,11 +60,6 @@ void ScriptManager::initialize() {
void ScriptManager::update(uint deltaTimeMillis) {
updateNodes(deltaTimeMillis);
checkPuzzleCriteria();
-
- if (_changeLocation) {
- changeLocationIntern();
- _changeLocation = false;
- }
}
void ScriptManager::createReferenceTable() {
@@ -333,6 +327,20 @@ void ScriptManager::changeLocation(char world, char room, char node, char view,
// Create the puzzle reference table
createReferenceTable();
+
+ // Update _currentLocation
+ _currentLocation.world = world;
+ _currentLocation.room = room;
+ _currentLocation.node = node;
+ _currentLocation.view = view;
+ _currentLocation.offset = offset;
+}
+
+Location ScriptManager::getCurrentLocation() const {
+ Location location = _currentLocation;
+ location.offset = _engine->getRenderManager()->getCurrentBackgroundOffset();
+
+ return location;
}
} // End of namespace ZVision
diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h
index 723f4fe032..96123a8468 100644
--- a/engines/zvision/script_manager.h
+++ b/engines/zvision/script_manager.h
@@ -110,6 +110,8 @@ public:
void changeLocation(char world, char room, char node, char view, uint32 offset);
+ Location getCurrentLocation() const;
+
private:
void createReferenceTable();
void updateNodes(uint deltaTimeMillis);