Compare commits
2 Commits
51bbad15f4
...
f25a2adcef
Author | SHA1 | Date | |
---|---|---|---|
f25a2adcef | |||
6ae475785e |
|
@ -107,4 +107,3 @@ void init_atlas() {
|
|||
overwrite_call((void *) 0x1e21c, (void *) InventoryPane_renderBatch_Tesselator_color_injection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -171,4 +171,3 @@ void init_benchmark() {
|
|||
media_disable_vsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -372,4 +372,3 @@ void init_bucket() {
|
|||
misc_run_on_language_setup(Language_injection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -238,4 +238,3 @@ void init_cake() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,4 +46,3 @@ void init_camera() {
|
|||
overwrite_call((void *) 0x87dc4, (void *) TripodCamera_tick_Level_addParticle_call_injection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -99,4 +99,3 @@ void init_chat() {
|
|||
patch((void *) 0x6b4c0, message_limit_patch);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ static Screen *create_chat_screen() {
|
|||
void _init_chat_ui() {
|
||||
misc_run_on_game_key_press([](Minecraft *minecraft, int key) {
|
||||
if (key == 0x54) {
|
||||
if (Minecraft_isLevelGenerated(minecraft) && minecraft->screen == nullptr) {
|
||||
if (minecraft->isLevelGenerated() && minecraft->screen == nullptr) {
|
||||
minecraft->setScreen(create_chat_screen());
|
||||
}
|
||||
return true;
|
||||
|
@ -153,4 +153,3 @@ void _init_chat_ui() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -17,4 +17,3 @@ void _patch_bcm_host_calls() {
|
|||
overwrite_call((void *) 0x12618, (void *) do_nothing); // vc_dispmanx_element_add
|
||||
overwrite_call((void *) 0x12624, (void *) do_nothing); // vc_dispmanx_update_submit_sync
|
||||
}
|
||||
|
||||
|
|
|
@ -140,4 +140,3 @@ void compat_request_exit() {
|
|||
// Request
|
||||
exit_requested = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,4 +38,3 @@ void _patch_egl_calls() {
|
|||
patch((void *) 0x12504, nop_patch); // eglDestroySurface #2
|
||||
overwrite_call((void *) 0x12594, (void *) eglCreateContext_injection); // eglCreateContext
|
||||
}
|
||||
|
||||
|
|
|
@ -27,4 +27,3 @@ void _patch_x11_calls() {
|
|||
overwrite_call((void *) 0x132a4, (void *) XGetWindowAttributes_injection); // XGetWindowAttributes
|
||||
overwrite_call((void *) 0x132d4, (void *) XTranslateCoordinates_injection); // XTranslateCoordinates
|
||||
}
|
||||
|
||||
|
|
|
@ -173,4 +173,3 @@ void init_creative() {
|
|||
patch((void *) 0x8e104, maximize_stack_patch);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,4 +144,3 @@ void init_death() {
|
|||
unsigned char ldr_r0_24_patch[4] = {0x24, 0x00, 0x90, 0xe5}; // "ldr r0, [r0, #0x24]"
|
||||
patch((void *) 0x8799c, ldr_r0_24_patch);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,4 +27,3 @@ bool _feature_has(const char *name) {
|
|||
// Return
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,4 +52,3 @@ void init_fps() {
|
|||
misc_run_on_tick(print_fps);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,4 +76,3 @@ void init_game_mode() {
|
|||
patch((void *) 0x6dc70, server_patch);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ static void create_world(Minecraft *minecraft, std::string name, bool is_creativ
|
|||
if (folder.empty()) {
|
||||
folder = "World";
|
||||
}
|
||||
folder = getUniqueLevelName(Minecraft_getLevelSource(minecraft), folder);
|
||||
folder = getUniqueLevelName(minecraft->getLevelSource(), folder);
|
||||
|
||||
// Settings
|
||||
LevelSettings settings;
|
||||
|
|
|
@ -31,4 +31,3 @@ void init_home() {
|
|||
unsigned char nop_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
|
||||
patch((void *) 0xe0ac, nop_patch);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,4 +40,3 @@ __attribute__((constructor)) static void init() {
|
|||
init_benchmark();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -63,4 +63,3 @@ void _init_attack() {
|
|||
overwrite_call((void *) 0x8fc24, (void *) Player_attack_Inventory_getSelected_injection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,4 +31,3 @@ void _init_bow() {
|
|||
fix_bow = feature_has("Fix Bow & Arrow", server_disabled);
|
||||
input_run_on_tick(_handle_bow);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,4 +28,3 @@ static void _handle_open_crafting(Minecraft *minecraft) {
|
|||
void _init_crafting() {
|
||||
input_run_on_tick(_handle_open_crafting);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,4 +78,3 @@ void _init_drop() {
|
|||
enable_drop = feature_has("Bind \"Q\" Key To Item Dropping", server_disabled);
|
||||
input_run_on_tick(_handle_drop);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,4 +57,3 @@ void init_input() {
|
|||
media_set_raw_mouse_motion_enabled(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -115,4 +115,3 @@ void _init_misc() {
|
|||
input_run_on_tick(_handle_back);
|
||||
input_run_on_tick(_handle_mouse_grab);
|
||||
}
|
||||
|
||||
|
|
|
@ -97,4 +97,3 @@ void _init_toggle() {
|
|||
overwrite_calls(ParticleEngine_render, ParticleEngine_render_injection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -183,4 +183,3 @@ void _init_misc_api() {
|
|||
// Handle Key Presses
|
||||
overwrite_calls(Gui_handleKeyPressed, Gui_handleKeyPressed_injection);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ static const char *last_message = nullptr;
|
|||
static void print_progress(Minecraft *minecraft) {
|
||||
const char *message = minecraft->getProgressMessage();
|
||||
int32_t progress = minecraft->progress;
|
||||
if (Minecraft_isLevelGenerated(minecraft)) {
|
||||
if (minecraft->isLevelGenerated()) {
|
||||
message = "Ready";
|
||||
progress = -1;
|
||||
}
|
||||
|
@ -97,4 +97,3 @@ void _init_misc_logging() {
|
|||
// Disable stdout Buffering
|
||||
setvbuf(stdout, nullptr, _IONBF, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -997,4 +997,3 @@ void init_misc() {
|
|||
_init_misc_logging();
|
||||
_init_misc_api();
|
||||
}
|
||||
|
||||
|
|
|
@ -133,4 +133,3 @@ void init_multiplayer() {
|
|||
overwrite_virtual_calls(RakNetInstance_pingForHosts, RakNetInstance_pingForHosts_injection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -247,4 +247,3 @@ void init_options() {
|
|||
// UI
|
||||
_init_options_ui();
|
||||
}
|
||||
|
||||
|
|
|
@ -104,4 +104,3 @@ HOOK(fopen64, FILE *, (const char *filename, const char *mode)) {
|
|||
// Return File
|
||||
return file;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ dirent *readdir(DIR *dirp) {
|
|||
new_dirent.d_type = original->d_type;
|
||||
return &new_dirent;
|
||||
}
|
||||
|
||||
|
|
|
@ -104,4 +104,3 @@ void screenshot_take(char *home) {
|
|||
free(screenshots);
|
||||
free(pixels);
|
||||
}
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ __attribute__((destructor)) static void _free_stdin_buffer() {
|
|||
// Handle Commands
|
||||
static void handle_commands(Minecraft *minecraft) {
|
||||
// Check If Level Is Generated
|
||||
if (Minecraft_isLevelGenerated(minecraft) && stdin_buffer_complete) {
|
||||
if (minecraft->isLevelGenerated() && stdin_buffer_complete) {
|
||||
// Command Ready; Run It
|
||||
if (stdin_buffer != nullptr) {
|
||||
ServerSideNetworkHandler *server_side_network_handler = get_server_side_network_handler(minecraft);
|
||||
|
@ -594,4 +594,3 @@ void init_server() {
|
|||
set_and_print_env("MCPI_RENDER_DISTANCE", "Tiny");
|
||||
set_and_print_env("MCPI_USERNAME", get_motd().c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ bool ServerProperties::get_bool(std::string const& name, std::string const& def)
|
|||
}
|
||||
return is_true(def);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,4 +55,3 @@ void init_sign() {
|
|||
// Handle Backspace
|
||||
overwrite_calls(Common_sdl_key_to_minecraft_key, sdl_key_to_minecraft_key_injection);
|
||||
}
|
||||
|
||||
|
|
|
@ -142,4 +142,3 @@ void _init_skin_loader() {
|
|||
// Log
|
||||
DEBUG("Skin Server: %s", get_skin_server().c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -95,4 +95,3 @@ void init_skin() {
|
|||
_init_skin_loader();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -377,4 +377,3 @@ void _sound_resolve_all() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,4 +125,3 @@ void init_sound() {
|
|||
overwrite_calls(SoundEngine_init, SoundEngine_init_injection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ void run_tests() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ void TextInputBox::tick() {
|
|||
}
|
||||
|
||||
if (m_bFocused) {
|
||||
if (Common_getTimeMs() > m_lastFlashed + 500) {
|
||||
if (Common::getTimeMs() > m_lastFlashed + 500) {
|
||||
m_lastFlashed += 500;
|
||||
m_bCursorOn ^= 1;
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ void TextInputBox::charPressed(int k) {
|
|||
static std::string get_rendered_text(Font *font, int width, int scroll_pos, std::string text) {
|
||||
std::string rendered_text = text.substr(scroll_pos);
|
||||
int max_width = width - (PADDING * 2);
|
||||
while (Font_width(font, &rendered_text) > max_width) {
|
||||
while (font->width(&rendered_text) > max_width) {
|
||||
rendered_text.pop_back();
|
||||
}
|
||||
return rendered_text;
|
||||
|
@ -297,4 +297,3 @@ bool TextInputBox::isFocused() {
|
|||
void TextInputBox::setMaxLength(int max_length) {
|
||||
m_maxLength = max_length;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,4 +54,3 @@ void TextInputScreen::setup(Screen_vtable *vtable) {
|
|||
delete self->m_textInputs;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ void init_textures() {
|
|||
// Disable Texture Loading
|
||||
overwrite_virtual_calls(AppPlatform_linux_loadTexture, AppPlatform_linux_loadTexture_injection);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ CUSTOM_VTABLE(lava_texture, DynamicTexture) {
|
|||
for (int x = 0; x < 16; x++) {
|
||||
for (int y = 0; y < 16; y++) {
|
||||
float f = 0.0F;
|
||||
int ax = int(Mth_sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||
int ay = int(Mth_sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||
int ax = int(Mth::sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||
int ay = int(Mth::sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||
for (int bx = x - 1; bx <= x + 1; bx++) {
|
||||
for (int by = y - 1; by <= y + 1; by++) {
|
||||
int k2 = (bx + ay) & 0xf;
|
||||
|
@ -57,7 +57,7 @@ CUSTOM_VTABLE(lava_texture, DynamicTexture) {
|
|||
self->m_data3[x + y * 16] = 0.0f;
|
||||
}
|
||||
self->m_data4[x + y * 16] -= 0.06f;
|
||||
if (Mth_random() < 0.005f) {
|
||||
if (Mth::random() < 0.005f) {
|
||||
self->m_data4[x + y * 16] = 1.5f;
|
||||
}
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ CUSTOM_VTABLE(lava_side_texture, DynamicTexture) {
|
|||
for (int x = 0; x < 16; x++) {
|
||||
for (int y = 0; y < 16; y++) {
|
||||
float f = 0.0F;
|
||||
int ax = int(Mth_sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||
int ay = int(Mth_sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||
int ax = int(Mth::sin((float(x) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||
int ay = int(Mth::sin((float(y) * float(M_PI) * 2) / 16.0f) * 1.2f);
|
||||
for (int bx = x - 1; bx <= x + 1; bx++) {
|
||||
for (int by = y - 1; by <= y + 1; by++) {
|
||||
int k2 = (bx + ay) & 0xf;
|
||||
|
@ -121,7 +121,7 @@ CUSTOM_VTABLE(lava_side_texture, DynamicTexture) {
|
|||
self->m_data3[x + y * 16] = 0.0f;
|
||||
}
|
||||
self->m_data4[x + y * 16] -= 0.06f;
|
||||
if (Mth_random() < 0.005f) {
|
||||
if (Mth::random() < 0.005f) {
|
||||
self->m_data4[x + y * 16] = 1.5f;
|
||||
}
|
||||
}
|
||||
|
@ -259,4 +259,3 @@ void _init_textures_lava(bool animated_water_param, bool animated_lava_param, bo
|
|||
animated_fire = animated_fire_param;
|
||||
overwrite_call((void *) 0x170b4, (void *) Textures_addDynamicTexture_injection);
|
||||
}
|
||||
|
||||
|
|
|
@ -236,4 +236,3 @@ void init_textures() {
|
|||
// Load Textures
|
||||
overwrite_virtual_calls(AppPlatform_linux_loadTexture, AppPlatform_linux_loadTexture_injection);
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ static void StartMenuScreen_render_Screen_render_injection(Screen *screen, int x
|
|||
glRotatef(-20.0f, 0.0f, 0.0f, 1.0f);
|
||||
// Scale
|
||||
int textWidth = screen->font->width(¤t_splash);
|
||||
float timeMS = float(Common_getTimeMs() % 1000) / 1000.0f;
|
||||
float timeMS = float(Common::getTimeMs() % 1000) / 1000.0f;
|
||||
float scale = max_scale - Mth::abs(0.1f * Mth::sin(2.0f * float(M_PI) * timeMS));
|
||||
float real_text_width = textWidth * max_scale;
|
||||
if (real_text_width > max_width) {
|
||||
|
@ -166,4 +166,3 @@ void init_title_screen() {
|
|||
srand(time(nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -106,4 +106,3 @@ void init_touch() {
|
|||
unsigned char outline_patch[4] = {(unsigned char) (block_outlines ? !touch_gui : touch_gui), 0x00, 0x50, 0xe3}; // "cmp r0, #0x1" or "cmp r0, #0x0"
|
||||
patch((void *) 0x4a210, outline_patch);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ void init_version() {
|
|||
// Log
|
||||
INFO("Starting Minecraft: Pi Edition (%s)", version_get());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user