aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/font.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-02-03 15:51:51 +0000
committerMatthew Hoops2011-02-03 15:51:51 +0000
commit4d088332a2f5bb6cb8aea9031a79d834dbb258e4 (patch)
tree861d9143ea41fe1e6e72b8734e425a54f8a7001e /engines/sci/graphics/font.cpp
parentc4861605df3964f3ea89a6cdf3873a1c87c48f12 (diff)
downloadscummvm-rg350-4d088332a2f5bb6cb8aea9031a79d834dbb258e4.tar.gz
scummvm-rg350-4d088332a2f5bb6cb8aea9031a79d834dbb258e4.tar.bz2
scummvm-rg350-4d088332a2f5bb6cb8aea9031a79d834dbb258e4.zip
SCI: Add support for GK1 Mac high-res fonts
svn-id: r55754
Diffstat (limited to 'engines/sci/graphics/font.cpp')
-rw-r--r--engines/sci/graphics/font.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/sci/graphics/font.cpp b/engines/sci/graphics/font.cpp
index ea7a3fad36..760f4158ea 100644
--- a/engines/sci/graphics/font.cpp
+++ b/engines/sci/graphics/font.cpp
@@ -79,8 +79,13 @@ byte *GfxFontFromResource::getCharData(uint16 chr) {
}
void GfxFontFromResource::draw(uint16 chr, int16 top, int16 left, byte color, bool greyedOutput) {
- int charWidth = MIN<int>(getCharWidth(chr), _screen->getWidth() - left);
- int charHeight = MIN<int>(getCharHeight(chr), _screen->getHeight() - top);
+ // Make sure we're comparing against the correct dimensions
+ // If the font we're drawing is already upscaled, make sure we use the full screen width/height
+ uint16 screenWidth = _screen->fontIsUpscaled() ? _screen->getDisplayWidth() : _screen->getWidth();
+ uint16 screenHeight = _screen->fontIsUpscaled() ? _screen->getDisplayHeight() : _screen->getHeight();
+
+ int charWidth = MIN<int>(getCharWidth(chr), screenWidth - left);
+ int charHeight = MIN<int>(getCharHeight(chr), screenHeight - top);
byte b = 0, mask = 0xFF;
int y = 0;
int16 greyedTop = top;