diff options
author | Willem Jan Palenstijn | 2016-03-27 16:40:40 +0200 |
---|---|---|
committer | Colin Snover | 2016-06-21 08:14:12 -0500 |
commit | 94328f0ec8baa96947c5b82c63bdd298ba44981d (patch) | |
tree | 685088772c71be47812f29caa80a46690bd1b5c0 /engines/sci/graphics/text32.cpp | |
parent | c4b41f5d7cfd6506c9d541868af71c5288b36c09 (diff) | |
download | scummvm-rg350-94328f0ec8baa96947c5b82c63bdd298ba44981d.tar.gz scummvm-rg350-94328f0ec8baa96947c5b82c63bdd298ba44981d.tar.bz2 scummvm-rg350-94328f0ec8baa96947c5b82c63bdd298ba44981d.zip |
SCI32: Make GfxText32::_scaledWidth/Height statics
They were global in SSCI. This way secondary GfxText32 instances
(such as in ScrollWindow) use the correct scaling.
Diffstat (limited to 'engines/sci/graphics/text32.cpp')
-rw-r--r-- | engines/sci/graphics/text32.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp index 425c7fb6d6..f38a95de5b 100644 --- a/engines/sci/graphics/text32.cpp +++ b/engines/sci/graphics/text32.cpp @@ -39,18 +39,24 @@ namespace Sci { int16 GfxText32::_defaultFontId = 0; +int16 GfxText32::_scaledWidth = 0; +int16 GfxText32::_scaledHeight = 0; GfxText32::GfxText32(SegManager *segMan, GfxCache *fonts) : _segMan(segMan), _cache(fonts), - _scaledWidth(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth), - _scaledHeight(g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight), // Not a typo, the original engine did not initialise height, only width _width(0), _text(""), _bitmap(NULL_REG) { _fontId = _defaultFontId; _font = _cache->getFont(_defaultFontId); + + if (_scaledWidth == 0) { + // initialize the statics + _scaledWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; + _scaledHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; + } } reg_t GfxText32::createFontBitmap(int16 width, int16 height, const Common::Rect &rect, const Common::String &text, const uint8 foreColor, const uint8 backColor, const uint8 skipColor, const GuiResourceId fontId, const TextAlign alignment, const int16 borderColor, const bool dimmed, const bool doScaling) { |