[Scummvm-cvs-logs] scummvm master -> c8019487f92b44b685ccc066c81fcaf0c30715d2

csnover csnover at users.noreply.github.com
Sat May 28 16:14:44 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c8019487f9 SCI32: Remove unused titled text bitmap code


Commit: c8019487f92b44b685ccc066c81fcaf0c30715d2
    https://github.com/scummvm/scummvm/commit/c8019487f92b44b685ccc066c81fcaf0c30715d2
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-05-28T09:14:33-05:00

Commit Message:
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.

Changed paths:
    engines/sci/graphics/controls32.cpp
    engines/sci/graphics/text32.cpp
    engines/sci/graphics/text32.h



diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp
index a877d8c..faf1d7d 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 99ffc6e..c6c474f 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 5768ea0..20adb3d 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;






More information about the Scummvm-git-logs mailing list