Keep NUMTRANSMAPS what it was, instead add NUMEFFECTMAPS to end of enum

Should have easier merging and be less likely to break current effects.
This commit is contained in:
Sryder 2020-10-26 11:18:53 +00:00
parent a585d3c9d1
commit 11386e12ba
7 changed files with 16 additions and 14 deletions

View file

@ -11148,9 +11148,10 @@ struct {
{"tr_trans70",tr_trans70},
{"tr_trans80",tr_trans80},
{"tr_trans90",tr_trans90},
{"NUMTRANSMAPS",NUMTRANSMAPS},
{"tr_transadd",tr_transadd},
{"tr_transsub",tr_transsub},
{"NUMTRANSMAPS",NUMTRANSMAPS},
{"NUMEFFECTMAPS",NUMEFFECTMAPS},
// Type of levels
{"TOL_RACE",TOL_RACE},

View file

@ -1488,7 +1488,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
default:
{
transnum_t transtable = R_GetLinedefTransTable(gl_linedef);
if (transtable != NUMTRANSMAPS)
if (transtable != NUMEFFECTMAPS)
blendmode = HWR_TranstableToAlpha(transtable, &Surf);
else
blendmode = PF_Masked;
@ -1498,7 +1498,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (gl_curline->polyseg && gl_curline->polyseg->translucency > 0)
{
if (gl_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn
if (gl_curline->polyseg->translucency >= NUMEFFECTMAPS) // wall not drawn
{
Surf.PolyColor.s.alpha = 0x00; // This shouldn't draw anything regardless of blendmode
blendmode = PF_Masked;
@ -2902,7 +2902,7 @@ static void HWR_AddPolyObjectPlanes(void)
if (!(po_ptrs[i]->flags & POF_RENDERPLANES)) // Only render planes when you should
continue;
if (po_ptrs[i]->translucency >= NUMTRANSMAPS)
if (po_ptrs[i]->translucency >= NUMEFFECTMAPS)
continue;
if (polyobjsector->floorheight <= gl_frontsector->ceilingheight

View file

@ -212,7 +212,7 @@ static void Polyobj_GetInfo(polyobj_t *po, line_t *line)
if (po->parent == po->id) // do not allow a self-reference
po->parent = -1;
po->translucency = max(min(line->args[2], NUMTRANSMAPS), 0);
po->translucency = max(min(line->args[2], NUMEFFECTMAPS), 0);
po->flags = POF_SOLID|POF_TESTHEIGHT|POF_RENDERSIDES|POF_RENDERPLANES;

View file

@ -101,9 +101,10 @@ typedef enum
tr_trans70,
tr_trans80,
tr_trans90,
tr_transadd,
NUMTRANSMAPS,
tr_transadd = NUMTRANSMAPS,
tr_transsub,
NUMTRANSMAPS
NUMEFFECTMAPS,
} transnum_t;
#endif

View file

@ -1213,7 +1213,7 @@ static void PolyTranslucency(line_t *line)
else
po->translucency = value;
po->translucency = max(min(po->translucency, NUMTRANSMAPS), 0);
po->translucency = max(min(po->translucency, NUMEFFECTMAPS), 0);
}
// Makes a polyobject translucency fade and applies tangibility

View file

@ -780,7 +780,7 @@ void R_DrawSinglePlane(visplane_t *pl)
if (pl->polyobj)
{
// Hacked up support for alpha value in software mode Tails 09-24-2002 (sidenote: ported to polys 10-15-2014, there was no time travel involved -Red)
if (pl->polyobj->translucency >= NUMTRANSMAPS)
if (pl->polyobj->translucency >= NUMEFFECTMAPS)
return; // Don't even draw it
else if (pl->polyobj->translucency > 0)
{

View file

@ -281,7 +281,7 @@ static void R_Render2sidedMultiPatchColumn(column_t *column)
transnum_t R_GetLinedefTransTable(line_t *ldef)
{
transnum_t transnum = NUMTRANSMAPS; // Send back NUMTRANSMAPS for none
transnum_t transnum = NUMEFFECTMAPS; // Send back NUMEFFECTMAPS for none
fixed_t alpha = ldef->alpha;
if (alpha > 0 && alpha < FRACUNIT)
transnum = (20*(FRACUNIT - alpha - 1) + FRACUNIT) >> (FRACBITS+1);
@ -291,7 +291,7 @@ transnum_t R_GetLinedefTransTable(line_t *ldef)
{
case 910: transnum = tr_transadd; break;
case 911: transnum = tr_transsub; break;
default: transnum = NUMTRANSMAPS; break;
default: transnum = NUMEFFECTMAPS; break;
}
}
@ -312,7 +312,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
INT32 times, repeats;
INT64 overflow_test;
INT32 range;
transnum_t transtable = NUMTRANSMAPS;
transnum_t transtable = NUMEFFECTMAPS;
// Calculate light table.
// Use different light tables
@ -330,7 +330,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
return;
transtable = R_GetLinedefTransTable(ldef);
if (transtable != NUMTRANSMAPS)
if (transtable != NUMEFFECTMAPS)
{
dc_transmap = transtables + ((transtable - 1) << FF_TRANSSHIFT);
colfunc = colfuncs[COLDRAWFUNC_FUZZY];
@ -347,7 +347,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
if (curline->polyseg && curline->polyseg->translucency > 0)
{
if (curline->polyseg->translucency >= NUMTRANSMAPS)
if (curline->polyseg->translucency >= NUMEFFECTMAPS)
return;
dc_transmap = transtables + ((curline->polyseg->translucency-1)<<FF_TRANSSHIFT);