Small Changes

This commit is contained in:
TheBrokenRail 2024-02-11 20:35:41 -05:00
parent 71cc24104c
commit 180ba9dcaf
5 changed files with 30 additions and 3 deletions

View File

@ -44,7 +44,8 @@ include(cmake/options/paths.cmake)
string(CONCAT COMPILE_FLAGS_SETUP string(CONCAT COMPILE_FLAGS_SETUP
# Optimizations # Optimizations
"if(CMAKE_BUILD_TYPE STREQUAL \"Release\")\n" "if(CMAKE_BUILD_TYPE STREQUAL \"Release\")\n"
" add_compile_options(-O3 -s)\n" " add_compile_options(-O3)\n"
" add_link_options(-s)\n"
"else()\n" "else()\n"
" add_compile_options(-g)\n" " add_compile_options(-g)\n"
"endif()\n" "endif()\n"
@ -159,6 +160,7 @@ if(BUILD_NATIVE_COMPONENTS)
else() else()
list(APPEND ARM_OPTIONS "-DMCPI_USE_PREBUILT_ARMHF_TOOLCHAIN:BOOL=TRUE") list(APPEND ARM_OPTIONS "-DMCPI_USE_PREBUILT_ARMHF_TOOLCHAIN:BOOL=TRUE")
endif() endif()
list(APPEND ARM_OPTIONS "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}")
# Build # Build
ExternalProject_Add(arm-components ExternalProject_Add(arm-components
DOWNLOAD_COMMAND "" DOWNLOAD_COMMAND ""

View File

@ -11,12 +11,16 @@
* Add `Use Java Beta 1.3 Light Ramp` Feature Flag (Enabled By Default) * Add `Use Java Beta 1.3 Light Ramp` Feature Flag (Enabled By Default)
* Add `Send Full Level When Hosting Game` Feature Flag (Enabled By Default) * Add `Send Full Level When Hosting Game` Feature Flag (Enabled By Default)
* Add `Food Overlay` Feature Flag (Disabled By Default) * Add `Food Overlay` Feature Flag (Disabled By Default)
* Add `Display Date In Select World Screen` Feature Flag (Enabled By Default)
* Add `Optimized Chunk Sorting` Feature Flag (Enabled By Default)
* Add `Add Cake` Feature Flag (Enabled By Default)
* Add Milk Buckets * Add Milk Buckets
* Implement Crafting Remainders * Implement Crafting Remainders
* Improve Death Messages * Improve Death Messages
* Massive Build System Improvements * Massive Build System Improvements
* Fix Item Dropping When Killing Players From The Server Console * Fix Item Dropping When Killing Players From The Server Console
* Fix Furnace Visual Bug When Using Lava Bucket As Fuel * Fix Furnace Visual Bug When Using Lava Bucket As Fuel
* Add Splash Text To Start Screen
**2.5.3** **2.5.3**
* Add `Replace Block Highlight With Outline` Feature Flag (Enabled By Default) * Add `Replace Block Highlight With Outline` Feature Flag (Enabled By Default)

View File

@ -58,3 +58,5 @@ TRUE Use Java Beta 1.3 Light Ramp
TRUE Send Full Level When Hosting Game TRUE Send Full Level When Hosting Game
FALSE Food Overlay FALSE Food Overlay
TRUE Add Splashes TRUE Add Splashes
TRUE Display Date In Select World Screen
TRUE Optimized Chunk Sorting

View File

@ -123,6 +123,17 @@ static void sort_chunks(Chunk **chunks_begin, Chunk **chunks_end, DistanceChunkS
} }
} }
// Display Date In Select World Screen
static std::string AppPlatform_linux_getDateString_injection(__attribute__((unused)) AppPlatform_linux *app_platform, int time) {
// From https://github.com/ReMinecraftPE/mcpe/blob/56e51027b1c2e67fe5a0e8a091cefe51d4d11926/platforms/sdl/base/AppPlatform_sdl_base.cpp#L68-L84
time_t tt = time;
struct tm t;
gmtime_r(&tt, &t);
char buf[2048];
strftime(buf, sizeof buf, "%b %d %Y %H:%M:%S", &t);
return std::string(buf);
}
// Init // Init
void _init_misc_cpp() { void _init_misc_cpp() {
// Implement AppPlatform::readAssetFile So Translations Work // Implement AppPlatform::readAssetFile So Translations Work
@ -136,10 +147,17 @@ void _init_misc_cpp() {
patch_address(PauseScreen_init_vtable_addr, (void *) PauseScreen_init_injection); patch_address(PauseScreen_init_vtable_addr, (void *) PauseScreen_init_injection);
} }
// Implement crafting remainders // Implement Crafting Remainders
overwrite_call((void *) 0x2e230, (void *) PaneCraftingScreen_craftSelectedItem_PaneCraftingScreen_recheckRecipes_injection); overwrite_call((void *) 0x2e230, (void *) PaneCraftingScreen_craftSelectedItem_PaneCraftingScreen_recheckRecipes_injection);
overwrite((void *) Item_getCraftingRemainingItem_non_virtual, (void *) Item_getCraftingRemainingItem_injection); overwrite((void *) Item_getCraftingRemainingItem_non_virtual, (void *) Item_getCraftingRemainingItem_injection);
// Replace 2011 std::sort With Optimized(TM) Code // Replace 2011 std::sort With Optimized(TM) Code
if (feature_has("Optimized Chunk Sorting", server_enabled)) {
overwrite((void *) 0x51fac, (void *) sort_chunks); overwrite((void *) 0x51fac, (void *) sort_chunks);
} }
// Display Date In Select World Screen
if (feature_has("Display Date In Select World Screen", server_disabled)) {
patch_address(AppPlatform_linux_getDateString_vtable_addr, (void *) AppPlatform_linux_getDateString_injection);
}
}

View File

@ -3,3 +3,4 @@ vtable 0x1020d8;
virtual-method void saveScreenshot(std::string *path, int width, int height) = 0x8; virtual-method void saveScreenshot(std::string *path, int width, int height) = 0x8;
virtual-method AppPlatform_readAssetFile_return_value readAssetFile(std::string *path) = 0x34; virtual-method AppPlatform_readAssetFile_return_value readAssetFile(std::string *path) = 0x34;
virtual-method Texture loadTexture(std::string *path, bool b) = 0xc; virtual-method Texture loadTexture(std::string *path, bool b) = 0xc;
virtual-method std::string getDateString(int time) = 0x24;