Skip to content

Commit

Permalink
move dropped frame handling to port side
Browse files Browse the repository at this point in the history
  • Loading branch information
Archez committed Jan 9, 2025
1 parent cb4f0cf commit da0ccef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions soh/soh/OTRGlobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,20 +1360,31 @@ extern "C" void Graph_StartFrame() {
CVarClear(CVAR_NEW_FILE_DROPPED);
CVarClear(CVAR_DROPPED_FILE);
}

// OTRGlobals::Instance->context->GetWindow()->StartFrame();
}

void RunCommands(Gfx* Commands, const std::vector<std::unordered_map<Mtx*, MtxF>>& mtx_replacements) {
auto wnd = OTRGlobals::Instance->context->GetWindow();
auto gui = wnd->GetGui();

// Process window events for resize, mouse, keyboard events
wnd->HandleEvents();

for (const auto& m : mtx_replacements) {
// Skip dropped frames
if (!wnd->IsFrameReady()) {
continue;
}

// Setup of the backend frames and draw initial Window and GUI menus
gui->StartDraw();
// Setup game framebuffers to match available window space
wnd->StartFrame();
// Execute the games gfx commands
gfx_run(Commands, m);
// Renders the game frame buffer to the final window and finishes the GUI
gui->EndDraw();
gfx_end_frame();
// Finialize swap buffers
wnd->EndFrame();
}
}

Expand Down

0 comments on commit da0ccef

Please sign in to comment.