Attempt to fix Normal Shading on Android and fix IOS compile, also hopefully fixes the millions of errors in the ios logs

This commit is contained in:
Shredder
2026-04-11 19:39:46 +05:00
parent e1b81a7cc3
commit f19c2d24a3
4 changed files with 10 additions and 5 deletions

View File

@@ -338,7 +338,7 @@ void ItemInHandRenderer::render( float a )
glTranslatef2(0.7f * d, -0.65f * d - (1 - h) * 0.6f, -0.9f * d); glTranslatef2(0.7f * d, -0.65f * d - (1 - h) * 0.6f, -0.9f * d);
glRotatef2(45, 0, 1, 0); glRotatef2(45, 0, 1, 0);
//glEnable2(GL_RESCALE_NORMAL); glEnable2(GL_RESCALE_NORMAL);
glRotatef2(-swing3 * 20, 0, 1, 0); glRotatef2(-swing3 * 20, 0, 1, 0);
glRotatef2(-swing2 * 20, 0, 0, 1); glRotatef2(-swing2 * 20, 0, 0, 1);
glRotatef2(-swing2 * 80, 1, 0, 0); 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); glTranslatef2(0.8f * d, -0.75f * d - (1 - h) * 0.6f, -0.9f * d);
glRotatef2(45, 0, 1, 0); glRotatef2(45, 0, 1, 0);
//glEnable2(GL_RESCALE_NORMAL); glEnable2(GL_RESCALE_NORMAL);
glRotatef2(swing2 * 70, 0, 1, 0); glRotatef2(swing2 * 70, 0, 1, 0);
glRotatef2(-swing3 * 20, 0, 0, 1); glRotatef2(-swing3 * 20, 0, 0, 1);
// glRotatef2(-swing2 * 80, 1, 0, 0); // glRotatef2(-swing2 * 80, 1, 0, 0);

View File

@@ -14,6 +14,7 @@ void Lighting::turnOn(Minecraft* minecraft) {
turnOff(); turnOff();
return; return;
} }
glEnable(GL_NORMALIZE);
// if normal lighting is true then enable GLES/OpenGL states to setup lighting // if normal lighting is true then enable GLES/OpenGL states to setup lighting
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0); glEnable(GL_LIGHT0);

View File

@@ -9,7 +9,7 @@ void PaintingRenderer::render( Entity* entity, float x, float y, float z, float
glPushMatrix(); glPushMatrix();
glTranslatef(float(x), float(y), float(z)); glTranslatef(float(x), float(y), float(z));
glRotatef(rot, 0, 1.0f, 0); glRotatef(rot, 0, 1.0f, 0);
//glEnable(GL_RESCALE_NORMAL); glEnable(GL_RESCALE_NORMAL);
bindTexture("art/kz.png"); bindTexture("art/kz.png");
Painting* painting = (Painting*)entity; Painting* painting = (Painting*)entity;
const Motive* motive = painting->motive; 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; float s = 1.0f / 16.0f;
glScalef(s, s, s); glScalef(s, s, s);
renderPainting(painting, motive->w, motive->h, motive->uo, motive->vo, a); renderPainting(painting, motive->w, motive->h, motive->uo, motive->vo, a);
//glDisable(GL_RESCALE_NORMAL); glDisable(GL_RESCALE_NORMAL);
glPopMatrix(); glPopMatrix();
} }

View File

@@ -4,6 +4,10 @@
#include "../../platform/log.h" #include "../../platform/log.h"
#include "../Options.h" #include "../Options.h"
#if defined(__APPLE__)
#define GLES_SILENCE_DEPRECATION
#endif
// Android should always run OPENGL_ES // Android should always run OPENGL_ES
#if defined(ANDROID) || defined(__APPLE__) || defined(RPI) #if defined(ANDROID) || defined(__APPLE__) || defined(RPI)
#define OPENGL_ES #define OPENGL_ES
@@ -143,7 +147,7 @@ int glhUnProjectf( float winx, float winy, float winz,
// //
// Extensions // Extensions
// //
#ifdef WIN32 #ifdef WIN32
#define glGetProcAddress(a) wglGetProcAddress(a) #define glGetProcAddress(a) wglGetProcAddress(a)
#else #else
#define glGetProcAddress(a) (void*(0)) #define glGetProcAddress(a) (void*(0))