diff --git a/extras/conf/udb/Includes/SRB222_misc.cfg b/extras/conf/udb/Includes/SRB222_misc.cfg index 1b4fb4b4b..50c83e456 100644 --- a/extras/conf/udb/Includes/SRB222_misc.cfg +++ b/extras/conf/udb/Includes/SRB222_misc.cfg @@ -70,6 +70,7 @@ linedefrenderstyles subtract = "Subtract"; reversesubtract = "Reverse subtract"; modulate = "Modulate"; + fog = "Fog"; } sectorflags diff --git a/src/deh_tables.c b/src/deh_tables.c index 730ae959b..cfc98f631 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -4898,6 +4898,7 @@ struct int_const_s const INT_CONST[] = { {"AST_REVERSESUBTRACT",AST_REVERSESUBTRACT}, {"AST_MODULATE",AST_MODULATE}, {"AST_OVERLAY",AST_OVERLAY}, + {"AST_FOG",AST_FOG}, // Render flags {"RF_HORIZONTALFLIP",RF_HORIZONTALFLIP}, diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index a1dd53eb7..13b2a39c3 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1454,13 +1454,13 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom case 221: case 253: case 256: - if (gl_linedef->blendmode) + if (gl_linedef->blendmode != AST_FOG) blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf); else blendmode = PF_Translucent; break; default: - if (gl_linedef->blendmode) + if (gl_linedef->blendmode != AST_FOG) { if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT) blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf); diff --git a/src/p_setup.c b/src/p_setup.c index 9a2e14cab..4f21922a0 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1713,6 +1713,8 @@ static void ParseTextmapLinedefParameter(UINT32 i, char *param, char *val) lines[i].blendmode = AST_REVERSESUBTRACT; else if (fastcmp(val, "modulate")) lines[i].blendmode = AST_MODULATE; + if (fastcmp(val, "fog")) + lines[i].blendmode = AST_FOG; } else if (fastcmp(param, "executordelay")) lines[i].executordelay = atol(val); @@ -3337,6 +3339,9 @@ static void P_ConvertBinaryMap(void) lines[i].args[4] |= TMSC_BACKTOFRONTCEILING; lines[i].special = 720; break; + case 909: //Fog wall + lines[i].blendmode = AST_FOG; + break; default: break; } diff --git a/src/r_defs.h b/src/r_defs.h index 3c2178937..fa63de400 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -716,7 +716,7 @@ typedef struct #endif // 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 { diff --git a/src/r_segs.c b/src/r_segs.c index 4460f9f90..2459436b5 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -155,7 +155,13 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) if (!ldef->alpha) 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) 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)); colfunc = colfuncs[COLDRAWFUNC_FUZZY]; } - else if (ldef->special == 909) - { - colfunc = colfuncs[COLDRAWFUNC_FOG]; - windowtop = frontsector->ceilingheight; - windowbottom = frontsector->floorheight; - } else colfunc = colfuncs[BASEDRAWFUNC];