diff --git a/src/menu.cpp b/src/menu.cpp index 6e43b8c..a834faf 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -140,9 +140,7 @@ void Menu::skinUpdated() { //reload section icons vector::size_type i = 0; for (string sectionName : sections) { - string sectionIcon = "sections/" + sectionName + ".png"; - if (!gmenu2x->sc.getSkinFilePath(sectionIcon).empty()) - gmenu2x->sc.add("skin:" + sectionIcon); + gmenu2x->sc["skin:sections/" + sectionName + ".png"]; for (Link *&link : links[i]) { link->loadIcon(); diff --git a/src/surfacecollection.h b/src/surfacecollection.h index 12a434d..63d093b 100644 --- a/src/surfacecollection.h +++ b/src/surfacecollection.h @@ -44,7 +44,6 @@ public: void debug(); - OffscreenSurface *add(const std::string &path); OffscreenSurface *addSkinRes(const std::string &path, bool useDefault = true); void del(const std::string &path); void clear(); @@ -55,6 +54,8 @@ public: OffscreenSurface *skinRes(const std::string &key, bool useDefault = true); private: + OffscreenSurface *add(const std::string &path); + SurfaceHash surfaces; std::string skin; };