diff options
Diffstat (limited to 'engines/zvision/render_manager.cpp')
-rw-r--r-- | engines/zvision/render_manager.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp index 132c597140..2d45ad835d 100644 --- a/engines/zvision/render_manager.cpp +++ b/engines/zvision/render_manager.cpp @@ -80,6 +80,8 @@ void RenderManager::renderSubRectToScreen(uint16 *buffer, uint32 imageWidth, uin destRect.moveTo((_width - subRectangle.width()) / 2, (_height - subRectangle.height()) / 2); } + _backgroundOffset = Common::Point(destRect.left, destRect.top); + if (_renderTable.getRenderState() == RenderTable::FLAT) { _system->copyRectToScreen(buffer + subRectangle.top * horizontalPitch + subRectangle.left, horizontalPitch, destRect.left, destRect.top, destRect.width(), destRect.height()); } else { @@ -139,7 +141,17 @@ void RenderManager::renderImageToScreen(Common::SeekableReadStream &stream, uint tga.destroy(); } +} + +const Common::Point RenderManager::convertToImageCoords(const Common::Point &point) { + Common::Point newPoint(point); + + if (_renderTable.getRenderState() == RenderTable::PANORAMA || _renderTable.getRenderState() == RenderTable::TILT) { + newPoint = _renderTable.convertWarpedPointToFlatCoords(newPoint); + } + newPoint -= _backgroundOffset; + return newPoint; } RenderTable *RenderManager::getRenderTable() { |