mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +00:00
Turn the fog wall linedef type into a blendmode
This commit is contained in:
parent
ac3dd146c7
commit
2886a277d8
6 changed files with 17 additions and 10 deletions
|
@ -70,6 +70,7 @@ linedefrenderstyles
|
|||
subtract = "Subtract";
|
||||
reversesubtract = "Reverse subtract";
|
||||
modulate = "Modulate";
|
||||
fog = "Fog";
|
||||
}
|
||||
|
||||
sectorflags
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
@ -3330,6 +3332,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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
14
src/r_segs.c
14
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];
|
||||
|
||||
|
|
Loading…
Reference in a new issue