From 0aa669cc479e87cf66c7edcf5aed5299f2895bed Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 16 Aug 2013 00:33:03 +0200 Subject: WINTERMUTE: Fix (still disabled) modTargetRect logic Width and height were computed incorrectly. Also, the shift by _renderRect is not necessary since that was to compensate for the coordinate translation done by the original SDL_RenderSetViewport, which we don't perform. --- .../wintermute/base/gfx/osystem/base_render_osystem.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'engines/wintermute/base') diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index b16cf60752..0e7e5aa819 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -631,15 +631,13 @@ Rect32 BaseRenderOSystem::getViewPort() { ////////////////////////////////////////////////////////////////////////// void BaseRenderOSystem::modTargetRect(Common::Rect *rect) { - // FIXME: This is wrong in quite a few ways right now, and ends up - // breaking the notebook in Dirty Split, so we disable the correction - // for now, this will need fixing when a game with odd aspect-ratios - // show up. return; - rect->left = (int16)MathUtil::round(rect->left * _ratioX + _borderLeft - _renderRect.left); - rect->top = (int16)MathUtil::round(rect->top * _ratioY + _borderTop - _renderRect.top); - rect->setWidth((int16)MathUtil::roundUp(rect->width() * _ratioX)); - rect->setHeight((int16)MathUtil::roundUp(rect->height() * _ratioY)); + int newWidth = (int16)MathUtil::roundUp(rect->width() * _ratioX); + int newHeight = (int16)MathUtil::roundUp(rect->height() * _ratioY); + rect->left = (int16)MathUtil::round(rect->left * _ratioX + _borderLeft); + rect->top = (int16)MathUtil::round(rect->top * _ratioY + _borderTop); + rect->setWidth(newWidth); + rect->setHeight(newHeight); } ////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3