dont apply player camfade when exiting or in freecam mode

also renames it and moves the check outside
This commit is contained in:
Alug committed 2025-07-15 14:00:46 +02:00
1 parent 7d6e210625
commit 2e4fb32dac
4 files changed
+12 -7

No files matched your search

+4 -2
View File
@@ -3732,7 +3732,8 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
}
Surf.PolyColor.s.alpha = FixedMul(R_GetThingFade(spr->mobj), Surf.PolyColor.s.alpha);
if (cv_playerfade.value && spr->mobj->player)
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
if (HWR_UseShader())
{
@@ -4020,7 +4021,8 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
}
Surf.PolyColor.s.alpha = FixedMul(R_GetThingFade(spr->mobj), Surf.PolyColor.s.alpha);
if (cv_playerfade.value && spr->mobj->player)
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
if (HWR_UseShader())
{
+2 -1
View File
@@ -1227,7 +1227,8 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode);
}
Surf.PolyColor.s.alpha = FixedMul(R_GetThingFade(spr->mobj), Surf.PolyColor.s.alpha);
if (cv_playerfade.value && spr->mobj->player)
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
// dont forget to enabled the depth test because we can't do this like
// before: polygons models are not sorted
+5 -3
View File
@@ -1603,7 +1603,8 @@ static void R_ProjectSprite(mobj_t *thing)
else
trans = 0;
trans = static_cast<INT32>(R_GetThingTransTable(R_GetThingFade(oldthing), static_cast<transnum_t>(trans)));
if (cv_playerfade.value && oldthing->player)
trans = static_cast<INT32>(R_GetThingTransTable(R_DoPlayerFade(oldthing), static_cast<transnum_t>(trans)));
//SoM: 3/17/2000: Disregard sprites that are out of view..
if (vflip)
@@ -2940,11 +2941,12 @@ boolean R_ThingWithinDist(mobj_t *thing, INT32 limit_dist)
return true;
}
fixed_t R_GetThingFade(mobj_t *thing)
fixed_t R_DoPlayerFade(mobj_t *thing)
{
fixed_t fadealpha = FRACUNIT;
static constexpr tic_t countdownstarttime = (15 * TICRATE) / 4; // starttime - (3*TICRATE)
if (!cv_playerfade.value || leveltime < starttime-(3*TICRATE) || !thing->player || thing->player == viewplayer)
if (thing->player == viewplayer || viewplayer->exiting || camera[R_GetViewNumber()].freecam || leveltime < countdownstarttime)
return fadealpha;
const INT32 playerdist = (FixedMul((thing->x - viewx), viewcos) + FixedMul((thing->y - viewy), viewsin)) >> FRACBITS;
+1 -1
View File
@@ -92,7 +92,7 @@ transnum_t R_GetThingTransTable(fixed_t alpha, transnum_t transmap);
boolean R_ThingVisible(mobj_t *thing);
boolean R_ThingWithinDist(mobj_t *thing, INT32 limit_dist);
boolean R_CheckInterpDist(mobj_t *thing);
fixed_t R_GetThingFade(mobj_t *thing);
fixed_t R_DoPlayerFade(mobj_t *thing);
boolean R_ThingIsFullBright(mobj_t *thing);
boolean R_ThingIsSemiBright(mobj_t *thing);