[Scummvm-git-logs] scummvm master -> 8c33d23e9c6c2c67e895dbc0fbdcd6eca4330287
sev-
noreply at scummvm.org
Tue Apr 23 10:36:47 UTC 2024
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:
8c33d23e9c GUI: Make sure we reload bitmaps on changed scale
Commit: 8c33d23e9c6c2c67e895dbc0fbdcd6eca4330287
https://github.com/scummvm/scummvm/commit/8c33d23e9c6c2c67e895dbc0fbdcd6eca4330287
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-04-23T12:36:38+02:00
Commit Message:
GUI: Make sure we reload bitmaps on changed scale
Fixes GMM in TWP and other OpenGL-based engines
Changed paths:
gui/ThemeEngine.cpp
gui/ThemeEngine.h
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 5d00c2d9944..ad133849fec 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -305,6 +305,10 @@ const char *ThemeEngine::findModeConfigName(GraphicsMode mode) {
void ThemeEngine::setBaseResolution(int w, int h, float s) {
_baseWidth = w;
_baseHeight = h;
+
+ if (s != _scaleFactor)
+ _needScaleRefresh = true;
+
_scaleFactor = s;
_parser->setBaseResolution(w, h, s);
@@ -377,7 +381,7 @@ void ThemeEngine::clearAll() {
void ThemeEngine::refresh() {
// Flush all bitmaps if the overlay pixel format changed.
- if (_overlayFormat != _system->getOverlayFormat()) {
+ if (_overlayFormat != _system->getOverlayFormat() || _needScaleRefresh) {
for (ImagesMap::iterator i = _bitmaps.begin(); i != _bitmaps.end(); ++i) {
Graphics::ManagedSurface *surf = i->_value;
if (surf) {
@@ -386,6 +390,8 @@ void ThemeEngine::refresh() {
}
}
_bitmaps.clear();
+
+ _needScaleRefresh = false;
}
init();
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 436699db2b3..acc1b3d6be9 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -778,6 +778,7 @@ protected:
int16 _baseWidth, _baseHeight;
float _scaleFactor;
+ bool _needScaleRefresh = false;
/** Font info. */
const Graphics::Font *_font;
More information about the Scummvm-git-logs
mailing list