From 1f2000846ac93cb1191189a921653d739ff32eea Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sat, 22 Feb 2025 20:26:23 -0700 Subject: [PATCH] Update lus --- src/port/Engine.cpp | 18 ++++++++++++++---- src/port/ui/UIWidgets.cpp | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index 175f251e7..d7cd19c1d 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -30,6 +30,7 @@ #include extern "C" { +bool prevAltAssets = false; float gInterpolationStep = 0.0f; #include #include @@ -263,12 +264,21 @@ void GameEngine::StartFrame() const { // } void GameEngine::RunCommands(Gfx* Commands) { - gfx_run(Commands, {}); - gfx_end_frame(); + auto wnd = std::dynamic_pointer_cast(Ship::Context::GetInstance()->GetWindow()); - if (ShouldClearTextureCacheAtEndOfFrame) { + if (wnd == nullptr) { + return; + } + + wnd->HandleEvents(); + + wnd->DrawAndRunGraphicsCommands(Commands, {}); + + bool curAltAssets = CVarGetInteger("gEnhancements.Mods.AlternateAssets", 0); + if (prevAltAssets != curAltAssets) { + prevAltAssets = curAltAssets; + Ship::Context::GetInstance()->GetResourceManager()->SetAltAssetsEnabled(curAltAssets); gfx_texture_cache_clear(); - ShouldClearTextureCacheAtEndOfFrame = false; } } diff --git a/src/port/ui/UIWidgets.cpp b/src/port/ui/UIWidgets.cpp index 1368cf420..2495aef4e 100644 --- a/src/port/ui/UIWidgets.cpp +++ b/src/port/ui/UIWidgets.cpp @@ -263,7 +263,7 @@ bool Checkbox(const char* _label, bool* value, const CheckboxOptions& options) { : ImGuiCol_FrameBg), true, style.FrameRounding); ImU32 check_col = ImGui::GetColorU32(ImGuiCol_CheckMark); - bool mixed_value = (g.LastItemData.InFlags & ImGuiItemFlags_MixedValue) != 0; + bool mixed_value = (g.LastItemData.ItemFlags & ImGuiItemFlags_MixedValue) != 0; if (mixed_value) { // Undocumented tristate/mixed/indeterminate checkbox (#2644) // This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all