From 17a5ab9fce767d1f84e4aa21c6caa577512d3a60 Mon Sep 17 00:00:00 2001 From: dcvz Date: Fri, 31 May 2024 00:09:47 +0200 Subject: [PATCH] Remove unused directory imports --- librecomp/src/recomp.cpp | 6 ------ ultramodern/include/ultramodern/ultramodern.hpp | 6 ++++++ ultramodern/src/events.cpp | 6 ++++++ ultramodern/src/rt64_layer.cpp | 3 +++ ultramodern/src/threads.cpp | 6 ++++++ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/librecomp/src/recomp.cpp b/librecomp/src/recomp.cpp index 17e6303..41ab597 100644 --- a/librecomp/src/recomp.cpp +++ b/librecomp/src/recomp.cpp @@ -11,12 +11,6 @@ #include #include -#ifdef _WIN32 -#include -#elif defined(__linux__) -#include -#endif - #include "recomp.h" #include "recomp_overlays.h" #include "recomp_game.h" diff --git a/ultramodern/include/ultramodern/ultramodern.hpp b/ultramodern/include/ultramodern/ultramodern.hpp index 1c6b8ed..547fba1 100644 --- a/ultramodern/include/ultramodern/ultramodern.hpp +++ b/ultramodern/include/ultramodern/ultramodern.hpp @@ -52,6 +52,12 @@ namespace ultramodern { Window window; auto operator<=>(const WindowHandle&) const = default; }; +#elif defined(__APPLE__) + struct WindowHandle { + void* window; + void* view; + auto operator<=>(const WindowHandle&) const = default; + }; #endif // We need a place in rdram to hold the PI handles, so pick an address in extended rdram diff --git a/ultramodern/src/events.cpp b/ultramodern/src/events.cpp index be1f3bd..7fba7b6 100644 --- a/ultramodern/src/events.cpp +++ b/ultramodern/src/events.cpp @@ -217,7 +217,11 @@ void task_thread_func(uint8_t* rdram, moodycamel::LightweightSemaphore* thread_r if (!ultramodern::rsp::run_task(PASS_RDRAM task)) { fprintf(stderr, "Failed to execute task type: %" PRIu32 "\n", task->t.type); assert(false); +# ifdef __APPLE__ + std::_Exit(EXIT_FAILURE); +# else std::quick_exit(EXIT_FAILURE); +# endif } // Tell the game that the RSP has completed @@ -508,6 +512,8 @@ std::string get_graphics_api_name(ultramodern::GraphicsApi api) { api = ultramodern::GraphicsApi::D3D12; #elif defined(__gnu_linux__) api = ultramodern::GraphicsApi::Vulkan; +#elif defined(__APPLE__) + api = ultramodern::GraphicsApi::Vulkan; #else static_assert(false && "Unimplemented") #endif diff --git a/ultramodern/src/rt64_layer.cpp b/ultramodern/src/rt64_layer.cpp index e82a07f..45290b1 100644 --- a/ultramodern/src/rt64_layer.cpp +++ b/ultramodern/src/rt64_layer.cpp @@ -129,6 +129,9 @@ ultramodern::RT64Context::RT64Context(uint8_t* rdram, ultramodern::WindowHandle #elif defined(__linux__) appCore.window.display = window_handle.display; appCore.window.window = window_handle.window; +#elif defined(__APPLE__) + appCore.window.window = window_handle.window; + appCore.window.view = window_handle.view; #endif appCore.checkInterrupts = dummy_check_interrupts; diff --git a/ultramodern/src/threads.cpp b/ultramodern/src/threads.cpp index 9b17a52..fd59338 100644 --- a/ultramodern/src/threads.cpp +++ b/ultramodern/src/threads.cpp @@ -111,6 +111,12 @@ void ultramodern::set_native_thread_priority(ThreadPriority pri) { // break; // } } +#elif defined(__APPLE__) +void ultramodern::set_native_thread_name(const std::string& name) { + pthread_setname_np(name.c_str()); +} + +void ultramodern::set_native_thread_priority(ThreadPriority pri) {} #endif std::atomic_int temporary_threads = 0;