From 9bb6b86c739b886b7e97f4e51a84c5aa74f68bb8 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 21 Sep 2024 00:23:30 -0400 Subject: [PATCH] Some Tweaks --- cmake/options/core-options.cmake | 6 ++++++ launcher/src/bootstrap.cpp | 11 +++++++++-- libreborn/include/libreborn/env-list.h | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cmake/options/core-options.cmake b/cmake/options/core-options.cmake index 362e6139..70531456 100644 --- a/cmake/options/core-options.cmake +++ b/cmake/options/core-options.cmake @@ -19,3 +19,9 @@ function(mcpi_option name description type default) list(APPEND MCPI_OPTIONS "-D${full_name}:${type}=${${full_name}}") set(MCPI_OPTIONS "${MCPI_OPTIONS}" PARENT_SCOPE) endfunction() + +# Clear External CFLAGS When Building ARM Components +if(BUILD_ARM_COMPONENTS) + unset(ENV{CFLAGS}) + unset(ENV{CXXFLAGS}) +endif() \ No newline at end of file diff --git a/launcher/src/bootstrap.cpp b/launcher/src/bootstrap.cpp index 1a7850e4..53e7e197 100644 --- a/launcher/src/bootstrap.cpp +++ b/launcher/src/bootstrap.cpp @@ -84,6 +84,7 @@ void bootstrap(const options_t &options) { } // Resolve Binary Path & Set MCPI_DIRECTORY + std::string original_game_binary; std::string game_binary; { // Log @@ -91,7 +92,13 @@ void bootstrap(const options_t &options) { // Resolve Full Binary Path const std::string full_path = binary_directory + ("/" MCPI_BINARY); - game_binary = safe_realpath(full_path); + original_game_binary = safe_realpath(full_path); + const char *custom_binary = getenv(MCPI_BINARY_ENV); + if (custom_binary != nullptr) { + game_binary = safe_realpath(custom_binary); + } else { + game_binary = original_game_binary; + } } // Fix MCPI Dependencies @@ -119,7 +126,7 @@ void bootstrap(const options_t &options) { // Set MCPI_VANILLA_ASSETS_PATH { - std::string assets_path = game_binary; + std::string assets_path = original_game_binary; chop_last_component(assets_path); assets_path += "/data"; set_and_print_env(_MCPI_VANILLA_ASSETS_PATH_ENV, assets_path.c_str()); diff --git a/libreborn/include/libreborn/env-list.h b/libreborn/include/libreborn/env-list.h index 8b9f59f6..cd7e4baf 100644 --- a/libreborn/include/libreborn/env-list.h +++ b/libreborn/include/libreborn/env-list.h @@ -20,6 +20,7 @@ ENV(MCPI_SKIN_SERVER, "Custom Skin Server") ENV(MCPI_API_PORT, "Custom API Port") ENV(MCPI_BLOCK_OUTLINE_WIDTH, "Custom Width For Block Outline (In Pixels)") ENV(MCPI_GUI_SCALE, "Custom GUI Scale") +ENV(MCPI_BINARY, "Custom Game Binary") // $HOME ENV(_MCPI_HOME, "") ENV(MCPI_PROFILE_DIRECTORY, "Custom Profile Directory") \ No newline at end of file