aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-08-16 00:33:03 +0200
committerWillem Jan Palenstijn2013-08-16 00:40:28 +0200
commit0aa669cc479e87cf66c7edcf5aed5299f2895bed (patch)
treeab30b5b0a348bfceeb859384cc57bdd84682f1b4 /engines/wintermute/base
parent3af7b8d8724bbefb3f3943d0402d7d0c0f83dd43 (diff)
downloadscummvm-rg350-0aa669cc479e87cf66c7edcf5aed5299f2895bed.tar.gz
scummvm-rg350-0aa669cc479e87cf66c7edcf5aed5299f2895bed.tar.bz2
scummvm-rg350-0aa669cc479e87cf66c7edcf5aed5299f2895bed.zip
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.
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp14
1 files changed, 6 insertions, 8 deletions
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);
}
//////////////////////////////////////////////////////////////////////////