From 0d6db1e6064e1bb5470b06e7b52527c880149524 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 27 Nov 2020 18:21:59 -0500 Subject: [PATCH] Simpler Smooth Lighting Patch --- mods/src/compat.c | 6 ------ mods/src/extra.c | 9 +++------ mods/src/extra.h | 2 -- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/mods/src/compat.c b/mods/src/compat.c index fb23813..42e85f0 100644 --- a/mods/src/compat.c +++ b/mods/src/compat.c @@ -408,12 +408,6 @@ HOOK(SDL_GetWMInfo, int, (SDL_SysWMinfo *info)) { return 1; } -// Force Smooth Shading In Smooth Lighting Mode -HOOK(glShadeModel, void, (GLenum mode)) { - ensure_glShadeModel(); - (*real_glShadeModel)(extra_get_smooth_lighting() ? GL_SMOOTH : mode); -} - #include // Use VirGL diff --git a/mods/src/extra.c b/mods/src/extra.c index f9e8745..63dc67e 100644 --- a/mods/src/extra.c +++ b/mods/src/extra.c @@ -127,6 +127,7 @@ static char *get_username() { static int fancy_graphics; static int peaceful_mode; static int anaglyph; +static int smooth_lighting; // Configure Options static void Minecraft_init_injection(unsigned char *this) { // Call Original Method @@ -141,6 +142,8 @@ static void Minecraft_init_injection(unsigned char *this) { *(int32_t *) (options + 0xe8) = peaceful_mode ? 0 : 2; // 3D Anaglyph *(options + 0x15) = anaglyph; + // Smooth Lighting + *(options + 0x18) = smooth_lighting; } // Is Dedicated Server @@ -190,12 +193,6 @@ static int32_t Minecraft_isTouchscreen_injection(__attribute__((unused)) unsigne return 1; } -// Store Smooth Lighting -static int smooth_lighting; -int extra_get_smooth_lighting() { - return smooth_lighting; -} - // Store Left Click (0 = Not Pressed, 1 = Pressed, 2 = Repeat) // This Is Set To Repeat After First Attempted Left-Click Build Interaction static int is_left_click = 0; diff --git a/mods/src/extra.h b/mods/src/extra.h index 066351e..7be14b0 100644 --- a/mods/src/extra.h +++ b/mods/src/extra.h @@ -18,8 +18,6 @@ void extra_third_person(); void extra_set_is_left_click(int val); -int extra_get_smooth_lighting(); - #ifdef __cplusplus } #endif