[Scummvm-git-logs] scummvm master -> 01fed3e4624a5a917bf21d52ba19c5a03e095573

sev- noreply at scummvm.org
Thu Jan 5 13:40:35 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:
01fed3e462 GUI: Load icons set in correct order


Commit: 01fed3e4624a5a917bf21d52ba19c5a03e095573
    https://github.com/scummvm/scummvm/commit/01fed3e4624a5a917bf21d52ba19c5a03e095573
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-01-05T14:38:59+01:00

Commit Message:
GUI: Load icons set in correct order

Previously we were loading default gui-icons.dat first which
was effectively preventing us from overriding the matching files
from the icon packs.

Changed paths:
    gui/gui-manager.cpp


diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index c802feec40e..a1ba5912a29 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -124,26 +124,6 @@ void GuiManager::initIconsSet() {
 
 	_iconsSet.clear();
 
-	if (!ConfMan.get("iconspath").empty()) {
-		Common::FSDirectory *iconDir = new Common::FSDirectory(ConfMan.get("iconspath"));
-		Common::ArchiveMemberList iconFiles;
-
-		iconDir->listMatchingMembers(iconFiles, "gui-icons*.dat");
-		Common::sort(iconFiles.begin(), iconFiles.end(), ArchiveMemberListBackComparator());
-
-		for (Common::ArchiveMemberList::iterator ic = iconFiles.begin(); ic != iconFiles.end(); ++ic) {
-			debug(2, "GUI: Loaded icon file: %s", (*ic)->getName().c_str());
-
-			dat = Common::makeZipArchive((*ic)->createReadStream());
-
-			if (dat) {
-				_iconsSet.add((*ic)->getName(), dat);
-			}
-		}
-
-		delete iconDir;
-	}
-
 	dat = nullptr;
 
 	const char fname[] = "gui-icons.dat";
@@ -170,14 +150,34 @@ void GuiManager::initIconsSet() {
 		if (!dat) {
 			warning("GUI: Could not find '%s'", fname);
 			delete file;
-			return;
 		}
 	}
 
-	_iconsSet.add(fname, dat);
-	_iconsSetChanged = true;
+	if (dat) {
+		_iconsSet.add(fname, dat);
+		_iconsSetChanged = true;
+		debug(2, "GUI: Loaded icon file: %s", fname);
+	}
+
+	if (!ConfMan.get("iconspath").empty()) {
+		Common::FSDirectory *iconDir = new Common::FSDirectory(ConfMan.get("iconspath"));
+		Common::ArchiveMemberList iconFiles;
+
+		iconDir->listMatchingMembers(iconFiles, "gui-icons*.dat");
+		Common::sort(iconFiles.begin(), iconFiles.end(), ArchiveMemberListBackComparator());
 
-	debug(2, "GUI: Loaded icon file: %s", fname);
+		for (Common::ArchiveMemberList::iterator ic = iconFiles.begin(); ic != iconFiles.end(); ++ic) {
+			dat = Common::makeZipArchive((*ic)->createReadStream());
+
+			if (dat) {
+				_iconsSet.add((*ic)->getName(), dat);
+				_iconsSetChanged = true;
+				debug(2, "GUI: Loaded icon file: %s", (*ic)->getName().c_str());
+			}
+		}
+
+		delete iconDir;
+	}
 }
 
 void GuiManager::computeScaleFactor() {




More information about the Scummvm-git-logs mailing list