Turn the fog wall linedef type into a blendmode

This commit is contained in:
MascaraSnake 2021-12-31 15:00:27 +01:00
parent ac3dd146c7
commit 2886a277d8
6 changed files with 17 additions and 10 deletions

View file

@ -70,6 +70,7 @@ linedefrenderstyles
subtract = "Subtract"; subtract = "Subtract";
reversesubtract = "Reverse subtract"; reversesubtract = "Reverse subtract";
modulate = "Modulate"; modulate = "Modulate";
fog = "Fog";
} }
sectorflags sectorflags

View file

@ -4898,6 +4898,7 @@ struct int_const_s const INT_CONST[] = {
{"AST_REVERSESUBTRACT",AST_REVERSESUBTRACT}, {"AST_REVERSESUBTRACT",AST_REVERSESUBTRACT},
{"AST_MODULATE",AST_MODULATE}, {"AST_MODULATE",AST_MODULATE},
{"AST_OVERLAY",AST_OVERLAY}, {"AST_OVERLAY",AST_OVERLAY},
{"AST_FOG",AST_FOG},
// Render flags // Render flags
{"RF_HORIZONTALFLIP",RF_HORIZONTALFLIP}, {"RF_HORIZONTALFLIP",RF_HORIZONTALFLIP},

View file

@ -1454,13 +1454,13 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
case 221: case 221:
case 253: case 253:
case 256: case 256:
if (gl_linedef->blendmode) if (gl_linedef->blendmode != AST_FOG)
blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf); blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf);
else else
blendmode = PF_Translucent; blendmode = PF_Translucent;
break; break;
default: default:
if (gl_linedef->blendmode) if (gl_linedef->blendmode != AST_FOG)
{ {
if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT) if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT)
blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf); blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf);

View file

@ -1713,6 +1713,8 @@ static void ParseTextmapLinedefParameter(UINT32 i, char *param, char *val)
lines[i].blendmode = AST_REVERSESUBTRACT; lines[i].blendmode = AST_REVERSESUBTRACT;
else if (fastcmp(val, "modulate")) else if (fastcmp(val, "modulate"))
lines[i].blendmode = AST_MODULATE; lines[i].blendmode = AST_MODULATE;
if (fastcmp(val, "fog"))
lines[i].blendmode = AST_FOG;
} }
else if (fastcmp(param, "executordelay")) else if (fastcmp(param, "executordelay"))
lines[i].executordelay = atol(val); lines[i].executordelay = atol(val);
@ -3330,6 +3332,9 @@ static void P_ConvertBinaryMap(void)
lines[i].args[4] |= TMSC_BACKTOFRONTCEILING; lines[i].args[4] |= TMSC_BACKTOFRONTCEILING;
lines[i].special = 720; lines[i].special = 720;
break; break;
case 909: //Fog wall
lines[i].blendmode = AST_FOG;
break;
default: default:
break; break;
} }

View file

@ -716,7 +716,7 @@ typedef struct
#endif #endif
// Possible alpha types for a patch. // Possible alpha types for a patch.
enum patchalphastyle {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY}; enum patchalphastyle {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY, AST_FOG};
typedef enum typedef enum
{ {

View file

@ -155,7 +155,13 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
if (!ldef->alpha) if (!ldef->alpha)
return; return;
if (ldef->blendmode) if (ldef->blendmode == AST_FOG)
{
colfunc = colfuncs[COLDRAWFUNC_FOG];
windowtop = frontsector->ceilingheight;
windowbottom = frontsector->floorheight;
}
else if (ldef->blendmode)
{ {
if (ldef->alpha == NUMTRANSMAPS || ldef->blendmode == AST_MODULATE) if (ldef->alpha == NUMTRANSMAPS || ldef->blendmode == AST_MODULATE)
dc_transmap = R_GetBlendTable(ldef->blendmode, 0); dc_transmap = R_GetBlendTable(ldef->blendmode, 0);
@ -168,12 +174,6 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
dc_transmap = R_GetTranslucencyTable(R_GetLinedefTransTable(ldef->alpha)); dc_transmap = R_GetTranslucencyTable(R_GetLinedefTransTable(ldef->alpha));
colfunc = colfuncs[COLDRAWFUNC_FUZZY]; colfunc = colfuncs[COLDRAWFUNC_FUZZY];
} }
else if (ldef->special == 909)
{
colfunc = colfuncs[COLDRAWFUNC_FOG];
windowtop = frontsector->ceilingheight;
windowbottom = frontsector->floorheight;
}
else else
colfunc = colfuncs[BASEDRAWFUNC]; colfunc = colfuncs[BASEDRAWFUNC];