[Scummvm-cvs-logs] scummvm master -> b71dffafbe438a5cea887ae3f72ef76dd5d00cd9
clone2727
clone2727 at gmail.com
Thu Mar 8 16:09:58 CET 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b71dffafbe SCI: Fix GK1 Mac text positioning
Commit: b71dffafbe438a5cea887ae3f72ef76dd5d00cd9
https://github.com/scummvm/scummvm/commit/b71dffafbe438a5cea887ae3f72ef76dd5d00cd9
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-03-08T07:07:58-08:00
Commit Message:
SCI: Fix GK1 Mac text positioning
A regression from the text bitmap code addition
Changed paths:
engines/sci/graphics/text32.cpp
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index e24799f..7894c71 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -297,6 +297,10 @@ int16 GfxText32::Size(Common::Rect &rect, const char *text, GuiResourceId fontId
int16 maxTextWidth = 0, textWidth;
int16 totalHeight = 0, textHeight;
+ // Adjust maxWidth if we're using an upscaled font
+ if (_screen->fontIsUpscaled())
+ maxWidth = maxWidth * _screen->getDisplayWidth() / _screen->getWidth();
+
rect.top = rect.left = 0;
GfxFont *font = _cache->getFont(fontId);
@@ -323,6 +327,14 @@ int16 GfxText32::Size(Common::Rect &rect, const char *text, GuiResourceId fontId
rect.bottom = totalHeight;
rect.right = maxWidth ? maxWidth : MIN(rect.right, maxTextWidth);
}
+
+ // Adjust the width/height if we're using an upscaled font
+ // for the scripts
+ if (_screen->fontIsUpscaled()) {
+ rect.right = rect.right * _screen->getWidth() / _screen->getDisplayWidth();
+ rect.bottom = rect.bottom * _screen->getHeight() / _screen->getDisplayHeight();
+ }
+
return rect.right;
}
More information about the Scummvm-git-logs
mailing list