diff options
author | Colin Snover | 2017-01-22 19:01:02 -0600 |
---|---|---|
committer | Colin Snover | 2017-03-30 19:46:27 -0500 |
commit | 739047f887e9fef53c89ecf76de8809e7ae6809f (patch) | |
tree | f4ce3d24a00f2bb58a575c2f76841de9a00567c1 /engines/sci/graphics/text32.cpp | |
parent | 3de6f290e7724369424ec33dd56b60fbc393460c (diff) | |
download | scummvm-rg350-739047f887e9fef53c89ecf76de8809e7ae6809f.tar.gz scummvm-rg350-739047f887e9fef53c89ecf76de8809e7ae6809f.tar.bz2 scummvm-rg350-739047f887e9fef53c89ecf76de8809e7ae6809f.zip |
SCI32: Always reinit GfxText32 statics on game startup
Fixes bad scaling of text when switching between games with
different script resolutions.
Diffstat (limited to 'engines/sci/graphics/text32.cpp')
-rw-r--r-- | engines/sci/graphics/text32.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp index c6360010d3..a017a2fcc5 100644 --- a/engines/sci/graphics/text32.cpp +++ b/engines/sci/graphics/text32.cpp @@ -50,14 +50,13 @@ GfxText32::GfxText32(SegManager *segMan, GfxCache *fonts) : _bitmap(NULL_REG) { _fontId = kSci32SystemFont; _font = _cache->getFont(kSci32SystemFont); - - if (_xResolution == 0) { - // initialize the statics - _xResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; - _yResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; - } } +void GfxText32::init() { + _xResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth; + _yResolution = 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, const bool gc) { _borderColor = borderColor; |