Don't consider 3D floors as transparent if they have FOF_SPLAT and an alpha of 255

This commit is contained in:
Lactozilla 2024-12-01 22:11:48 -03:00
parent 54dde5305f
commit a40d5dccdc

View file

@ -1692,7 +1692,7 @@ static void HWR_ProcessSeg(void)
{ {
blendmode = PF_Masked; blendmode = PF_Masked;
if ((rover->fofflags & FOF_TRANSLUCENT && !(rover->fofflags & FOF_SPLAT)) || rover->blend) if ((rover->fofflags & FOF_TRANSLUCENT && !((rover->fofflags & FOF_SPLAT) && rover->alpha >= 255)) || rover->blend)
{ {
blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent; blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent;
Surf.PolyColor.s.alpha = max(0, min(rover->alpha, 255)); Surf.PolyColor.s.alpha = max(0, min(rover->alpha, 255));
@ -1849,7 +1849,7 @@ static void HWR_ProcessSeg(void)
{ {
blendmode = PF_Masked; blendmode = PF_Masked;
if ((rover->fofflags & FOF_TRANSLUCENT && !(rover->fofflags & FOF_SPLAT)) || rover->blend) if ((rover->fofflags & FOF_TRANSLUCENT && !((rover->fofflags & FOF_SPLAT) && rover->alpha >= 255)) || rover->blend)
{ {
blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent; blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent;
Surf.PolyColor.s.alpha = max(0, min(rover->alpha, 255)); Surf.PolyColor.s.alpha = max(0, min(rover->alpha, 255));
@ -2530,7 +2530,7 @@ static void HWR_Subsector(size_t num)
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture, alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
true, false, rover->master->frontsector->extra_colormap); true, false, rover->master->frontsector->extra_colormap);
} }
else if (rover->fofflags & FOF_TRANSLUCENT || rover->blend) // SoM: Flags are more efficient else if ((rover->fofflags & FOF_TRANSLUCENT && !((rover->fofflags & FOF_SPLAT) && rover->alpha >= 255)) || rover->blend) // SoM: Flags are more efficient
{ {
light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < bottomCullHeight ? true : false); light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < bottomCullHeight ? true : false);
@ -2576,7 +2576,7 @@ static void HWR_Subsector(size_t num)
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture, alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
true, false, rover->master->frontsector->extra_colormap); true, false, rover->master->frontsector->extra_colormap);
} }
else if (rover->fofflags & FOF_TRANSLUCENT || rover->blend) else if ((rover->fofflags & FOF_TRANSLUCENT && !((rover->fofflags & FOF_SPLAT) && rover->alpha >= 255)) || rover->blend)
{ {
light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < topCullHeight ? true : false); light = R_GetPlaneLight(gl_frontsector, centerHeight, viewz < topCullHeight ? true : false);