summaryrefslogtreecommitdiff
path: root/src/port/Engine.cpp
diff options
context:
space:
mode:
authorMegaMech <inkstudios1@hotmail.com>2025-02-22 20:26:23 -0700
committerLywx <kiritodev01@gmail.com>2025-03-07 17:35:16 -0600
commit1f2000846ac93cb1191189a921653d739ff32eea (patch)
tree90ef05ae01b4e94dae936dab4233e5b5ab36b4de /src/port/Engine.cpp
parent85471fb7e1bff84529faf51187391fe049c5456a (diff)
Update lus
Diffstat (limited to 'src/port/Engine.cpp')
-rw-r--r--src/port/Engine.cpp18
1 files changed, 14 insertions, 4 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 <utility>
extern "C" {
+bool prevAltAssets = false;
float gInterpolationStep = 0.0f;
#include <macros.h>
#include <DisplayListFactory.h>
@@ -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<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow());
+
+ if (wnd == nullptr) {
+ return;
+ }
+
+ wnd->HandleEvents();
+
+ wnd->DrawAndRunGraphicsCommands(Commands, {});
- if (ShouldClearTextureCacheAtEndOfFrame) {
+ bool curAltAssets = CVarGetInteger("gEnhancements.Mods.AlternateAssets", 0);
+ if (prevAltAssets != curAltAssets) {
+ prevAltAssets = curAltAssets;
+ Ship::Context::GetInstance()->GetResourceManager()->SetAltAssetsEnabled(curAltAssets);
gfx_texture_cache_clear();
- ShouldClearTextureCacheAtEndOfFrame = false;
}
}