[Scummvm-git-logs] scummvm master -> 0b1008811061866d802ed335b47b2d00f1becbec
sev-
sev at scummvm.org
Wed Jun 30 16:12:37 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:
6fb05fceeb GUI: If GraphicsWidget is hidden do not proceed with GraphicsWidget::setGfx()
8a04060c68 GUI: Increase scope of setGfx() fix to more setGfx() of relevant widgets
0b10088110 JANITORIAL: Fix wrong spacing for return commands
Commit: 6fb05fceeb4843ac21b1b975a683a2a19091c788
https://github.com/scummvm/scummvm/commit/6fb05fceeb4843ac21b1b975a683a2a19091c788
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2021-06-30T18:12:32+02:00
Commit Message:
GUI: If GraphicsWidget is hidden do not proceed with GraphicsWidget::setGfx()
Removes interfering invisible thumbnail with list item selection in saveload-dialog (OpenGL, large scale)
I'm issuing this as a PR because I'm unsure if this fix is ok, since it affects all GraphicsWidget objects, not just the one for thumbnail in saveload-dialog. Also not sure if some similar check should be done in the other setGfx() methods in widget.cpp to prevent similar issues.
Note that an alternative fix, which also works, would be to only modify gui/saveload-dialog.cpp and method SaveLoadChooserSimple::updateSelection(), to check for _gfxWidget isVisible status before calling: _gfxWidget->setGfx(thumb, true);
Changed paths:
gui/widget.cpp
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 977288ddbe..99d0df9fe1 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -880,6 +880,9 @@ void GraphicsWidget::setGfx(const Graphics::ManagedSurface *gfx, bool scale) {
return;
}
+ if (!isVisible())
+ return;
+
float sf = g_gui.getScaleFactor();
if (scale && sf != 1.0) {
_w = gfx->w * sf;
Commit: 8a04060c68f0f49c830a7928bf4a4b0dc8adf772
https://github.com/scummvm/scummvm/commit/8a04060c68f0f49c830a7928bf4a4b0dc8adf772
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2021-06-30T18:12:32+02:00
Commit Message:
GUI: Increase scope of setGfx() fix to more setGfx() of relevant widgets
Fix is to not proceed with setGfx except for freeing _gfx mem, if widget or its boss is invisible
Changed paths:
gui/widget.cpp
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 99d0df9fe1..c75dbdcd79 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -598,6 +598,9 @@ void PicButtonWidget::setGfx(const Graphics::ManagedSurface *gfx, int statenum,
return;
}
+ if (!isVisible() || !_boss->isVisible())
+ return;
+
float sf = g_gui.getScaleFactor();
if (scale && sf != 1.0) {
Graphics::Surface *tmp2 = gfx->rawSurface().scale(gfx->w * sf, gfx->h * sf, false);
@@ -624,6 +627,11 @@ void PicButtonWidget::setGfxFromTheme(const char *name, int statenum, bool scale
}
void PicButtonWidget::setGfx(int w, int h, int r, int g, int b, int statenum) {
+ _gfx[statenum].free();
+
+ if (!isVisible() || !_boss->isVisible())
+ return;
+
if (w == -1)
w = _w;
if (h == -1)
@@ -631,7 +639,6 @@ void PicButtonWidget::setGfx(int w, int h, int r, int g, int b, int statenum) {
const Graphics::PixelFormat &requiredFormat = g_gui.theme()->getPixelFormat();
- _gfx[statenum].free();
_gfx[statenum].create(w, h, requiredFormat);
_gfx[statenum].fillRect(Common::Rect(0, 0, w, h), _gfx[statenum].format.RGBToColor(r, g, b));
}
@@ -880,7 +887,7 @@ void GraphicsWidget::setGfx(const Graphics::ManagedSurface *gfx, bool scale) {
return;
}
- if (!isVisible())
+ if (!isVisible() || !_boss->isVisible())
return;
float sf = g_gui.getScaleFactor();
@@ -909,6 +916,11 @@ void GraphicsWidget::setGfx(const Graphics::Surface *gfx, bool scale) {
}
void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
+ _gfx.free();
+
+ if (!isVisible() || !_boss->isVisible())
+ return;
+
if (w == -1)
w = _w;
if (h == -1)
@@ -916,7 +928,6 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
const Graphics::PixelFormat &requiredFormat = g_gui.theme()->getPixelFormat();
- _gfx.free();
_gfx.create(w, h, requiredFormat);
_gfx.fillRect(Common::Rect(0, 0, w, h), _gfx.format.RGBToColor(r, g, b));
}
Commit: 0b1008811061866d802ed335b47b2d00f1becbec
https://github.com/scummvm/scummvm/commit/0b1008811061866d802ed335b47b2d00f1becbec
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2021-06-30T18:12:32+02:00
Commit Message:
JANITORIAL: Fix wrong spacing for return commands
Changed paths:
gui/widget.cpp
diff --git a/gui/widget.cpp b/gui/widget.cpp
index c75dbdcd79..1b09f13d14 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -630,7 +630,7 @@ void PicButtonWidget::setGfx(int w, int h, int r, int g, int b, int statenum) {
_gfx[statenum].free();
if (!isVisible() || !_boss->isVisible())
- return;
+ return;
if (w == -1)
w = _w;
@@ -919,7 +919,7 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
_gfx.free();
if (!isVisible() || !_boss->isVisible())
- return;
+ return;
if (w == -1)
w = _w;
More information about the Scummvm-git-logs
mailing list