From b888832114e02b747ac818aee51c24e1ae699cf7 Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Sat, 27 Jan 2024 16:31:58 -0300 Subject: [PATCH] Changes: - OpenGL: Fix a possibly incorrect use of HWR_SplitWall on extra textures on 3D floor sides - OpenGL: Fix a missing use of PF_Decal on extra textures on 3D floor sides --- src/hardware/hw_main.c | 43 ++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 60d8889c5..1050438ab 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1761,20 +1761,29 @@ static void HWR_RenderExtraTexture(unsigned which, side_t *side, sector_t *sec_f wallVerts[2].y = FIXED_TO_FLOAT(hS); wallVerts[1].y = FIXED_TO_FLOAT(lS); + blendmode |= PF_Decal; + extracolormap_t *colormap = gl_frontsector->extra_colormap; +#define RENDER_WALL_POLYGON() { \ + if (gl_frontsector->numlights) \ + { \ + if (!(blendmode & PF_Masked)) \ + HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, FOF_TRANSLUCENT, pfloor, blendmode); \ + else \ + HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, FOF_CUTLEVEL, pfloor, blendmode); \ + } \ + else \ + { \ + if (!(blendmode & PF_Masked)) \ + HWR_AddTransparentWall(wallVerts, &Surf, texnum, blendmode, blendmode & PF_Fog, lightnum, colormap); \ + else \ + HWR_ProjectWall(wallVerts, &Surf, blendmode, lightnum, colormap); \ + } \ +} + if (!(h == l && hS == lS)) - { - if (gl_frontsector->numlights) - HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, FOF_CUTLEVEL, pfloor, blendmode); - else - { - if (blendmode != PF_Masked) - HWR_AddTransparentWall(wallVerts, &Surf, texnum, blendmode, blendmode & PF_Fog, lightnum, colormap); - else - HWR_ProjectWall(wallVerts, &Surf, blendmode, lightnum, colormap); - } - } + RENDER_WALL_POLYGON(); if (!intersected) return; @@ -1850,15 +1859,9 @@ static void HWR_RenderExtraTexture(unsigned which, side_t *side, sector_t *sec_f wallVerts[1].t = (hS - lS + texturevpegslope) * yscale * grTex->scaleY; wallVerts[2].s = wallVerts[1].s = ((xcliphigh * xscale) + overlay->offsetx) * grTex->scaleX; - if (gl_frontsector->numlights) - HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, FOF_CUTLEVEL, pfloor, blendmode); - else - { - if (blendmode != PF_Masked) - HWR_AddTransparentWall(wallVerts, &Surf, texnum, blendmode, blendmode & PF_Fog, lightnum, colormap); - else - HWR_ProjectWall(wallVerts, &Surf, blendmode, lightnum, colormap); - } + RENDER_WALL_POLYGON(); + +#undef RENDER_WALL_POLYGON } static void HWR_RenderFFloorExtraTextures(ffloor_t *pfloor, v2d_t vs, v2d_t ve, float xcliplow, float xcliphigh, FSurfaceInfo Surf, FBITFIELD blendmode, UINT32 lightnum)