From 511cb7447e6ebd9a0c54c3e767eb8ea754fd5398 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Sun, 8 Sep 2013 15:12:36 -0500 Subject: ZVISION: Create method for converting image space to working window space --- engines/zvision/render_manager.cpp | 13 +++++++++++++ engines/zvision/render_manager.h | 9 +++++++++ 2 files changed, 22 insertions(+) (limited to 'engines/zvision') 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(); -- cgit v1.2.3