aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2016-05-28 09:02:41 -0500
committerColin Snover2016-05-28 09:14:33 -0500
commitc8019487f92b44b685ccc066c81fcaf0c30715d2 (patch)
tree40e39c63203934e1a400bfebb190f680b146bb97
parent506549ae45e09b9c4c0c9c786077c429533ce53c (diff)
downloadscummvm-rg350-c8019487f92b44b685ccc066c81fcaf0c30715d2.tar.gz
scummvm-rg350-c8019487f92b44b685ccc066c81fcaf0c30715d2.tar.bz2
scummvm-rg350-c8019487f92b44b685ccc066c81fcaf0c30715d2.zip
SCI32: Remove unused titled text bitmap code
Titled text bitmaps do not appear to be used by any game scripts. They seem to only be used by the error manager in SSCI, but ScummVM has its own error handling, so we don’t need this implementation.
-rw-r--r--engines/sci/graphics/controls32.cpp5
-rw-r--r--engines/sci/graphics/text32.cpp13
-rw-r--r--engines/sci/graphics/text32.h16
3 files changed, 1 insertions, 33 deletions
diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp
index a877d8c276..faf1d7d1a2 100644
--- a/engines/sci/graphics/controls32.cpp
+++ b/engines/sci/graphics/controls32.cpp
@@ -104,10 +104,7 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) {
bool dimmed = readSelectorValue(_segMan, controlObject, SELECTOR(dimmed));
editor.bitmap = _gfxText32->createFontBitmap(width, height, editor.textRect, editor.text, editor.foreColor, editor.backColor, editor.skipColor, editor.fontId, alignment, editor.borderColor, dimmed, true);
} else {
- Common::String title = _segMan->getString(titleObject);
- int16 titleBackColor = readSelectorValue(_segMan, controlObject, SELECTOR(titleBack));
- int16 titleForeColor = readSelectorValue(_segMan, controlObject, SELECTOR(titleFore));
- editor.bitmap = _gfxText32->createTitledBitmap(width, height, editor.textRect, editor.text, editor.foreColor, editor.backColor, editor.skipColor, editor.fontId, alignment, editor.borderColor, title, titleForeColor, titleBackColor, titleFontId, true);
+ error("Titled bitmaps are not known to be used by any game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!");
}
}
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index 99ffc6e328..c6c474fe96 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -48,12 +48,6 @@ GfxText32::GfxText32(SegManager *segMan, GfxCache *fonts) :
// Not a typo, the original engine did not initialise height, only width
_width(0),
_text(""),
- _field_20(0),
- _field_2C(2),
- _field_30(0),
- _field_34(0),
- _field_38(0),
- _field_3C(0),
_bitmap(NULL_REG) {
_fontId = _defaultFontId;
_font = _cache->getFont(_defaultFontId);
@@ -61,7 +55,6 @@ GfxText32::GfxText32(SegManager *segMan, GfxCache *fonts) :
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) {
- _field_22 = 0;
_borderColor = borderColor;
_text = text;
_textRect = rect;
@@ -111,7 +104,6 @@ reg_t GfxText32::createFontBitmap(int16 width, int16 height, const Common::Rect
}
reg_t GfxText32::createFontBitmap(const CelInfo32 &celInfo, const Common::Rect &rect, const Common::String &text, const int16 foreColor, const int16 backColor, const GuiResourceId fontId, const int16 skipColor, const int16 borderColor, const bool dimmed) {
- _field_22 = 0;
_borderColor = borderColor;
_text = text;
_textRect = rect;
@@ -171,11 +163,6 @@ reg_t GfxText32::createFontBitmap(const CelInfo32 &celInfo, const Common::Rect &
return _bitmap;
}
-reg_t GfxText32::createTitledBitmap(const int16 width, const int16 height, const Common::Rect &textRect, const Common::String &text, const int16 foreColor, const int16 backColor, const int16 skipColor, const GuiResourceId fontId, const TextAlign alignment, const int16 borderColor, Common::String &title, const int16 titleForeColor, const int16 titleBackColor, const GuiResourceId titleFontId, const bool doScaling) {
- warning("TODO: createTitledBitmap incomplete !");
- return createFontBitmap(width, height, textRect, text, foreColor, backColor, skipColor, fontId, alignment, borderColor, false, doScaling);
-}
-
void GfxText32::setFont(const GuiResourceId fontId) {
// NOTE: In SCI engine this calls FontMgr::BuildFontTable and then a font
// table is built on the FontMgr directly; instead, because we already have
diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h
index 5768ea0c59..20adb3d7c7 100644
--- a/engines/sci/graphics/text32.h
+++ b/engines/sci/graphics/text32.h
@@ -304,17 +304,6 @@ private:
*/
TextAlign _alignment;
- int16 _field_20;
-
- /**
- * TODO: Document
- */
- int16 _field_22;
-
- int _field_2C, _field_30, _field_34, _field_38;
-
- int16 _field_3C;
-
/**
* The position of the text draw cursor.
*/
@@ -392,11 +381,6 @@ public:
*/
reg_t createFontBitmap(const CelInfo32 &celInfo, const Common::Rect &rect, const Common::String &text, const int16 foreColor, const int16 backColor, const GuiResourceId fontId, const int16 skipColor, const int16 borderColor, const bool dimmed);
- /**
- * Creates a font bitmap with a title.
- */
- reg_t createTitledBitmap(const int16 width, const int16 height, const Common::Rect &textRect, const Common::String &text, const int16 foreColor, const int16 backColor, const int16 skipColor, const GuiResourceId fontId, const TextAlign alignment, const int16 borderColor, Common::String &title, const int16 titleForeColor, const int16 titleBackColor, const GuiResourceId titleFontId, const bool doScaling);
-
inline int scaleUpWidth(int value) const {
const int scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
return (value * scriptWidth + _scaledWidth - 1) / _scaledWidth;