Some Tweaks

This commit is contained in:
TheBrokenRail 2024-09-21 00:23:30 -04:00
parent c0156336df
commit 9bb6b86c73
3 changed files with 16 additions and 2 deletions

View File

@ -19,3 +19,9 @@ function(mcpi_option name description type default)
list(APPEND MCPI_OPTIONS "-D${full_name}:${type}=${${full_name}}") list(APPEND MCPI_OPTIONS "-D${full_name}:${type}=${${full_name}}")
set(MCPI_OPTIONS "${MCPI_OPTIONS}" PARENT_SCOPE) set(MCPI_OPTIONS "${MCPI_OPTIONS}" PARENT_SCOPE)
endfunction() endfunction()
# Clear External CFLAGS When Building ARM Components
if(BUILD_ARM_COMPONENTS)
unset(ENV{CFLAGS})
unset(ENV{CXXFLAGS})
endif()

View File

@ -84,6 +84,7 @@ void bootstrap(const options_t &options) {
} }
// Resolve Binary Path & Set MCPI_DIRECTORY // Resolve Binary Path & Set MCPI_DIRECTORY
std::string original_game_binary;
std::string game_binary; std::string game_binary;
{ {
// Log // Log
@ -91,7 +92,13 @@ void bootstrap(const options_t &options) {
// Resolve Full Binary Path // Resolve Full Binary Path
const std::string full_path = binary_directory + ("/" MCPI_BINARY); 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 // Fix MCPI Dependencies
@ -119,7 +126,7 @@ void bootstrap(const options_t &options) {
// Set MCPI_VANILLA_ASSETS_PATH // Set MCPI_VANILLA_ASSETS_PATH
{ {
std::string assets_path = game_binary; std::string assets_path = original_game_binary;
chop_last_component(assets_path); chop_last_component(assets_path);
assets_path += "/data"; assets_path += "/data";
set_and_print_env(_MCPI_VANILLA_ASSETS_PATH_ENV, assets_path.c_str()); set_and_print_env(_MCPI_VANILLA_ASSETS_PATH_ENV, assets_path.c_str());

View File

@ -20,6 +20,7 @@ ENV(MCPI_SKIN_SERVER, "Custom Skin Server")
ENV(MCPI_API_PORT, "Custom API Port") ENV(MCPI_API_PORT, "Custom API Port")
ENV(MCPI_BLOCK_OUTLINE_WIDTH, "Custom Width For Block Outline (In Pixels)") ENV(MCPI_BLOCK_OUTLINE_WIDTH, "Custom Width For Block Outline (In Pixels)")
ENV(MCPI_GUI_SCALE, "Custom GUI Scale") ENV(MCPI_GUI_SCALE, "Custom GUI Scale")
ENV(MCPI_BINARY, "Custom Game Binary")
// $HOME // $HOME
ENV(_MCPI_HOME, "") ENV(_MCPI_HOME, "")
ENV(MCPI_PROFILE_DIRECTORY, "Custom Profile Directory") ENV(MCPI_PROFILE_DIRECTORY, "Custom Profile Directory")