From c080fc873247280c5c677f5381ae677abe2d320c Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 11 Nov 2025 22:39:13 +0100 Subject: [PATCH] GL_UpdateTexture: fix small oversight from when i refactored it GL_TEXFMT_AP_88 needs to increment the image data ptr even if chromakeyed --- src/hardware/r_opengl/r_opengl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 566d2458c..cb7eca43c 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2004,7 +2004,7 @@ void GL_UpdateTexture(GLMipmap_t *pTexInfo) { if (chromakeyed && (*pImgData == HWR_PATCHES_CHROMAKEY_COLORINDEX)) { - tex[idx].s = (byteColor_t){0, 0, 0, 0}; + memset(&tex[idx].s, 0, sizeof(byteColor_t)); pTexInfo->flags |= TF_TRANSPARENT; // there is a hole in it } else @@ -2016,10 +2016,9 @@ void GL_UpdateTexture(GLMipmap_t *pTexInfo) if (texinfoformat != GL_TEXFMT_AP_88) continue; - if (chromakeyed) - continue; - tex[idx].s.alpha = *pImgData; + if (!chromakeyed) + tex[idx].s.alpha = *pImgData; pImgData++; } } @@ -2054,9 +2053,9 @@ void GL_UpdateTexture(GLMipmap_t *pTexInfo) { for (i = 0; i < w; i++, idx++) { - tex[idx].s.red = *pImgData; - tex[idx].s.green = *pImgData; - tex[idx].s.blue = *pImgData; + tex[idx].s.red = + tex[idx].s.green = + tex[idx].s.blue = *pImgData; pImgData++; tex[idx].s.alpha = *pImgData; pImgData++; @@ -3187,7 +3186,8 @@ void GL_SetTransform(FTransform *stransform) { float dy = stransform->viewaiming * 2; - if (stransform->fliptype == TRANSFORM_FLIP || stransform->fliptype == TRANSFORM_MIRRORFLIP) + if (stransform->fliptype == TRANSFORM_FLIP + || stransform->fliptype == TRANSFORM_MIRRORFLIP) dy *= -1.0f; pglTranslatef(0.0f, -dy/BASEVIDHEIGHT, 0.0f);