[Scummvm-git-logs] scummvm master -> 6ba2fb9f3b81bde46cbe208748cba1248c2b961d

sev- noreply at scummvm.org
Sun Nov 21 19:01:10 UTC 2021


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:
b9a2753c2c GUI: Fix compilation with LAYOUT_DEBUG_DIALOG enabled
ae7254da5d GUI: Fix GUI layout debugging
6ba2fb9f3b GUI: Fixed crash in 640x400 theme. Bumped theme version.


Commit: b9a2753c2c12d861228459e17ffe19c93ba059b5
    https://github.com/scummvm/scummvm/commit/b9a2753c2c12d861228459e17ffe19c93ba059b5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-11-21T20:00:08+01:00

Commit Message:
GUI: Fix compilation with LAYOUT_DEBUG_DIALOG enabled

Changed paths:
    gui/ThemeEval.h
    gui/ThemeLayout.cpp
    gui/ThemeLayout.h


diff --git a/gui/ThemeEval.h b/gui/ThemeEval.h
index c357275283..64c3d1fa14 100644
--- a/gui/ThemeEval.h
+++ b/gui/ThemeEval.h
@@ -96,8 +96,17 @@ public:
 	Graphics::TextAlign getWidgetTextHAlign(const Common::String &widget);
 
 #ifdef LAYOUT_DEBUG_DIALOG
