mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Revert "Fix various things that used NUMTRANSMAPS for the number of translucent trans maps"
This reverts commit dc453fbbda.
This commit is contained in:
parent
69f32bfcaf
commit
a585d3c9d1
9 changed files with 30 additions and 32 deletions
|
|
@ -11148,7 +11148,6 @@ struct {
|
||||||
{"tr_trans70",tr_trans70},
|
{"tr_trans70",tr_trans70},
|
||||||
{"tr_trans80",tr_trans80},
|
{"tr_trans80",tr_trans80},
|
||||||
{"tr_trans90",tr_trans90},
|
{"tr_trans90",tr_trans90},
|
||||||
{"NUMTRANSLUCENTTRANSMAPS",NUMTRANSLUCENTTRANSMAPS},
|
|
||||||
{"tr_transadd",tr_transadd},
|
{"tr_transadd",tr_transadd},
|
||||||
{"tr_transsub",tr_transsub},
|
{"tr_transsub",tr_transsub},
|
||||||
{"NUMTRANSMAPS",NUMTRANSMAPS},
|
{"NUMTRANSMAPS",NUMTRANSMAPS},
|
||||||
|
|
|
||||||
|
|
@ -1934,7 +1934,7 @@ void HU_DrawSongCredits(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cursongcredit.trans < NUMTRANSLUCENTTRANSMAPS)
|
if (cursongcredit.trans < NUMTRANSMAPS)
|
||||||
cursongcredit.trans++;
|
cursongcredit.trans++;
|
||||||
if (cursongcredit.x > 0)
|
if (cursongcredit.x > 0)
|
||||||
cursongcredit.x /= 2;
|
cursongcredit.x /= 2;
|
||||||
|
|
@ -1942,10 +1942,10 @@ void HU_DrawSongCredits(void)
|
||||||
cursongcredit.x = 0;
|
cursongcredit.x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bgt = (NUMTRANSLUCENTTRANSMAPS/2)+(cursongcredit.trans/2);
|
bgt = (NUMTRANSMAPS/2)+(cursongcredit.trans/2);
|
||||||
if (bgt < NUMTRANSLUCENTTRANSMAPS)
|
if (bgt < NUMTRANSMAPS)
|
||||||
V_DrawScaledPatch(cursongcredit.x, y-2, V_SNAPTOLEFT|(bgt<<V_ALPHASHIFT), songcreditbg);
|
V_DrawScaledPatch(cursongcredit.x, y-2, V_SNAPTOLEFT|(bgt<<V_ALPHASHIFT), songcreditbg);
|
||||||
if (cursongcredit.trans < NUMTRANSLUCENTTRANSMAPS)
|
if (cursongcredit.trans < NUMTRANSMAPS)
|
||||||
V_DrawRightAlignedThinString(cursongcredit.x, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans<<V_ALPHASHIFT), str);
|
V_DrawRightAlignedThinString(cursongcredit.x, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans<<V_ALPHASHIFT), str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -419,10 +419,10 @@ void K_RunBattleOvertime(void)
|
||||||
if (!splitscreen && players[displayplayers[0]].mo)
|
if (!splitscreen && players[displayplayers[0]].mo)
|
||||||
{
|
{
|
||||||
INT32 dist = P_AproxDistance(battleovertime.x-players[displayplayers[0]].mo->x, battleovertime.y-players[displayplayers[0]].mo->y);
|
INT32 dist = P_AproxDistance(battleovertime.x-players[displayplayers[0]].mo->x, battleovertime.y-players[displayplayers[0]].mo->y);
|
||||||
transparency = max(0, NUMTRANSLUCENTTRANSMAPS - ((256 + (dist>>FRACBITS)) / 256));
|
transparency = max(0, NUMTRANSMAPS - ((256 + (dist>>FRACBITS)) / 256));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transparency < NUMTRANSLUCENTTRANSMAPS)
|
if (transparency < NUMTRANSMAPS)
|
||||||
{
|
{
|
||||||
mobj_t *beam = P_SpawnMobj(battleovertime.x, battleovertime.y, battleovertime.z + (mobjinfo[MT_RANDOMITEM].height/2), MT_OVERTIMEBEAM);
|
mobj_t *beam = P_SpawnMobj(battleovertime.x, battleovertime.y, battleovertime.z + (mobjinfo[MT_RANDOMITEM].height/2), MT_OVERTIMEBEAM);
|
||||||
P_SetScale(beam, beam->scale*2);
|
P_SetScale(beam, beam->scale*2);
|
||||||
|
|
|
||||||
18
src/p_mobj.c
18
src/p_mobj.c
|
|
@ -6674,12 +6674,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
||||||
const angle_t off = FixedAngle(40*FRACUNIT);
|
const angle_t off = FixedAngle(40*FRACUNIT);
|
||||||
angle_t ang = mobj->target->angle;
|
angle_t ang = mobj->target->angle;
|
||||||
fixed_t z;
|
fixed_t z;
|
||||||
UINT8 trans = (mobj->target->player->kartstuff[k_tiregrease] * (NUMTRANSLUCENTTRANSMAPS+1)) / greasetics;
|
UINT8 trans = (mobj->target->player->kartstuff[k_tiregrease] * (NUMTRANSMAPS+1)) / greasetics;
|
||||||
|
|
||||||
if (trans > NUMTRANSLUCENTTRANSMAPS)
|
if (trans > NUMTRANSMAPS)
|
||||||
trans = NUMTRANSLUCENTTRANSMAPS;
|
trans = NUMTRANSMAPS;
|
||||||
|
|
||||||
trans = NUMTRANSLUCENTTRANSMAPS - trans;
|
trans = NUMTRANSMAPS - trans;
|
||||||
|
|
||||||
z = mobj->target->z;
|
z = mobj->target->z;
|
||||||
if (mobj->eflags & MFE_VERTICALFLIP)
|
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||||
|
|
@ -6702,7 +6702,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
||||||
if (leveltime & 1)
|
if (leveltime & 1)
|
||||||
mobj->drawflags |= MFD_DONTDRAW;
|
mobj->drawflags |= MFD_DONTDRAW;
|
||||||
|
|
||||||
if (trans >= NUMTRANSLUCENTTRANSMAPS)
|
if (trans >= NUMTRANSMAPS)
|
||||||
mobj->drawflags |= MFD_DONTDRAW;
|
mobj->drawflags |= MFD_DONTDRAW;
|
||||||
else if (trans == 0)
|
else if (trans == 0)
|
||||||
mobj->drawflags = (mobj->drawflags & ~MFD_TRANSMASK);
|
mobj->drawflags = (mobj->drawflags & ~MFD_TRANSMASK);
|
||||||
|
|
@ -8437,15 +8437,15 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
if (mobj->flags2 & MF2_BOSSNOTRAP) // "fast" flag
|
if (mobj->flags2 & MF2_BOSSNOTRAP) // "fast" flag
|
||||||
{
|
{
|
||||||
if ((signed)((mobj->frame & FF_TRANSMASK) >> FF_TRANSSHIFT) < (NUMTRANSLUCENTTRANSMAPS-1) - (2*mobj->fuse)/3)
|
if ((signed)((mobj->frame & FF_TRANSMASK) >> FF_TRANSSHIFT) < (NUMTRANSMAPS-1) - (2*mobj->fuse)/3)
|
||||||
// fade out when nearing the end of fuse...
|
// fade out when nearing the end of fuse...
|
||||||
mobj->frame = (mobj->frame & ~FF_TRANSMASK) | (((NUMTRANSLUCENTTRANSMAPS-1) - (2*mobj->fuse)/3) << FF_TRANSSHIFT);
|
mobj->frame = (mobj->frame & ~FF_TRANSMASK) | (((NUMTRANSMAPS-1) - (2*mobj->fuse)/3) << FF_TRANSSHIFT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((signed)((mobj->frame & FF_TRANSMASK) >> FF_TRANSSHIFT) < (NUMTRANSLUCENTTRANSMAPS-1) - mobj->fuse / 2)
|
if ((signed)((mobj->frame & FF_TRANSMASK) >> FF_TRANSSHIFT) < (NUMTRANSMAPS-1) - mobj->fuse / 2)
|
||||||
// fade out when nearing the end of fuse...
|
// fade out when nearing the end of fuse...
|
||||||
mobj->frame = (mobj->frame & ~FF_TRANSMASK) | (((NUMTRANSLUCENTTRANSMAPS-1) - mobj->fuse / 2) << FF_TRANSSHIFT);
|
mobj->frame = (mobj->frame & ~FF_TRANSMASK) | (((NUMTRANSMAPS-1) - mobj->fuse / 2) << FF_TRANSSHIFT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2515,7 +2515,7 @@ void T_PolyObjFade(polyfade_t *th)
|
||||||
|
|
||||||
if (th->timer <= 0)
|
if (th->timer <= 0)
|
||||||
{
|
{
|
||||||
po->translucency = max(min(th->destvalue, NUMTRANSLUCENTTRANSMAPS), 0);
|
po->translucency = max(min(th->destvalue, NUMTRANSMAPS), 0);
|
||||||
|
|
||||||
// remove thinker
|
// remove thinker
|
||||||
if (po->thinker == &th->thinker)
|
if (po->thinker == &th->thinker)
|
||||||
|
|
@ -2526,8 +2526,8 @@ void T_PolyObjFade(polyfade_t *th)
|
||||||
{
|
{
|
||||||
INT16 delta = abs(th->destvalue - th->sourcevalue);
|
INT16 delta = abs(th->destvalue - th->sourcevalue);
|
||||||
INT32 duration = th->ticbased ? th->duration
|
INT32 duration = th->ticbased ? th->duration
|
||||||
: abs(FixedMul(FixedDiv(256, NUMTRANSLUCENTTRANSMAPS), NUMTRANSLUCENTTRANSMAPS - th->destvalue)
|
: abs(FixedMul(FixedDiv(256, NUMTRANSMAPS), NUMTRANSMAPS - th->destvalue)
|
||||||
- FixedMul(FixedDiv(256, NUMTRANSLUCENTTRANSMAPS), NUMTRANSLUCENTTRANSMAPS - th->sourcevalue)); // speed-based internal counter duration: delta in 256 scale
|
- FixedMul(FixedDiv(256, NUMTRANSMAPS), NUMTRANSMAPS - th->sourcevalue)); // speed-based internal counter duration: delta in 256 scale
|
||||||
fixed_t factor = min(FixedDiv(duration - th->timer, duration), 1*FRACUNIT);
|
fixed_t factor = min(FixedDiv(duration - th->timer, duration), 1*FRACUNIT);
|
||||||
if (th->destvalue < th->sourcevalue)
|
if (th->destvalue < th->sourcevalue)
|
||||||
po->translucency = max(min(po->translucency, th->sourcevalue - (INT16)FixedMul(delta, factor)), th->destvalue);
|
po->translucency = max(min(po->translucency, th->sourcevalue - (INT16)FixedMul(delta, factor)), th->destvalue);
|
||||||
|
|
@ -2538,7 +2538,7 @@ void T_PolyObjFade(polyfade_t *th)
|
||||||
if (!stillfading)
|
if (!stillfading)
|
||||||
{
|
{
|
||||||
// set render flags
|
// set render flags
|
||||||
if (po->translucency >= NUMTRANSLUCENTTRANSMAPS) // invisible
|
if (po->translucency >= NUMTRANSMAPS) // invisible
|
||||||
po->flags &= ~POF_RENDERALL;
|
po->flags &= ~POF_RENDERALL;
|
||||||
else
|
else
|
||||||
po->flags |= (po->spawnflags & POF_RENDERALL);
|
po->flags |= (po->spawnflags & POF_RENDERALL);
|
||||||
|
|
@ -2561,8 +2561,8 @@ void T_PolyObjFade(polyfade_t *th)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (po->translucency >= NUMTRANSLUCENTTRANSMAPS)
|
if (po->translucency >= NUMTRANSMAPS)
|
||||||
// HACK: OpenGL renders add/sub.opaque when >= NUMTRANSLUCENTTRANSMAPS
|
// HACK: OpenGL renders fully opaque when >= NUMTRANSMAPS
|
||||||
po->translucency = tr_trans90;
|
po->translucency = tr_trans90;
|
||||||
|
|
||||||
po->flags |= (po->spawnflags & POF_RENDERALL);
|
po->flags |= (po->spawnflags & POF_RENDERALL);
|
||||||
|
|
@ -2630,8 +2630,8 @@ boolean EV_DoPolyObjFade(polyfadedata_t *pfdata)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
th->ticbased = false;
|
th->ticbased = false;
|
||||||
th->timer = abs(FixedMul(FixedDiv(256, NUMTRANSLUCENTTRANSMAPS), NUMTRANSLUCENTTRANSMAPS - th->destvalue)
|
th->timer = abs(FixedMul(FixedDiv(256, NUMTRANSMAPS), NUMTRANSMAPS - th->destvalue)
|
||||||
- FixedMul(FixedDiv(256, NUMTRANSLUCENTTRANSMAPS), NUMTRANSLUCENTTRANSMAPS - th->sourcevalue)); // delta converted to 256 scale, use as internal counter
|
- FixedMul(FixedDiv(256, NUMTRANSMAPS), NUMTRANSMAPS - th->sourcevalue)); // delta converted to 256 scale, use as internal counter
|
||||||
th->duration = abs(pfdata->speed); // use th->duration as speed decrement
|
th->duration = abs(pfdata->speed); // use th->duration as speed decrement
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,7 @@ typedef enum
|
||||||
tr_trans70,
|
tr_trans70,
|
||||||
tr_trans80,
|
tr_trans80,
|
||||||
tr_trans90,
|
tr_trans90,
|
||||||
NUMTRANSLUCENTTRANSMAPS,
|
tr_transadd,
|
||||||
tr_transadd = NUMTRANSLUCENTTRANSMAPS,
|
|
||||||
tr_transsub,
|
tr_transsub,
|
||||||
NUMTRANSMAPS
|
NUMTRANSMAPS
|
||||||
} transnum_t;
|
} transnum_t;
|
||||||
|
|
|
||||||
|
|
@ -3381,7 +3381,7 @@ static void P_InitLevelSettings(void)
|
||||||
|
|
||||||
// song credit init
|
// song credit init
|
||||||
memset(&cursongcredit,0,sizeof(struct cursongcredit));
|
memset(&cursongcredit,0,sizeof(struct cursongcredit));
|
||||||
cursongcredit.trans = NUMTRANSLUCENTTRANSMAPS;
|
cursongcredit.trans = NUMTRANSMAPS;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1257,7 +1257,7 @@ static boolean PolyFade(line_t *line)
|
||||||
else
|
else
|
||||||
pfd.destvalue = value;
|
pfd.destvalue = value;
|
||||||
|
|
||||||
pfd.destvalue = max(min(pfd.destvalue, NUMTRANSLUCENTTRANSMAPS), 0);
|
pfd.destvalue = max(min(pfd.destvalue, NUMTRANSMAPS), 0);
|
||||||
|
|
||||||
// already equal, nothing to do
|
// already equal, nothing to do
|
||||||
if (po->translucency == pfd.destvalue)
|
if (po->translucency == pfd.destvalue)
|
||||||
|
|
|
||||||
|
|
@ -1800,7 +1800,7 @@ void S_ShowMusicCredit(void)
|
||||||
cursongcredit.def = def;
|
cursongcredit.def = def;
|
||||||
cursongcredit.anim = 5*TICRATE;
|
cursongcredit.anim = 5*TICRATE;
|
||||||
cursongcredit.x = 0;
|
cursongcredit.x = 0;
|
||||||
cursongcredit.trans = NUMTRANSLUCENTTRANSMAPS;
|
cursongcredit.trans = NUMTRANSMAPS;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue