GUI: delayed layout loading

issue #1629
This commit is contained in:
tildearrow 2024-01-26 02:44:47 -05:00
parent ba8cd2f672
commit c55cc8b2ea
3 changed files with 21 additions and 5 deletions

View file

@ -4001,12 +4001,24 @@ bool FurnaceGUI::loop() {
layoutTimeBegin=SDL_GetPerformanceCounter();
if (pendingLayoutImport!=NULL) {
ImGui::LoadIniSettingsFromMemory((const char*)pendingLayoutImport,pendingLayoutImportLen);
}
if (!rend->newFrame()) {
fontsFailed=true;
}
ImGui_ImplSDL2_NewFrame(sdlWin);
ImGui::NewFrame();
if (pendingLayoutImport!=NULL) {
WAKE_UP;
ImGui::Render();
delete[] pendingLayoutImport;
pendingLayoutImport=NULL;
continue;
}
// one second counter
secondTimer+=ImGui::GetIO().DeltaTime;
if (secondTimer>=1.0f) secondTimer=fmod(secondTimer,1.0f);
@ -7263,6 +7275,8 @@ FurnaceGUI::FurnaceGUI():
headFont(NULL),
fontRange(NULL),
prevInsData(NULL),
pendingLayoutImport(NULL),
pendingLayoutImportLen(0),
curIns(0),
curWave(0),
curSample(0),