From 3d82c0e8b4c330ecaa0230c8eede65bad4f89be0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 14 Nov 2021 22:22:21 +0100 Subject: [PATCH] GUI: Fix loading gui-icons.dat from Windows resource --- gui/gui-manager.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index f5265a29d8c..5f0ec3211db 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -25,6 +25,7 @@ #include "common/util.h" #include "common/config-manager.h" #include "common/algorithm.h" +#include "common/file.h" #include "common/rect.h" #include "common/textconsole.h" #include "common/translation.h" @@ -163,7 +164,17 @@ void GuiManager::initIconsSet() { if (!fs) fs = new Common::FSNode(fname); - dat = Common::makeZipArchive(*fs); + if (fs) { + dat = Common::makeZipArchive(*fs); + } else { + // We could be on Windows with gui-icons.dat file as an + // embedded resource. Try it. + Common::File *in = new Common::File; + in->open(fname); + + if (in->isOpen()) + dat = Common::makeZipArchive(in); + } if (!dat) { warning("GUI: Could not find '%s'", path.c_str());