[Scummvm-git-logs] scummvm master -> f068d5a65da3b66c593c985c640e4a36127667ca
sev-
noreply at scummvm.org
Fri Jan 20 18:09:58 UTC 2023
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:
f068d5a65d GUI: Add SVG loading for extras overlay
Commit: f068d5a65da3b66c593c985c640e4a36127667ca
https://github.com/scummvm/scummvm/commit/f068d5a65da3b66c593c985c640e4a36127667ca
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-01-20T19:09:55+01:00
Commit Message:
GUI: Add SVG loading for extras overlay
Changed paths:
gui/widgets/grid.cpp
diff --git a/gui/widgets/grid.cpp b/gui/widgets/grid.cpp
index 0a51805c852..829cf80fdc1 100644
--- a/gui/widgets/grid.cpp
+++ b/gui/widgets/grid.cpp
@@ -141,7 +141,7 @@ void GridItemWidget::drawWidget() {
// Draw Demo Overlay
const Graphics::ManagedSurface *demoGfx = _grid->demoToSurface(_activeEntry->extra);
if (demoGfx) {
- Common::Point p(_x + ((thumbWidth - demoGfx->w)/2) , _y + (thumbHeight - demoGfx->h - 10));
+ Common::Point p(_x, _y);
g_gui.theme()->drawSurface(p, *demoGfx, true);
}
@@ -710,7 +710,12 @@ void GridWidget::loadPlatformIcons() {
}
void GridWidget::loadExtraIcons() { // for now only the demo icon is available
- Graphics::ManagedSurface *gfx = loadSurfaceFromFile("icons/extra/demo.png");
+ Graphics::ManagedSurface *gfx = loadSurfaceFromFile("icons/extra/demo.svg", _extraIconWidth, _extraIconHeight);
+ if (gfx) {
+ _extraIcons[0] = gfx;
+ return;
+ } // if no .svg file is available, search for a .png
+ gfx = loadSurfaceFromFile("icons/extra/demo.png");
if (gfx) {
const Graphics::ManagedSurface *scGfx = scaleGfx(gfx, _extraIconWidth, _extraIconHeight, true);
_extraIcons[0] = scGfx;
@@ -941,8 +946,8 @@ void GridWidget::reflowLayout() {
_flagIconWidth = _thumbnailWidth / 4;
_flagIconHeight = _flagIconWidth / 2;
_platformIconHeight = _platformIconWidth = _thumbnailWidth / 6;
- _extraIconWidth = _thumbnailWidth / 2;
- _extraIconHeight = _extraIconWidth / 4;
+ _extraIconWidth = _thumbnailWidth;
+ _extraIconHeight = _thumbnailHeight;
if ((oldThumbnailHeight != _thumbnailHeight) || (oldThumbnailWidth != _thumbnailWidth)) {
unloadSurfaces(_extraIcons);
More information about the Scummvm-git-logs
mailing list