diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 066822e8c7d3128d2ade269aa8f0f47e7b5f55ae..5171ab435abbc2271e7027ed2a1c52d394dbd66a 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1494,12 +1494,8 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom transnum_t transtable = R_GetLinedefTransTable(gl_linedef); if (transtable == NUMTRANSMAPS) transtable = 0; - if (gl_linedef->special >= 910 && gl_linedef->special <= 919) - blend = AST_ADD; - else if (gl_linedef->special >= 920 && gl_linedef->special <= 929) - blend = AST_SUBTRACT; - else if (gl_linedef->special >= 930 && gl_linedef->special <= 939) - blend = AST_REVERSESUBTRACT; + if (gl_linedef->blendmode == AST_ADD || gl_linedef->blendmode == AST_SUBTRACT || gl_linedef->blendmode == AST_REVERSESUBTRACT) + blend = gl_linedef->blendmode; blendmode = HWR_SurfaceBlend(blend, transtable, &Surf); break; diff --git a/src/p_setup.c b/src/p_setup.c index 0ffc807f5fe2ddd58401f31c66e9dfcaadd2026e..744ec3c55f1d5ef0f06a7568b5598076f2bb9556 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3156,6 +3156,18 @@ static void P_ConvertBinaryMap(void) if (lines[i].special >= 910 && lines[i].special <= 939) lines[i].alpha = ((10 - lines[i].special % 10) << FRACBITS)/10; + if (lines[i].special >= 910 && lines[i].special <= 919) // additive + lines[i].blendmode = AST_ADD; + + if (lines[i].special >= 920 && lines[i].special <= 929) // subtractive + lines[i].blendmode = AST_SUBTRACT; + + if (lines[i].special >= 930 && lines[i].special <= 939) // reverse subtractive + lines[i].blendmode = AST_REVERSESUBTRACT; + + if (lines[i].special == 940) // modulate + lines[i].blendmode = AST_MODULATE; + //Linedef executor delay if (lines[i].special >= 400 && lines[i].special < 500) { diff --git a/src/r_defs.h b/src/r_defs.h index 681bb36198e466cc2c8dae1558c697111aca3699..16912fca1ecefabb44a607351658a86663c6e5b9 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -398,6 +398,7 @@ typedef struct line_s // Visual appearance: sidedefs. UINT16 sidenum[2]; // sidenum[1] will be 0xffff if one-sided fixed_t alpha; // translucency + UINT8 blendmode; // blendmode INT32 executordelay; fixed_t bbox[4]; // bounding box for the extent of the linedef diff --git a/src/r_segs.c b/src/r_segs.c index 209810059e66dc419ecc344863071a4e6a5a2c1c..0b9c9a80edf9ce3763e10c2c36931d0c38b696c8 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -162,25 +162,13 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) return; transtable = R_GetLinedefTransTable(ldef); - if (ldef->special >= 910 && ldef->special <= 919) + if (ldef->blendmode == AST_ADD || ldef->blendmode == AST_SUBTRACT || ldef->blendmode == AST_REVERSESUBTRACT) { if (transtable == NUMTRANSMAPS) transtable = 0; - blendmode = AST_ADD; + blendmode = ldef->blendmode; } - else if (ldef->special >= 920 && ldef->special <= 929) - { - if (transtable == NUMTRANSMAPS) - transtable = 0; - blendmode = AST_SUBTRACT; - } - else if (ldef->special >= 930 && ldef->special <= 939) - { - if (transtable == NUMTRANSMAPS) - transtable = 0; - blendmode = AST_REVERSESUBTRACT; - } - else if (ldef->special == 940) + else if (ldef->blendmode == AST_MODULATE) { transtable = 0; blendmode = AST_MODULATE;