From 9c6f720f11c8c78c72ec742c05cb22536d79a4e5 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 14 Jan 2024 14:14:54 +0100 Subject: [PATCH] Revert "change this" This reverts commit 25bc55730e1674ab4178a452685ca54ea3d0f84d. --- src/hardware/hw_main.c | 2 -- src/hardware/r_opengl/r_opengl.c | 11 +++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index fcc1330b7..4a394943a 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -517,8 +517,6 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col Surface->LightTableId = colormap->gl_lighttable_id; } - else - Surface->LightTableId = 0; } void HWR_ClearLightTableCache(void) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index b85ea5777..dc2b9b322 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -76,7 +76,6 @@ static float NEAR_CLIPPING_PLANE = NZCLIP_PLANE; static GLuint tex_downloaded = 0; -static GLuint lt_downloaded = 0; // currently bound lighttable texture static GLfloat fov = 90.0f; static FBITFIELD CurrentPolyFlags; @@ -1690,7 +1689,6 @@ EXPORT void HWRAPI(ClearLightTableCache) (void) ltcachehead = next; } ltcachetail = NULL; - lt_downloaded = 0; } // -----------------+ @@ -2570,12 +2568,11 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i if (gl_allowshaders) { Shader_Load(¤tSurfaceInfo, &firstPoly, &firstTint, &firstFade); - if ((gl_palshader) && (currentSurfaceInfo.LightTableId && currentSurfaceInfo.LightTableId != lt_downloaded)) + if (gl_palshader) { pglActiveTexture(GL_TEXTURE2);// this stuff could be done better but gonna do it quick like this for now pglBindTexture(GL_TEXTURE_2D, currentSurfaceInfo.LightTableId); pglActiveTexture(GL_TEXTURE0); - lt_downloaded = currentSurfaceInfo.LightTableId; } } @@ -2833,12 +2830,11 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i Shader_Load(&nextSurfaceInfo, &poly, &tint, &fade); - if ((gl_palshader) && (nextSurfaceInfo.LightTableId && nextSurfaceInfo.LightTableId != lt_downloaded)) + if (gl_palshader) { pglActiveTexture(GL_TEXTURE2);// this stuff could be done better but gonna do it quick like this for now pglBindTexture(GL_TEXTURE_2D, nextSurfaceInfo.LightTableId); pglActiveTexture(GL_TEXTURE0); - lt_downloaded = nextSurfaceInfo.LightTableId; } } @@ -2945,12 +2941,11 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI fade.alpha = byte2float[pSurf->FadeColor.s.alpha]; } - if ((gl_palshader && gl_allowshaders) && (pSurf->LightTableId && pSurf->LightTableId != lt_downloaded)) + if (gl_palshader && gl_allowshaders) { pglActiveTexture(GL_TEXTURE2); pglBindTexture(GL_TEXTURE_2D, pSurf->LightTableId); pglActiveTexture(GL_TEXTURE0); - lt_downloaded = pSurf->LightTableId; } }