[Scummvm-git-logs] scummvm branch-2-6 -> 1460b901a675d8835582d8212ee78c21d65b5b7e

lotharsm noreply at scummvm.org
Tue Oct 4 19:08:52 UTC 2022


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:
1460b901a6 GUI: Fix engine icons only showing up in grid once


Commit: 1460b901a675d8835582d8212ee78c21d65b5b7e
    https://github.com/scummvm/scummvm/commit/1460b901a675d8835582d8212ee78c21d65b5b7e
Author: SupSuper (supsuper at gmail.com)
Date: 2022-10-04T21:07:53+02:00

Commit Message:
GUI: Fix engine icons only showing up in grid once

Changed paths:
    gui/widgets/grid.cpp


diff --git a/gui/widgets/grid.cpp b/gui/widgets/grid.cpp
index f2c01641a76..8d73e11843e 100644
--- a/gui/widgets/grid.cpp
+++ b/gui/widgets/grid.cpp
@@ -635,6 +635,7 @@ void GridWidget::reloadThumbnails() {
 			continue;
 
 		if (!_loadedSurfaces.contains(entry->thumbPath)) {
+			_loadedSurfaces[entry->thumbPath] = nullptr;
 			Common::String path = Common::String::format("icons/%s-%s.png", entry->engineid.c_str(), entry->gameid.c_str());
 			Graphics::ManagedSurface *surf = loadSurfaceFromFile(path);
 			if (!surf) {
@@ -642,9 +643,9 @@ void GridWidget::reloadThumbnails() {
 				if (!_loadedSurfaces.contains(path)) {
 					surf = loadSurfaceFromFile(path);
 				} else {
-					continue;
+					const Graphics::ManagedSurface *scSurf = _loadedSurfaces[path];
+					_loadedSurfaces[entry->thumbPath] = new Graphics::ManagedSurface(*scSurf);
 				}
-
 			}
 
 			if (surf) {
@@ -659,8 +660,6 @@ void GridWidget::reloadThumbnails() {
 					surf->free();
 					delete surf;
 				}
-			} else {
-				_loadedSurfaces[entry->thumbPath] = nullptr;
 			}
 		}
 	}




More information about the Scummvm-git-logs mailing list