diff options
| author | Sonic Dreamcaster <alejandro.asenjo88@gmail.com> | 2025-05-16 00:24:15 -0300 |
|---|---|---|
| committer | Sonic Dreamcaster <alejandro.asenjo88@gmail.com> | 2025-05-16 00:24:15 -0300 |
| commit | eaeff4e0e083e8974d0279cab52dd8d09a70f558 (patch) | |
| tree | bdde7057cfbe9cf7bdeb79ee40109171c4e41468 /src/port/Engine.cpp | |
| parent | bb55545f20151a4b05a7243cd2d568822175995d (diff) | |
progress
Diffstat (limited to 'src/port/Engine.cpp')
| -rw-r--r-- | src/port/Engine.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index 669e24504..debfad703 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -324,16 +324,24 @@ void GameEngine::StartFrame() const { // Instance->context->GetWindow()->MainLoop(run_one_game_iter); // } -void GameEngine::RunCommands(Gfx* Commands) { +void GameEngine::RunCommands(Gfx* Commands, const std::vector<std::unordered_map<Mtx*, MtxF>>& mtx_replacements) { auto wnd = std::dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow()); - if (nullptr == wnd) { + if (wnd == nullptr) { return; } + auto interpreter = wnd->GetInterpreterWeak().lock().get(); + + // Process window events for resize, mouse, keyboard events wnd->HandleEvents(); - wnd->DrawAndRunGraphicsCommands(Commands, {}); + interpreter->mInterpolationIndex = 0; + + for (const auto& m : mtx_replacements) { + wnd->DrawAndRunGraphicsCommands(Commands, m); + interpreter->mInterpolationIndex++; + } bool curAltAssets = CVarGetInteger("gEnhancements.Mods.AlternateAssets", 0); if (prevAltAssets != curAltAssets) { @@ -379,7 +387,7 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) { wnd->SetTargetFps(CVarGetInteger("gInterpolationFPS", 30)); wnd->SetMaximumFrameLatency(1); } - RunCommands(commands); + RunCommands(commands, mtx_replacements); } // Audio |
