aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichieSams2013-09-08 15:12:36 -0500
committerRichieSams2013-09-09 11:16:39 -0500
commit511cb7447e6ebd9a0c54c3e767eb8ea754fd5398 (patch)
tree3afcb8cf3f47c9ef10c6caebcd8016a8505fdd5e
parentc7358ed4f78437e26aeb05d2113e86ee35d14632 (diff)
downloadscummvm-rg350-511cb7447e6ebd9a0c54c3e767eb8ea754fd5398.tar.gz
scummvm-rg350-511cb7447e6ebd9a0c54c3e767eb8ea754fd5398.tar.bz2
scummvm-rg350-511cb7447e6ebd9a0c54c3e767eb8ea754fd5398.zip
ZVISION: Create method for converting image space to working window space
-rw-r--r--engines/zvision/render_manager.cpp13
-rw-r--r--engines/zvision/render_manager.h9
2 files changed, 22 insertions, 0 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp
index 3f19cae6fe..c0554dc20a 100644
--- a/engines/zvision/render_manager.cpp
+++ b/engines/zvision/render_manager.cpp
@@ -338,6 +338,19 @@ const Common::Point RenderManager::screenSpaceToImageSpace(const Common::Point &
return newPoint;
}
+const Common::Point RenderManager::imageSpaceToWorkingWindowSpace(const Common::Point &point) {
+ Common::Point newPoint(point);
+
+ RenderTable::RenderState state = _renderTable.getRenderState();
+ if (state == RenderTable::PANORAMA) {
+ newPoint += (Common::Point(_screenCenterX, 0) - _backgroundOffset);
+ } else if (state == RenderTable::TILT) {
+ newPoint += (Common::Point(0, _screenCenterY) - _backgroundOffset);
+ }
+
+ return newPoint;
+}
+
RenderTable *RenderManager::getRenderTable() {
return &_renderTable;
}
diff --git a/engines/zvision/render_manager.h b/engines/zvision/render_manager.h
index bb673e9929..0294d6a19f 100644
--- a/engines/zvision/render_manager.h
+++ b/engines/zvision/render_manager.h
@@ -173,6 +173,15 @@ public:
* @return Point in image coordinate space
*/
const Common::Point screenSpaceToImageSpace(const Common::Point &point);
+ /**
+ * Converts a point in image coordinate space to ***PRE-WARP***
+ * working window coordinate space
+ *
+ * @param point Point in image coordinate space
+ * @return Point in PRE-WARP working window coordinate space
+ */
+ const Common::Point imageSpaceToWorkingWindowSpace(const Common::Point &point);
+
RenderTable *getRenderTable();
uint32 getCurrentBackgroundOffset();