-	void debugDraw(Graphics::Surface *screen, const Graphics::Font *font) {
-		_layouts[LAYOUT_DEBUG_DIALOG]->debugDraw(screen, font);
+	void debugDraw(Graphics::ManagedSurface *screen, const Graphics::Font *font) {
+		if (_layouts.contains(LAYOUT_DEBUG_DIALOG)) {
+			_layouts[LAYOUT_DEBUG_DIALOG]->debugDraw(screen, font);
+		} else {
+			Common::String list;
+
+			for (auto l = _layouts.begin(); l != _layouts.end(); ++l)
+				list += " " + l->_key;
+
+			warning("debugDraw: Unknown layout %s\nList:%s", LAYOUT_DEBUG_DIALOG, list.c_str());
+		}
 	}
 #endif
 
diff --git a/gui/ThemeLayout.cpp b/gui/ThemeLayout.cpp
index 3d38a7d8ab..1918c7b3f5 100644
--- a/gui/ThemeLayout.cpp
+++ b/gui/ThemeLayout.cpp
@@ -146,7 +146,7 @@ int16 ThemeLayoutStacked::getParentHeight() {
 }
 
 #ifdef LAYOUT_DEBUG_DIALOG
-void ThemeLayout::debugDraw(Graphics::Surface *screen, const Graphics::Font *font) {
+void ThemeLayout::debugDraw(Graphics::ManagedSurface *screen, const Graphics::Font *font) {
 	uint32 color = 0xFFFFFFFF;
 	font->drawString(screen, getName(), _x, _y, _w, color, Graphics::kTextAlignRight, 0, true);
 	screen->hLine(_x, _y, _x + _w, color);
diff --git a/gui/ThemeLayout.h b/gui/ThemeLayout.h
index 51f3cd7c83..52ca97a51d 100644
--- a/gui/ThemeLayout.h
+++ b/gui/ThemeLayout.h
@@ -27,6 +27,8 @@
 #include "common/rect.h"
 #include "graphics/font.h"
 
+//#define LAYOUT_DEBUG_DIALOG "Dialog.Launcher"
+
 #ifdef LAYOUT_DEBUG_DIALOG
 namespace Graphics {
 struct Surface;
@@ -124,10 +126,9 @@ public:
 	Graphics::TextAlign getTextHAlign() { return _textHAlign; }
 
 #ifdef LAYOUT_DEBUG_DIALOG
-	void debugDraw(Graphics::Surface *screen, const Graphics::Font *font);
-
-	virtual const char *getName() const = 0;
+	void debugDraw(Graphics::ManagedSurface *screen, const Graphics::Font *font);
 #endif
+	virtual const char *getName() const { return "<override-me>"; }
 
 protected:
 	ThemeLayout *_parent;
@@ -159,7 +160,7 @@ public:
 		_y = _defaultY;
 	}
 
-	const char *getName() const { return _name.c_str(); }
+	virtual const char *getName() const override { return _name.c_str(); }
 
 protected:
 	LayoutType getLayoutType() const override { return kLayoutMain; }
@@ -192,7 +193,7 @@ public:
 	void reflowLayoutVertical(Widget *widgetChain);
 
 #ifdef LAYOUT_DEBUG_DIALOG
-	const char *getName() const {
+	const char *getName() const override {
 		return (_type == kLayoutVertical)
 			? "Vertical Layout" : "Horizontal Layout";
 	}
@@ -234,7 +235,7 @@ public:
 
 	void reflowLayout(Widget *widgetChain) override;
 
-	virtual const char *getName() const { return _name.c_str(); }
+	virtual const char *getName() const override { return _name.c_str(); }
 
 protected:
 	LayoutType getLayoutType() const override { return kLayoutWidget; }
@@ -300,7 +301,7 @@ public:
 	bool getWidgetData(const Common::String &name, int16 &x, int16 &y, int16 &w, int16 &h, bool &useRTL) override { return false; }
 	void reflowLayout(Widget *widgetChain) override {}
 #ifdef LAYOUT_DEBUG_DIALOG
-	const char *getName() const { return "SPACE"; }
+	const char *getName() const override { return "SPACE"; }
 #endif
 
 protected:


Commit: ae7254da5da0189707a37d8fc4c2c5526cc3906d
    https://github.com/scummvm/scummvm/commit/ae7254da5da0189707a37d8fc4c2c5526cc3906d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-11-21T20:00:08+01:00

Commit Message:
GUI: Fix GUI layout debugging

Changed paths:
    gui/dialog.cpp


diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 24409781d0..ad35a968a6 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -174,6 +174,10 @@ void Dialog::drawDialog(DrawLayer layerToDraw) {
 	g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + _h), _backgroundType);
 
 	markWidgetsAsDirty();
+
+#ifdef LAYOUT_DEBUG_DIALOG
+	return;
+#endif
 	drawWidgets();
 }
 


Commit: 6ba2fb9f3b81bde46cbe208748cba1248c2b961d
    https://github.com/scummvm/scummvm/commit/6ba2fb9f3b81bde46cbe208748cba1248c2b961d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-11-21T20:00:08+01:00

Commit Message:
GUI: Fixed crash in 640x400 theme. Bumped theme version.

This is made by allowing widgets to be skipped for certain resolutions.
In this particlar case, the new layour switcher buttons were not
fitting by height on 640x400 theme, so we now reduce spacing
between the action buttons.

Changed paths:
    gui/ThemeEngine.h
    gui/ThemeParser.cpp
    gui/ThemeParser.h
    gui/themes/residualvm.zip
    gui/themes/residualvm/THEMERC
    gui/themes/residualvm/remastered_layout.stx
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/THEMERC
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/THEMERC
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummremastered.zip
    gui/themes/scummremastered/THEMERC
    gui/themes/scummremastered/remastered_layout.stx


diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index a85c662e43..13be0cc744 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -37,7 +37,7 @@
 #include "graphics/pixelformat.h"
 
 
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.53"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.54"
 
 class OSystem;
 
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index 090129cd9d..543c37579d 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -698,13 +698,12 @@ bool ThemeParser::parserCallback_def(ParserNode *node) {
 bool ThemeParser::parserCallback_widget(ParserNode *node) {
 	Common::String var;
 
-	if (getParentNode(node)->name == "globals") {
-
-		if (resolutionCheck(node->values["resolution"]) == false) {
-			node->ignore = true;
-			return true;
-		}
+	if (resolutionCheck(node->values["resolution"]) == false) {
+		node->ignore = true;
+		return true;
+	}
 
+	if (getParentNode(node)->name == "globals") {
 		var = "Globals." + node->values["name"] + ".";
 		if (!parseCommonLayoutProps(node, var))
 			return parserError("Error parsing Layout properties of '" + var + "'.");
@@ -860,6 +859,11 @@ bool ThemeParser::parserCallback_layout(ParserNode *node) {
 bool ThemeParser::parserCallback_space(ParserNode *node) {
 	int size = -1;
 
+	if (resolutionCheck(node->values["resolution"]) == false) {
+		node->ignore = true;
+		return true;
+	}
+
 	if (node->values.contains("size")) {
 		if (_theme->getEvaluator()->hasVar(node->values["size"]))
 			size = _theme->getEvaluator()->getVar(node->values["size"]);
diff --git a/gui/ThemeParser.h b/gui/ThemeParser.h
index f6fd837245..5bd7d306f2 100644
--- a/gui/ThemeParser.h
+++ b/gui/ThemeParser.h
@@ -217,10 +217,12 @@ protected:
 						XML_PROP(type, false)
 						XML_PROP(textalign, false)
 						XML_PROP(rtl, false)
+						XML_PROP(resolution, false)
 					KEY_END()
 
 					XML_KEY(space)
 						XML_PROP(size, false)
+						XML_PROP(resolution, false)
 					KEY_END()
 
 					XML_KEY_RECURSIVE(layout)
diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip
index 8f919bb801..5a52535ef6 100644
Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ
diff --git a/gui/themes/residualvm/THEMERC b/gui/themes/residualvm/THEMERC
index 6d3bb76f38..ef93154d10 100644
--- a/gui/themes/residualvm/THEMERC
+++ b/gui/themes/residualvm/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.53:ResidualVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.8.54:ResidualVM Modern Theme Remastered:No Author]
diff --git a/gui/themes/residualvm/remastered_layout.stx b/gui/themes/residualvm/remastered_layout.stx
index b6df042bc3..5a3cc9d8e8 100644
--- a/gui/themes/residualvm/remastered_layout.stx
+++ b/gui/themes/residualvm/remastered_layout.stx
@@ -195,7 +195,8 @@
 					<widget name = 'LoadGameButton'
 							type = 'Button'
 					/>
-					<space size = '10' />
+					<space size = '5'/>
+					<space size = '5' resolution = 'y>420' />
 					<widget name = 'AddGameButton'
 							type = 'Button'
 					/>
@@ -205,14 +206,16 @@
 					<widget name = 'RemoveGameButton'
 							type = 'Button'
 					/>
-					<space size = '10' />
+					<space size = '5'/>
+					<space size = '5' resolution = 'y>420' />
 					<widget name = 'OptionsButton'
 							type = 'Button'
 					/>
 					<widget name = 'AboutButton'
 							type = 'Button'
 					/>
-					<space size = '10' />
+					<space size = '5'/>
+					<space size = '5' resolution = 'y>420' />
 					<widget name = 'QuitButton'
 							type = 'Button'
 					/>
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 5621bbdeaa..94e9b08b17 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index b0288b9dab..7f20d0ec9e 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.53:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8.54:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index ac2d7208a3..daa7bba509 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index f50d108d02..98ac6d3334 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.53:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.8.54:ScummVM Modern Theme:No Author]
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 42910e4e71..68723f09cc 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -194,7 +194,8 @@
 					<widget name = 'LoadGameButton'
 							type = 'Button'
 					/>
-					<space size = '10' />
+					<space size = '5'/>
+					<space size = '5' resolution = 'y>420' />
 					<widget name = 'AddGameButton'
 							type = 'Button'
 					/>
@@ -204,14 +205,16 @@
 					<widget name = 'RemoveGameButton'
 							type = 'Button'
 					/>
-					<space size = '10' />
+					<space size = '5'/>
+					<space size = '5' resolution = 'y>420' />
 					<widget name = 'OptionsButton'
 							type = 'Button'
 					/>
 					<widget name = 'AboutButton'
 							type = 'Button'
 					/>
-					<space size = '10' />
+					<space size = '5'/>
+					<space size = '5' resolution = 'y>420' />
 					<widget name = 'QuitButton'
 							type = 'Button'
 					/>
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index c67194fe4e..0c56728bc3 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ
diff --git a/gui/themes/scummremastered/THEMERC b/gui/themes/scummremastered/THEMERC
index b25824e24b..6c5527fef3 100644
--- a/gui/themes/scummremastered/THEMERC
+++ b/gui/themes/scummremastered/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.53:ScummVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.8.54:ScummVM Modern Theme Remastered:No Author]
diff --git a/gui/themes/scummremastered/remastered_layout.stx b/gui/themes/scummremastered/remastered_layout.stx
index b6df042bc3..5a3cc9d8e8 100644
--- a/gui/themes/scummremastered/remastered_layout.stx
+++ b/gui/themes/scummremastered/remastered_layout.stx
@@ -195,7 +195,8 @@
 					<widget name = 'LoadGameButton'
 							type = 'Button'
 					/>
-					<space size = '10' />
+					<space size = '5'/>
+					<space size = '5' resolution = 'y>420' />
 					<widget name = 'AddGameButton'
 							type = 'Button'
 					/>
@@ -205,14 +206,16 @@
 					<widget name = 'RemoveGameButton'
 							type = 'Button'
 					/>
-					<space size = '10' />
+					<space size = '5'/>
+					<space size = '5' resolution = 'y>420' />
 					<widget name = 'OptionsButton'
 							type = 'Button'
 					/>
 					<widget name = 'AboutButton'
 							type = 'Button'
 					/>
-					<space size = '10' />
+					<space size = '5'/>
+					<space size = '5' resolution = 'y>420' />
 					<widget name = 'QuitButton'
 							type = 'Button'
 					/>




More information about the Scummvm-git-logs mailing list