Simpler Smooth Lighting Patch

This commit is contained in:
TheBrokenRail 2020-11-27 18:21:59 -05:00
parent 0eb10dea7c
commit 0d6db1e606
3 changed files with 3 additions and 14 deletions

View File

@ -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 <stdlib.h>
// Use VirGL

View File

@ -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;

View File

@ -18,8 +18,6 @@ void extra_third_person();
void extra_set_is_left_click(int val);
int extra_get_smooth_lighting();
#ifdef __cplusplus
}
#endif