aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorColin Snover2017-02-07 15:27:15 -0600
committerColin Snover2017-04-22 19:25:20 -0500
commitede7976ede9121d52932b4b0780e6adc68f6e35d (patch)
tree09a5239e8bfc772544df05b8ea6d524c7195355f /engines/sci/graphics
parentc6cf7215f0f620dc4a155ca79510a44db13370fc (diff)
downloadscummvm-rg350-ede7976ede9121d52932b4b0780e6adc68f6e35d.tar.gz
scummvm-rg350-ede7976ede9121d52932b4b0780e6adc68f6e35d.tar.bz2
scummvm-rg350-ede7976ede9121d52932b4b0780e6adc68f6e35d.zip
SCI32: Fix bad kPointSize implementation
Fixes text scaling gone mad in Phant2.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/text32.cpp5
-rw-r--r--engines/sci/graphics/text32.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index a017a2fcc5..7399fe0268 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -216,6 +216,11 @@ void GfxText32::drawChar(const char charIndex) {
_drawPosition.x += _font->getCharWidth((unsigned char)charIndex);
}
+int16 GfxText32::getScaledFontHeight() const {
+ const int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
+ return (_font->getHeight() * scriptHeight + _yResolution - 1) / _yResolution;
+}
+
uint16 GfxText32::getCharWidth(const char charIndex, const bool doScaling) const {
uint16 width = _font->getCharWidth((unsigned char)charIndex);
if (doScaling) {
diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h
index bfd5ebc606..c8fafb287f 100644
--- a/engines/sci/graphics/text32.h
+++ b/engines/sci/graphics/text32.h
@@ -236,6 +236,11 @@ public:
void setFont(const GuiResourceId fontId);
/**
+ * Gets the pixel height of the currently loaded font.
+ */
+ int16 getScaledFontHeight() const;
+
+ /**
* Gets the width of a character.
*/
uint16 getCharWidth(const char charIndex, const bool doScaling) const;