summaryrefslogtreecommitdiff
path: root/src/port/Engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/port/Engine.cpp')
-rw-r--r--src/port/Engine.cpp16
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