From a7e8e8cfce90e48ba33cb6fa97c00a85b8356563 Mon Sep 17 00:00:00 2001 From: Christopher Homberger Date: Thu, 7 Nov 2019 21:11:47 +0100 Subject: [PATCH] Add angle support (MacOs) --- CMakeLists.txt | 3 +++ src/main.cpp | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf631f8..eb571fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,9 @@ configure_file(src/build_info.h.in ${CMAKE_CURRENT_BINARY_DIR}/build_info/build_ add_executable(mcpelauncher-client src/main.cpp src/client_app_platform.cpp src/client_app_platform.h src/store.cpp src/store.h src/xbox_live_patches.cpp src/xbox_live_patches.h src/fake_jni.cpp src/fake_jni.h src/window_callbacks.cpp src/window_callbacks.h src/http_request_stub.cpp src/http_request_stub.h src/xbox_live_helper.cpp src/xbox_live_helper.h src/minecraft_gamepad_mapping.h src/splitscreen_patch.cpp src/splitscreen_patch.h src/cll_upload_auth_step.cpp src/cll_upload_auth_step.h src/gl_core_patch.cpp src/gl_core_patch.h src/tts_patch.cpp src/tts_patch.h src/hbui_patch.cpp src/hbui_patch.h src/utf8_util.h src/shader_error_patch.cpp src/shader_error_patch.h src/xbox_live_game_interface.cpp src/xbox_live_game_interface.h src/legacy/xbox_live_game_interface_legacy_1_2_3.cpp src/legacy/xbox_live_game_interface_legacy_1_2_3.h src/legacy/xbox_live_game_interface_legacy_1_4.cpp src/legacy/xbox_live_game_interface_legacy_1_4.h src/legacy/xbox_live_game_interface_legacy_1_2.cpp src/legacy/xbox_live_game_interface_legacy_1_2.h src/legacy/legacy_patches.cpp src/legacy/legacy_patches.h src/minecraft_game_wrapper.cpp src/minecraft_game_wrapper.h src/legacy/minecraft_game_wrapper_legacy.h src/legacy/xbox_live_game_interface_legacy_0_15_2.cpp src/legacy/xbox_live_game_interface_legacy_0_15_2.h) target_link_libraries(mcpelauncher-client logger mcpelauncher-core gamewindow filepicker msa-daemon-client cll-telemetry argparser) target_include_directories(mcpelauncher-client PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/build_info/) +if (APPLE) + set_target_properties(mcpelauncher-client PROPERTIES MACOSX_RPATH TRUE INSTALL_RPATH @executable_path/../Frameworks) +endif() if (IS_ARMHF_BUILD) target_sources(mcpelauncher-client PRIVATE src/armhf_support.cpp src/armhf_support.h) diff --git a/src/main.cpp b/src/main.cpp index ba6a2bd..5d00063 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -55,6 +55,9 @@ int main(int argc, char *argv[]) { argparser::arg pixelScale (p, "--scale", "-s", "Pixel Scale", 2.f); argparser::arg mallocZero (p, "--malloc-zero", "-mz", "Patch malloc to always zero initialize memory, this may help workaround MCPE bugs"); argparser::arg disableFmod (p, "--disable-fmod", "-df", "Disables usage of the FMod audio library"); +#ifdef __APPLE__ + argparser::arg forceAngle (p, "--force-angle", "-fa", "Forces the usage of the angle graphics library"); +#endif if (!p.parse(argc, (const char**) argv)) return 1; if (printVersion) { @@ -80,7 +83,7 @@ int main(int argc, char *argv[]) { } #endif - GraphicsApi graphicsApi = GLCorePatch::mustUseDesktopGL() ? GraphicsApi::OPENGL : GraphicsApi::OPENGL_ES2; + GraphicsApi graphicsApi = GraphicsApi::OPENGL_ES2; Log::trace("Launcher", "Loading hybris libraries"); if (!disableFmod) @@ -102,6 +105,13 @@ int main(int argc, char *argv[]) { Log::trace("Launcher", "Initializing vtables"); MinecraftUtils::initSymbolBindings(handle); + +#ifdef __APPLE__ + if (!forceAngle && !MinecraftVersion::isAtLeast(1, 13, 9)) { + graphicsApi = GraphicsApi::OPENGL; + } +#endif + ClientAppPlatform::initVtable(handle); LauncherStore::initVtable(handle);