From 89f11af32d137883d7e0acc5e38ebf32f6ec35c7 Mon Sep 17 00:00:00 2001 From: MegaMech <7255464+MegaMech@users.noreply.github.com> Date: Wed, 23 Apr 2025 13:32:30 -0600 Subject: [PATCH] Engine.cpp more consistent with sf64 --- src/port/Engine.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index df2011647..bd3fd8575 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -272,26 +272,26 @@ void GameEngine::StartFrame() const { void GameEngine::RunCommands(Gfx* Commands) { auto wnd = std::dynamic_pointer_cast(Ship::Context::GetInstance()->GetWindow()); - if (ShouldClearTextureCacheAtEndOfFrame) { - gfx_texture_cache_clear(); - ShouldClearTextureCacheAtEndOfFrame = false; - } - if (nullptr == wnd) { return; } wnd->HandleEvents(); wnd->DrawAndRunGraphicsCommands(Commands, {}); + + if (ShouldClearTextureCacheAtEndOfFrame) { + gfx_texture_cache_clear(); + ShouldClearTextureCacheAtEndOfFrame = false; + } } void GameEngine::ProcessGfxCommands(Gfx* commands) { - RunCommands(commands); auto wnd = std::dynamic_pointer_cast(Ship::Context::GetInstance()->GetWindow()); if (wnd != nullptr) { wnd->SetTargetFps(CVarGetInteger("gInterpolationFPS", 30)); wnd->SetMaximumFrameLatency(1); } + RunCommands(commands); } // Audio