mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
Some fixes for the linedef alpha field
This commit is contained in:
parent
cedfc02f19
commit
24de2968a3
3 changed files with 7 additions and 3 deletions
|
@ -895,6 +895,7 @@ FBITFIELD HWR_TranstableToAlpha(INT32 transtablenum, FSurfaceInfo *pSurf)
|
||||||
{
|
{
|
||||||
switch (transtablenum)
|
switch (transtablenum)
|
||||||
{
|
{
|
||||||
|
case 0 : pSurf->FlatColor.s.alpha = 0x00;return PF_Masked;
|
||||||
case tr_trans10 : pSurf->FlatColor.s.alpha = 0xe6;return PF_Translucent;
|
case tr_trans10 : pSurf->FlatColor.s.alpha = 0xe6;return PF_Translucent;
|
||||||
case tr_trans20 : pSurf->FlatColor.s.alpha = 0xcc;return PF_Translucent;
|
case tr_trans20 : pSurf->FlatColor.s.alpha = 0xcc;return PF_Translucent;
|
||||||
case tr_trans30 : pSurf->FlatColor.s.alpha = 0xb3;return PF_Translucent;
|
case tr_trans30 : pSurf->FlatColor.s.alpha = 0xb3;return PF_Translucent;
|
||||||
|
@ -1842,7 +1843,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
||||||
blendmode = PF_Translucent;
|
blendmode = PF_Translucent;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (gr_linedef->alpha > 0 && gr_linedef->alpha < FRACUNIT)
|
if (gr_linedef->alpha >= 0 && gr_linedef->alpha < FRACUNIT)
|
||||||
blendmode = HWR_TranstableToAlpha(R_GetLinedefTransTable(gr_linedef->alpha), &Surf);
|
blendmode = HWR_TranstableToAlpha(R_GetLinedefTransTable(gr_linedef->alpha), &Surf);
|
||||||
else
|
else
|
||||||
blendmode = PF_Masked;
|
blendmode = PF_Masked;
|
||||||
|
|
|
@ -960,8 +960,6 @@ static void P_InitializeLinedef(line_t *ld)
|
||||||
ld->dx = v2->x - v1->x;
|
ld->dx = v2->x - v1->x;
|
||||||
ld->dy = v2->y - v1->y;
|
ld->dy = v2->y - v1->y;
|
||||||
|
|
||||||
ld->alpha = FRACUNIT;
|
|
||||||
|
|
||||||
ld->bbox[BOXLEFT] = min(v1->x, v2->x);
|
ld->bbox[BOXLEFT] = min(v1->x, v2->x);
|
||||||
ld->bbox[BOXRIGHT] = max(v1->x, v2->x);
|
ld->bbox[BOXRIGHT] = max(v1->x, v2->x);
|
||||||
ld->bbox[BOXBOTTOM] = min(v1->y, v2->y);
|
ld->bbox[BOXBOTTOM] = min(v1->y, v2->y);
|
||||||
|
@ -1059,6 +1057,7 @@ static void P_LoadLinedefs(UINT8 *data)
|
||||||
ld->tag = SHORT(mld->tag);
|
ld->tag = SHORT(mld->tag);
|
||||||
memset(ld->args, 0, NUMLINEARGS*sizeof(*ld->args));
|
memset(ld->args, 0, NUMLINEARGS*sizeof(*ld->args));
|
||||||
memset(ld->stringargs, 0x00, NUMLINESTRINGARGS*sizeof(*ld->stringargs));
|
memset(ld->stringargs, 0x00, NUMLINESTRINGARGS*sizeof(*ld->stringargs));
|
||||||
|
ld->alpha = FRACUNIT;
|
||||||
P_SetLinedefV1(i, SHORT(mld->v1));
|
P_SetLinedefV1(i, SHORT(mld->v1));
|
||||||
P_SetLinedefV2(i, SHORT(mld->v2));
|
P_SetLinedefV2(i, SHORT(mld->v2));
|
||||||
|
|
||||||
|
@ -1654,6 +1653,7 @@ static void P_LoadTextmap(void)
|
||||||
ld->tag = 0;
|
ld->tag = 0;
|
||||||
memset(ld->args, 0, NUMLINEARGS*sizeof(*ld->args));
|
memset(ld->args, 0, NUMLINEARGS*sizeof(*ld->args));
|
||||||
memset(ld->stringargs, 0x00, NUMLINESTRINGARGS*sizeof(*ld->stringargs));
|
memset(ld->stringargs, 0x00, NUMLINESTRINGARGS*sizeof(*ld->stringargs));
|
||||||
|
ld->alpha = FRACUNIT;
|
||||||
ld->sidenum[0] = 0xffff;
|
ld->sidenum[0] = 0xffff;
|
||||||
ld->sidenum[1] = 0xffff;
|
ld->sidenum[1] = 0xffff;
|
||||||
|
|
||||||
|
|
|
@ -337,6 +337,9 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
windowbottom = windowtop = sprbotscreen = INT32_MAX;
|
windowbottom = windowtop = sprbotscreen = INT32_MAX;
|
||||||
|
|
||||||
ldef = curline->linedef;
|
ldef = curline->linedef;
|
||||||
|
if (!ldef->alpha)
|
||||||
|
return;
|
||||||
|
|
||||||
if (ldef->alpha > 0 && ldef->alpha < FRACUNIT)
|
if (ldef->alpha > 0 && ldef->alpha < FRACUNIT)
|
||||||
{
|
{
|
||||||
dc_transmap = transtables + ((R_GetLinedefTransTable(ldef->alpha) - 1) << FF_TRANSSHIFT);
|
dc_transmap = transtables + ((R_GetLinedefTransTable(ldef->alpha) - 1) << FF_TRANSSHIFT);
|
||||||
|
|
Loading…
Reference in a new issue