From 25ff2ca2e54574adab70d9581b74954f4828c8c0 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:02:00 +0300 Subject: [PATCH] Create host device after loading the module if the installer wasn't run. --- UnleashedRecomp/gpu/imgui_snapshot.cpp | 15 ++++++--------- UnleashedRecomp/gpu/imgui_snapshot.h | 2 +- UnleashedRecomp/main.cpp | 10 +++++++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/UnleashedRecomp/gpu/imgui_snapshot.cpp b/UnleashedRecomp/gpu/imgui_snapshot.cpp index 85a5304a..6d12a21e 100644 --- a/UnleashedRecomp/gpu/imgui_snapshot.cpp +++ b/UnleashedRecomp/gpu/imgui_snapshot.cpp @@ -222,17 +222,14 @@ void ImFontAtlasSnapshot::GenerateGlyphRanges() } } - if (App::s_isInit) + for (size_t i = XDBF_LANGUAGE_ENGLISH; i <= XDBF_LANGUAGE_ITALIAN; i++) { - for (size_t i = XDBF_LANGUAGE_ENGLISH; i <= XDBF_LANGUAGE_ITALIAN; i++) + auto achievements = g_xdbfWrapper.GetAchievements(static_cast(i)); + for (auto& achievement : achievements) { - auto achievements = g_xdbfWrapper.GetAchievements(static_cast(i)); - for (auto& achievement : achievements) - { - GetGlyphs(glyphs, achievement.Name); - GetGlyphs(glyphs, achievement.UnlockedDesc); - GetGlyphs(glyphs, achievement.LockedDesc); - } + GetGlyphs(glyphs, achievement.Name); + GetGlyphs(glyphs, achievement.UnlockedDesc); + GetGlyphs(glyphs, achievement.LockedDesc); } } diff --git a/UnleashedRecomp/gpu/imgui_snapshot.h b/UnleashedRecomp/gpu/imgui_snapshot.h index 70b539b2..cda49add 100644 --- a/UnleashedRecomp/gpu/imgui_snapshot.h +++ b/UnleashedRecomp/gpu/imgui_snapshot.h @@ -34,7 +34,7 @@ struct ImDrawDataSnapshot // Undefine this to generate a font atlas file in working directory. // You also need to do this if you are testing localization, as only // characters in the locale get added to the atlas. -//#define ENABLE_IM_FONT_ATLAS_SNAPSHOT +#define ENABLE_IM_FONT_ATLAS_SNAPSHOT struct ImFontAtlasSnapshot { diff --git a/UnleashedRecomp/main.cpp b/UnleashedRecomp/main.cpp index 42b394f7..b7cad94d 100644 --- a/UnleashedRecomp/main.cpp +++ b/UnleashedRecomp/main.cpp @@ -156,11 +156,12 @@ int main(int argc, char *argv[]) HostStartup(); - Video::CreateHostDevice(); - bool isGameInstalled = Installer::checkGameInstall("."); - if (forceInstaller || forceDLCInstaller || !isGameInstalled) + bool runInstallerWizard = forceInstaller || forceDLCInstaller || !isGameInstalled; + if (runInstallerWizard) { + Video::CreateHostDevice(); + if (!InstallerWizard::Run(isGameInstalled && forceDLCInstaller)) { return 1; @@ -173,6 +174,9 @@ int main(int argc, char *argv[]) uint32_t entry = LdrLoadModule(FileSystem::TransformPath(GAME_XEX_PATH)); + if (!runInstallerWizard) + Video::CreateHostDevice(); + Video::StartPipelinePrecompilation(); GuestThread::Start(entry);