diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_glx.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_glx.cpp index d450558b2..957f1c7c8 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_glx.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_glx.cpp @@ -156,6 +156,7 @@ static struct { Atom atom_wm_delete_window; bool is_fullscreen; + bool is_running = true; void (*on_fullscreen_changed)(bool is_now_fullscreen); int keymap[256]; @@ -399,7 +400,7 @@ static void gfx_glx_set_keyboard_callbacks(bool (*on_key_down)(int scancode), bo } static void gfx_glx_main_loop(void (*run_one_game_iter)(void)) { - while (1) { + while (glx.is_running) { run_one_game_iter(); } } @@ -440,7 +441,7 @@ static void gfx_glx_handle_events(void) { } } if (xev.type == ClientMessage && (Atom)xev.xclient.data.l[0] == glx.atom_wm_delete_window) { - exit(0); + glx.is_running = false; } } } diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp index 3e62a142f..465af1112 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp @@ -33,8 +33,8 @@ #else #include #include -#define GL_GLEXT_PROTOTYPES 1 -#include +// #define GL_GLEXT_PROTOTYPES 1 +// #include #endif #include "gfx_cc.h" diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp index 6e6733029..f07c693ad 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp @@ -255,8 +255,9 @@ static void gfx_sdl_onkeyup(int scancode) { } static void gfx_sdl_handle_events(void) { - +#ifdef __SWITCH__ Ship::Switch::Update(); +#endif SDL_Event event; while (SDL_PollEvent(&event)) { SohImGui::EventImpl event_impl; diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 41b9d0a2b..c2d89b9d6 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -61,7 +61,9 @@ extern "C" int AudioPlayer_GetDesiredBuffered(void); // C->C++ Bridge extern "C" void InitOTR() { +#ifdef __SWITCH__ Ship::Switch::Init(); +#endif OTRGlobals::Instance = new OTRGlobals(); auto t = OTRGlobals::Instance->context->GetResourceManager()->LoadFile("version");