From 2178567ba05327d300e55351e76c13600b0af41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 24 Apr 2022 14:12:15 +0200 Subject: [PATCH] UWP: Fix loading the default theme. Hopefully takes care of #15496 See also #15464 --- Common/UI/Context.cpp | 1 + UI/Theme.cpp | 7 ++++--- UWP/UWP.vcxproj | 16 +++++++++++++++- UWP/UWP.vcxproj.filters | 6 ++++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Common/UI/Context.cpp b/Common/UI/Context.cpp index c6bc911e23b1..194b3dc2ea34 100644 --- a/Common/UI/Context.cpp +++ b/Common/UI/Context.cpp @@ -36,6 +36,7 @@ void UIContext::Init(Draw::DrawContext *thin3d, Draw::Pipeline *uipipe, Draw::Pi } void UIContext::setUIAtlas(const std::string &name) { + _dbg_assert_(!name.empty()); UIAtlas_ = name; } diff --git a/UI/Theme.cpp b/UI/Theme.cpp index 91e1ea780d6e..1dced507e3cc 100644 --- a/UI/Theme.cpp +++ b/UI/Theme.cpp @@ -73,6 +73,7 @@ static void LoadThemeInfo(const std::vector &directories) { themeInfos.clear(); ThemeInfo def{}; def.name = "Default"; + def.UIAtlas = "ui_atlas"; themeInfos.push_back(def); // This will update the theme if already present, as such default in assets/theme will get priority if exist @@ -228,14 +229,14 @@ void UpdateTheme(UIContext *ctx) { ui_theme.backgroundColor = themeInfos[i].uBackgroundColor; // Load any missing atlas metadata (the images are loaded from UIContext). - LoadAtlasMetadata(ui_atlas, (themeInfos[i].UIAtlas+".meta").c_str(), true); + LoadAtlasMetadata(ui_atlas, (themeInfos[i].UIAtlas + ".meta").c_str(), true); #if !(PPSSPP_PLATFORM(WINDOWS) || PPSSPP_PLATFORM(ANDROID)) LoadAtlasMetadata(font_atlas, "font_atlas.meta", ui_atlas.num_fonts == 0); #else LoadAtlasMetadata(font_atlas, "asciifont_atlas.meta", ui_atlas.num_fonts == 0); #endif - ctx->setUIAtlas(themeInfos[i].UIAtlas+".zim"); + ctx->setUIAtlas(themeInfos[i].UIAtlas + ".zim"); } UI::Theme *GetTheme() { @@ -263,4 +264,4 @@ std::vector GetThemeInfoNames() { names.push_back(i.name); return names; -} \ No newline at end of file +} diff --git a/UWP/UWP.vcxproj b/UWP/UWP.vcxproj index ec1fbc6934ca..6ddbadb3b0cf 100644 --- a/UWP/UWP.vcxproj +++ b/UWP/UWP.vcxproj @@ -599,6 +599,20 @@ true + + true + true + true + true + true + true + true + true + true + true + true + true + true @@ -1758,4 +1772,4 @@ - + \ No newline at end of file diff --git a/UWP/UWP.vcxproj.filters b/UWP/UWP.vcxproj.filters index c45f4a05c388..4fcd4bd2ee35 100644 --- a/UWP/UWP.vcxproj.filters +++ b/UWP/UWP.vcxproj.filters @@ -50,6 +50,9 @@ {d2294c79-82bd-470f-b984-f838f0fbcd25} + + {da2113a6-e616-4fc9-8be3-ff75b963664b} + @@ -359,6 +362,9 @@ Content + + Content\themes +