From 89906cf384344420ed947d2c7fefd5553270101c Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 22 Apr 2025 18:43:19 +0100 Subject: [PATCH] Revert "speed up ogl palette stuff" why is windows like this? This reverts commit 1ffb655131e9cf488b5100bcc672e51e2b86c5f5. --- src/hardware/r_opengl/r_opengl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 457f7fcf9..4621658ce 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -683,7 +683,7 @@ typedef enum gluniform_leveltime, gluniform_scr_resolution, - + gluniform_max, } gluniform_t; @@ -1328,13 +1328,14 @@ void GL_ReadScreenTexture(int tex, UINT16 *dst_data) // -----------------+ void GL_SetPalette(RGBA_t *palette) { - size_t palsize = (sizeof(RGBA_t) * 256); - // on a palette change, you have to reload all of the textures - if (memcmp(&myPaletteData, palette, palsize)) + INT32 i; + + for (i = 0; i < 256; i++) { - memcpy(&myPaletteData, palette, palsize); - GL_Flush(); + myPaletteData[i].s = palette[i].s; } + + GL_Flush(); } // -----------------+ @@ -2640,7 +2641,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics poly.green = byte2float[Surface->PolyColor.s.green]; poly.blue = byte2float[Surface->PolyColor.s.blue]; poly.alpha = byte2float[Surface->PolyColor.s.alpha]; - + pglColor4ubv((GLubyte*)&Surface->PolyColor.s); GL_SetBlend((poly.alpha < 1 ? Surface->PolyFlags : (PF_Masked|PF_Occlude))|PF_Modulated); @@ -2654,7 +2655,7 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics fade.green = byte2float[Surface->FadeColor.s.green]; fade.blue = byte2float[Surface->FadeColor.s.blue]; fade.alpha = byte2float[Surface->FadeColor.s.alpha]; - + if (Surface->LightTableId && Surface->LightTableId != lt_downloaded) { pglActiveTexture(GL_TEXTURE2);