mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Additive/Subtractive translation map support on midtextures
This commit is contained in:
parent
b341cacb0a
commit
4a10861669
3 changed files with 26 additions and 7 deletions
|
|
@ -1466,12 +1466,15 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||||
blendmode = PF_Translucent;
|
blendmode = PF_Translucent;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT)
|
{
|
||||||
blendmode = HWR_TranstableToAlpha(R_GetLinedefTransTable(gl_linedef->alpha), &Surf);
|
transnum_t transtable = R_GetLinedefTransTable(gl_linedef);
|
||||||
|
if (transtable != NUMTRANSMAPS)
|
||||||
|
blendmode = HWR_TranstableToAlpha(transtable, &Surf);
|
||||||
else
|
else
|
||||||
blendmode = PF_Masked;
|
blendmode = PF_Masked;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (gl_curline->polyseg && gl_curline->polyseg->translucency > 0)
|
if (gl_curline->polyseg && gl_curline->polyseg->translucency > 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
24
src/r_segs.c
24
src/r_segs.c
|
|
@ -270,9 +270,23 @@ static void R_Render2sidedMultiPatchColumn(column_t *column)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
transnum_t R_GetLinedefTransTable(fixed_t alpha)
|
transnum_t R_GetLinedefTransTable(line_t *ldef)
|
||||||
{
|
{
|
||||||
return (20*(FRACUNIT - alpha - 1) + FRACUNIT) >> (FRACBITS+1);
|
transnum_t transnum = NUMTRANSMAPS; // Send back NUMTRANSMAPS for none
|
||||||
|
fixed_t alpha = ldef->alpha;
|
||||||
|
if (alpha > 0 && alpha < FRACUNIT)
|
||||||
|
transnum = (20*(FRACUNIT - alpha - 1) + FRACUNIT) >> (FRACBITS+1);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (ldef->special)
|
||||||
|
{
|
||||||
|
case 910: transnum = tr_transadd; break;
|
||||||
|
case 911: transnum = tr_transsub; break;
|
||||||
|
default: transnum = NUMTRANSMAPS; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return transnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
|
|
@ -289,6 +303,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
INT32 times, repeats;
|
INT32 times, repeats;
|
||||||
INT64 overflow_test;
|
INT64 overflow_test;
|
||||||
INT32 range;
|
INT32 range;
|
||||||
|
transnum_t transtable = NUMTRANSMAPS;
|
||||||
|
|
||||||
// Calculate light table.
|
// Calculate light table.
|
||||||
// Use different light tables
|
// Use different light tables
|
||||||
|
|
@ -305,9 +320,10 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
if (!ldef->alpha)
|
if (!ldef->alpha)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ldef->alpha > 0 && ldef->alpha < FRACUNIT)
|
transtable = R_GetLinedefTransTable(ldef);
|
||||||
|
if (transtable != NUMTRANSMAPS)
|
||||||
{
|
{
|
||||||
dc_transmap = transtables + ((R_GetLinedefTransTable(ldef->alpha) - 1) << FF_TRANSSHIFT);
|
dc_transmap = transtables + ((transtable - 1) << FF_TRANSSHIFT);
|
||||||
colfunc = colfuncs[COLDRAWFUNC_FUZZY];
|
colfunc = colfuncs[COLDRAWFUNC_FUZZY];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
#pragma interface
|
#pragma interface
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
transnum_t R_GetLinedefTransTable(fixed_t alpha);
|
transnum_t R_GetLinedefTransTable(line_t *line);
|
||||||
void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2);
|
void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2);
|
||||||
void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pffloor);
|
void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pffloor);
|
||||||
void R_StoreWallRange(INT32 start, INT32 stop);
|
void R_StoreWallRange(INT32 start, INT32 stop);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue