mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Only interpolate shadowcasters if they exist
This commit is contained in:
parent
88667400ee
commit
e32b8a41e5
1 changed files with 15 additions and 12 deletions
|
@ -5300,21 +5300,24 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
if (thing->renderflags & RF_SHADOWEFFECTS)
|
||||
{
|
||||
mobj_t *caster = thing->target;
|
||||
interpmobjstate_t casterinterp = {};
|
||||
|
||||
if (R_UsingFrameInterpolation() && !paused)
|
||||
{
|
||||
R_InterpolateMobjState(caster, rendertimefrac, &casterinterp);
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
interpmobjstate_t casterinterp = {};
|
||||
fixed_t groundz;
|
||||
fixed_t floordiff;
|
||||
|
||||
if (R_UsingFrameInterpolation() && !paused)
|
||||
{
|
||||
R_InterpolateMobjState(caster, rendertimefrac, &casterinterp);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_InterpolateMobjState(caster, FRACUNIT, &casterinterp);
|
||||
}
|
||||
|
||||
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…
Reference in a new issue