[Scummvm-git-logs] scummvm master -> 3eba076fa029fb225565e98e5a0ad255c48d121a
SupSuper
supsuper at gmail.com
Tue Apr 13 18:27:45 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8f7d28f85e GUI: Fix scaling for simple saveload dialog
3eba076fa0 SDL: Fix null check in getDisplayDpiFromSdl
Commit: 8f7d28f85eb2c7ff0a91d341fad1a7e490492770
https://github.com/scummvm/scummvm/commit/8f7d28f85eb2c7ff0a91d341fad1a7e490492770
Author: SupSuper (supsuper at gmail.com)
Date: 2021-04-13T19:08:22+01:00
Commit Message:
GUI: Fix scaling for simple saveload dialog
Changed paths:
gui/saveload-dialog.cpp
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index fe62cd57e3..fd3de19101 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -499,8 +499,8 @@ void SaveLoadChooserSimple::reflowLayout() {
error("Error when loading position data for Save/Load Thumbnails");
// Even if there is no thumbnail support, getWidgetData() will provide default thumbnail values
- int thumbW = kThumbnailWidth;
- int thumbH = kThumbnailHeight2;
+ int thumbW = SCALEVALUE(kThumbnailWidth);
+ int thumbH = SCALEVALUE(kThumbnailHeight2);
int thumbX = x + (w >> 1) - (thumbW >> 1);
int thumbY = y + kLineHeight;
@@ -513,7 +513,7 @@ void SaveLoadChooserSimple::reflowLayout() {
textLines++; // add a line of padding at the bottom
if (_thumbnailSupport) {
- _gfxWidget->resize(thumbX, thumbY, thumbW, thumbH);
+ _gfxWidget->resize(thumbX, thumbY, thumbW, thumbH, false);
_gfxWidget->setVisible(true);
} else {
// choose sensible values for displaying playtime and date/time when a thumbnail is not being used
@@ -526,9 +526,9 @@ void SaveLoadChooserSimple::reflowLayout() {
int height = thumbY + thumbH + kLineHeight;
if (_saveDateSupport) {
- _date->resize(thumbX, height, thumbW, kLineHeight);
+ _date->resize(thumbX, height, thumbW, kLineHeight, false);
height += kLineHeight;
- _time->resize(thumbX, height, thumbW, kLineHeight);
+ _time->resize(thumbX, height, thumbW, kLineHeight, false);
height += kLineHeight;
_date->setVisible(_saveDateSupport);
_time->setVisible(_saveDateSupport);
@@ -538,13 +538,13 @@ void SaveLoadChooserSimple::reflowLayout() {
}
if (_playTimeSupport) {
- _playtime->resize(thumbX, height, thumbW, kLineHeight);
+ _playtime->resize(thumbX, height, thumbW, kLineHeight, false);
_playtime->setVisible(_playTimeSupport);
} else {
_playtime->setVisible(false);
}
- _container->resize(x, y, w, h + (kLineHeight * textLines));
+ _container->resize(x, y, w, h + (kLineHeight * textLines), false);
_container->setVisible(true);
updateSelection(false);
Commit: 3eba076fa029fb225565e98e5a0ad255c48d121a
https://github.com/scummvm/scummvm/commit/3eba076fa029fb225565e98e5a0ad255c48d121a
Author: SupSuper (supsuper at gmail.com)
Date: 2021-04-13T19:27:31+01:00
Commit Message:
SDL: Fix null check in getDisplayDpiFromSdl
Changed paths:
backends/graphics/openglsdl/openglsdl-graphics.h
backends/graphics/sdl/sdl-graphics.h
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h
index 87046ff8ea..6eb406447b 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.h
+++ b/backends/graphics/openglsdl/openglsdl-graphics.h
@@ -67,6 +67,7 @@ protected:
int realWidth, realHeight;
SDL_GL_GetDrawableSize(_window->getSDLWindow(), &realWidth, &realHeight);
int scale = realWidth / windowWidth;
+ debug(4, "window: %dx%d drawable: %dx%d scale: %d", windowWidth, windowHeight, realWidth, realHeight, scale);
return scale;
#else
return 1;
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index df6bc8eb86..760473cde8 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -199,17 +199,19 @@ protected:
#endif
if (defaultDpi)
*defaultDpi = systemDpi;
+
+ if (dpi) {
#if SDL_VERSION_ATLEAST(2, 0, 4)
- int displayIndex = 0;
- getWindowDisplayIndexFromSdl(&displayIndex);
+ int displayIndex = 0;
+ getWindowDisplayIndexFromSdl(&displayIndex);
- if (SDL_GetDisplayDPI(displayIndex, NULL, dpi, NULL) != 0) {
- if (dpi)
- *dpi = systemDpi;
- }
+ if (SDL_GetDisplayDPI(displayIndex, NULL, dpi, NULL) != 0) {
+ *dpi = systemDpi;
+ }
#else
- *dpi = systemDpi;
+ *dpi = systemDpi;
#endif
+ }
}
/**
More information about the Scummvm-git-logs
mailing list