mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Only interpolate shadowcasters if they exist
# Conflicts: # src/hardware/hw_main.c
This commit is contained in:
parent
10660411b8
commit
ce15c47a4d
1 changed files with 15 additions and 12 deletions
|
|
@ -5362,7 +5362,12 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
if (thing->renderflags & RF_SHADOWEFFECTS)
|
||||
{
|
||||
mobj_t *caster = thing->target;
|
||||
|
||||
if (caster && !P_MobjWasRemoved(caster))
|
||||
{
|
||||
interpmobjstate_t casterinterp = {0};
|
||||
fixed_t groundz;
|
||||
fixed_t floordiff;
|
||||
|
||||
if (R_UsingFrameInterpolation() && !paused)
|
||||
{
|
||||
|
|
@ -5373,10 +5378,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
R_InterpolateMobjState(caster, FRACUNIT, &casterinterp);
|
||||
}
|
||||
|
||||
if (caster && !P_MobjWasRemoved(caster))
|
||||
{
|
||||
fixed_t groundz = R_GetShadowZ(thing, NULL);
|
||||
fixed_t floordiff = abs(((thing->eflags & MFE_VERTICALFLIP) ? caster->height : 0) + casterinterp.z - groundz);
|
||||
groundz = R_GetShadowZ(thing, NULL);
|
||||
floordiff = abs(((thing->eflags & MFE_VERTICALFLIP) ? caster->height : 0) + casterinterp.z - groundz);
|
||||
|
||||
shadowheight = FIXED_TO_FLOAT(floordiff);
|
||||
shadowscale = FIXED_TO_FLOAT(FixedMul(FRACUNIT - floordiff/640, casterinterp.scale));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue