From f19c2d24a30f2eacd069bb6051366112af7beac0 Mon Sep 17 00:00:00 2001 From: Shredder Date: Sat, 11 Apr 2026 19:39:46 +0500 Subject: [PATCH] Attempt to fix Normal Shading on Android and fix IOS compile, also hopefully fixes the millions of errors in the ios logs --- src/client/renderer/ItemInHandRenderer.cpp | 4 ++-- src/client/renderer/Lighting.cpp | 1 + src/client/renderer/entity/PaintingRenderer.cpp | 4 ++-- src/client/renderer/gles.h | 6 +++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/client/renderer/ItemInHandRenderer.cpp b/src/client/renderer/ItemInHandRenderer.cpp index fdd495b..3bd90bc 100755 --- a/src/client/renderer/ItemInHandRenderer.cpp +++ b/src/client/renderer/ItemInHandRenderer.cpp @@ -338,7 +338,7 @@ void ItemInHandRenderer::render( float a ) glTranslatef2(0.7f * d, -0.65f * d - (1 - h) * 0.6f, -0.9f * d); glRotatef2(45, 0, 1, 0); - //glEnable2(GL_RESCALE_NORMAL); + glEnable2(GL_RESCALE_NORMAL); glRotatef2(-swing3 * 20, 0, 1, 0); glRotatef2(-swing2 * 20, 0, 0, 1); glRotatef2(-swing2 * 80, 1, 0, 0); @@ -394,7 +394,7 @@ void ItemInHandRenderer::render( float a ) glTranslatef2(0.8f * d, -0.75f * d - (1 - h) * 0.6f, -0.9f * d); glRotatef2(45, 0, 1, 0); - //glEnable2(GL_RESCALE_NORMAL); + glEnable2(GL_RESCALE_NORMAL); glRotatef2(swing2 * 70, 0, 1, 0); glRotatef2(-swing3 * 20, 0, 0, 1); // glRotatef2(-swing2 * 80, 1, 0, 0); diff --git a/src/client/renderer/Lighting.cpp b/src/client/renderer/Lighting.cpp index 4151cb2..db0d93e 100644 --- a/src/client/renderer/Lighting.cpp +++ b/src/client/renderer/Lighting.cpp @@ -14,6 +14,7 @@ void Lighting::turnOn(Minecraft* minecraft) { turnOff(); return; } + glEnable(GL_NORMALIZE); // if normal lighting is true then enable GLES/OpenGL states to setup lighting glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); diff --git a/src/client/renderer/entity/PaintingRenderer.cpp b/src/client/renderer/entity/PaintingRenderer.cpp index 1513e95..6c8bf0d 100755 --- a/src/client/renderer/entity/PaintingRenderer.cpp +++ b/src/client/renderer/entity/PaintingRenderer.cpp @@ -9,7 +9,7 @@ void PaintingRenderer::render( Entity* entity, float x, float y, float z, float glPushMatrix(); glTranslatef(float(x), float(y), float(z)); glRotatef(rot, 0, 1.0f, 0); - //glEnable(GL_RESCALE_NORMAL); + glEnable(GL_RESCALE_NORMAL); bindTexture("art/kz.png"); Painting* painting = (Painting*)entity; const Motive* motive = painting->motive; @@ -17,7 +17,7 @@ void PaintingRenderer::render( Entity* entity, float x, float y, float z, float float s = 1.0f / 16.0f; glScalef(s, s, s); renderPainting(painting, motive->w, motive->h, motive->uo, motive->vo, a); - //glDisable(GL_RESCALE_NORMAL); + glDisable(GL_RESCALE_NORMAL); glPopMatrix(); } diff --git a/src/client/renderer/gles.h b/src/client/renderer/gles.h index adb36e5..e557b1a 100755 --- a/src/client/renderer/gles.h +++ b/src/client/renderer/gles.h @@ -4,6 +4,10 @@ #include "../../platform/log.h" #include "../Options.h" +#if defined(__APPLE__) + #define GLES_SILENCE_DEPRECATION +#endif + // Android should always run OPENGL_ES #if defined(ANDROID) || defined(__APPLE__) || defined(RPI) #define OPENGL_ES @@ -143,7 +147,7 @@ int glhUnProjectf( float winx, float winy, float winz, // // Extensions // -#ifdef WIN32 +#ifdef WIN32 #define glGetProcAddress(a) wglGetProcAddress(a) #else #define glGetProcAddress(a) (void*(0))