From b530d4a58b7b2d245626c2e5b6416b883ea91126 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 13 Sep 2025 11:46:17 -0400 Subject: [PATCH] Refactor window creation and enhance file dialog functionality - Removed unnecessary ImGui frame initialization calls in CreateWindow function to streamline window setup. - Updated FileDialogWrapper to restrict file types in the open file dialog, allowing only specific extensions (sfc, smc, yaze) for improved user experience. --- src/app/core/platform/file_dialog.mm | 1 + src/app/core/window.cc | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/core/platform/file_dialog.mm b/src/app/core/platform/file_dialog.mm index ea64973e..793662a3 100644 --- a/src/app/core/platform/file_dialog.mm +++ b/src/app/core/platform/file_dialog.mm @@ -71,6 +71,7 @@ std::string yaze::core::FileDialogWrapper::ShowOpenFileDialog() { [openPanel setCanChooseFiles:YES]; [openPanel setCanChooseDirectories:NO]; [openPanel setAllowsMultipleSelection:NO]; + [openPanel setAllowedFileTypes:@[ @"sfc", @"smc", @"yaze" ]]; if ([openPanel runModal] == NSModalResponseOK) { NSURL* url = [[openPanel URLs] objectAtIndex:0]; diff --git a/src/app/core/window.cc b/src/app/core/window.cc index d41d29db..45cd6182 100644 --- a/src/app/core/window.cc +++ b/src/app/core/window.cc @@ -49,9 +49,6 @@ absl::Status CreateWindow(Window& window, int flags) { gui::ColorsYaze(); - ImGui_ImplSDLRenderer2_NewFrame(); - ImGui_ImplSDL2_NewFrame(); - const int audio_frequency = 48000; SDL_AudioSpec want, have; SDL_memset(&want, 0, sizeof(want));