aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/graphics/text32.cpp10
-rw-r--r--engines/sci/graphics/text32.h8
2 files changed, 12 insertions, 6 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) {
diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h
index 20adb3d7c7..905e88baf4 100644
--- a/engines/sci/graphics/text32.h
+++ b/engines/sci/graphics/text32.h
@@ -351,15 +351,15 @@ public:
/**
* The size of the x-dimension of the coordinate system
- * used by the text renderer.
+ * used by the text renderer. Static since it was global in SSCI.
*/
- int16 _scaledWidth;
+ static int16 _scaledWidth;
/**
* The size of the y-dimension of the coordinate system
- * used by the text renderer.
+ * used by the text renderer. Static since it was global in SSCI.
*/
- int16 _scaledHeight;
+ static int16 _scaledHeight;
/**
* The currently active font resource used to write text