[Scummvm-git-logs] scummvm master -> 49a36e6828835bbbac029ca41c0c24bc6a259cc3

criezy criezy at scummvm.org
Fri Oct 30 23:05:07 UTC 2020


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

Summary:
7a1b3983a2 GUI: Remove unused functions in ThemeEngine
186e6142a0 COMMON: Remove unused functions in TranslationManager
49a36e6828 GUI: Fix compilation with some compilers


Commit: 7a1b3983a25b29e66d517431e9394eee80da73dd
    https://github.com/scummvm/scummvm/commit/7a1b3983a25b29e66d517431e9394eee80da73dd
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-10-30T22:54:09Z

Commit Message:
GUI: Remove unused functions in ThemeEngine

They were leftovers from the transition to U32String.

Changed paths:
    gui/ThemeEngine.cpp
    gui/ThemeEngine.h


diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 6688d2b515..cc61b7a2b9 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -983,40 +983,6 @@ void ThemeEngine::drawDD(DrawData type, const Common::Rect &r, uint32 dynamic, b
 	}
 }
 
-void ThemeEngine::drawDDText(TextData type, TextColor color, const Common::Rect &r, const Common::String &text,
-                             bool restoreBg, bool ellipsis, Graphics::TextAlign alignH, TextAlignVertical alignV,
-                             int deltax, const Common::Rect &drawableTextArea) {
-
-	if (type == kTextDataNone || !_texts[type] || _layerToDraw == kDrawLayerBackground)
-		return;
-
-	Common::Rect area = r;
-	area.clip(_screen.w, _screen.h);
-
-	Common::Rect dirty = drawableTextArea;
-	if (dirty.isEmpty()) dirty = area;
-	else dirty.clip(area);
-
-	if (!_clip.isEmpty()) {
-		dirty.clip(_clip);
-	}
-
-	// HACK: One small pixel should be invisible enough
-	if (dirty.isEmpty()) dirty = Common::Rect(0, 0, 1, 1);
-
-	if (restoreBg)
-		restoreBackground(dirty);
-
-	_vectorRenderer->setFgColor(_textColors[color]->r, _textColors[color]->g, _textColors[color]->b);
-#ifdef USE_TRANSLATION
-	_vectorRenderer->drawString(_texts[type]->_fontPtr, TransMan.convertBiDiString(text), area, alignH, alignV, deltax, ellipsis, dirty);
-#else
-	_vectorRenderer->drawString(_texts[type]->_fontPtr, text, area, alignH, alignV, deltax, ellipsis, dirty);
-#endif
-
-	addDirtyRect(dirty);
-}
-
 void ThemeEngine::drawDDText(TextData type, TextColor color, const Common::Rect &r, const Common::U32String &text,
 	bool restoreBg, bool ellipsis, Graphics::TextAlign alignH, TextAlignVertical alignV,
 	int deltax, const Common::Rect &drawableTextArea) {
@@ -1662,10 +1628,6 @@ int ThemeEngine::getFontHeight(FontStyle font) const {
 	return ready() ? _texts[fontStyleToData(font)]->_fontPtr->getFontHeight() : 0;
 }
 
-int ThemeEngine::getStringWidth(const Common::String &str, FontStyle font) const {
-	return ready() ? _texts[fontStyleToData(font)]->_fontPtr->getStringWidth(str) : 0;
-}
-
 int ThemeEngine::getStringWidth(const Common::U32String &str, FontStyle font) const {
 	return ready() ? _texts[fontStyleToData(font)]->_fontPtr->getStringWidth(str) : 0;
 }
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 87acb61eec..761068d174 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -420,8 +420,6 @@ public:
 
 	int getFontHeight(FontStyle font = kFontStyleBold) const;
 
-	int getStringWidth(const Common::String &str, FontStyle font = kFontStyleBold) const;
-
 	int getStringWidth(const Common::U32String &str, FontStyle font = kFontStyleBold) const;
 
 	int getCharWidth(byte c, FontStyle font = kFontStyleBold) const;
@@ -708,10 +706,6 @@ protected:
 	 * These functions are called from all the Widget drawing methods.
 	 */
 	void drawDD(DrawData type, const Common::Rect &r, uint32 dynamic = 0, bool forceRestore = false);
-	void drawDDText(TextData type, TextColor color, const Common::Rect &r, const Common::String &text, bool restoreBg,
-	                bool elipsis, Graphics::TextAlign alignH = Graphics::kTextAlignLeft,
-	                TextAlignVertical alignV = kTextAlignVTop, int deltax = 0,
-	                const Common::Rect &drawableTextArea = Common::Rect(0, 0, 0, 0));
 	void drawDDText(TextData type, TextColor color, const Common::Rect &r, const Common::U32String &text, bool restoreBg,
 	                bool elipsis, Graphics::TextAlign alignH = Graphics::kTextAlignLeft,
 	                TextAlignVertical alignV = kTextAlignVTop, int deltax = 0,


Commit: 186e6142a0f624c239ce469c257678499ec3a000
    https://github.com/scummvm/scummvm/commit/186e6142a0f624c239ce469c257678499ec3a000
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-10-30T22:54:09Z

Commit Message:
COMMON: Remove unused functions in TranslationManager

There were leftovers from the transition to U32String.

Changed paths:
    common/translation.cpp
    common/translation.h


diff --git a/common/translation.cpp b/common/translation.cpp
index f4496739da..fe5d1e9397 100644
--- a/common/translation.cpp
+++ b/common/translation.cpp
@@ -411,13 +411,6 @@ bool TranslationManager::checkHeader(File &in) {
 	return true;
 }
 
-String TranslationManager::convertBiDiString(const String &input) {
-	if (getCurrentLanguage() != "he")		//TODO: modify when we'll support other RTL languages, such as Arabic and Farsi
-		return input;
-
-	return Common::convertBiDiString(input, HE_ISR);
-}
-
 U32String TranslationManager::convertBiDiString(const U32String &input) {
 	if (getCurrentLanguage() != "he")		//TODO: modify when we'll support other RTL languages, such as Arabic and Farsi
 		return input;
diff --git a/common/translation.h b/common/translation.h
index 02ad825ad2..b4cce47386 100644
--- a/common/translation.h
+++ b/common/translation.h
@@ -174,7 +174,6 @@ public:
 	 * For LTR (Left To Right) languages, returns the original input
 	 * For RTL (Right To Left) languages, returns visual representation of a logical single-line input
 	 */
-	String convertBiDiString(const String &input);
 	U32String convertBiDiString(const U32String &input);
 
 private:


Commit: 49a36e6828835bbbac029ca41c0c24bc6a259cc3
    https://github.com/scummvm/scummvm/commit/49a36e6828835bbbac029ca41c0c24bc6a259cc3
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-10-30T23:04:40Z

Commit Message:
GUI: Fix compilation with some compilers

Changed paths:
    gui/ThemeEngine.cpp


diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index cc61b7a2b9..1d00401769 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -652,7 +652,7 @@ bool ThemeEngine::loadExtraFont(FontStyle style, Common::Language lang) {
 	if (entry == _langExtraFonts.end())
 		return false;
 	TextData td = fontStyleToData(style);
-	return addFont(GUI::TextData::kTextDataExtraLang, Common::String(), entry->file(td), entry->sclFile(td), entry->fntSize(td));
+	return addFont(kTextDataExtraLang, Common::String(), entry->file(td), entry->sclFile(td), entry->fntSize(td));
 }
 
 bool ThemeEngine::addTextColor(TextColor colorId, int r, int g, int b) {




More information about the Scummvm-git-logs mailing list