mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-28 23:21:58 +00:00
Merge branch 'very-lethal-lava-land' into 'next'
Only interpolate shadowcasters if they exist Closes #899 See merge request STJr/SRB2!1864
This commit is contained in:
commit
d6640391e4
1 changed files with 15 additions and 12 deletions
|
@ -5300,7 +5300,12 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
if (thing->renderflags & RF_SHADOWEFFECTS)
|
if (thing->renderflags & RF_SHADOWEFFECTS)
|
||||||
{
|
{
|
||||||
mobj_t *caster = thing->target;
|
mobj_t *caster = thing->target;
|
||||||
|
|
||||||
|
if (caster && !P_MobjWasRemoved(caster))
|
||||||
|
{
|
||||||
interpmobjstate_t casterinterp = {};
|
interpmobjstate_t casterinterp = {};
|
||||||
|
fixed_t groundz;
|
||||||
|
fixed_t floordiff;
|
||||||
|
|
||||||
if (R_UsingFrameInterpolation() && !paused)
|
if (R_UsingFrameInterpolation() && !paused)
|
||||||
{
|
{
|
||||||
|
@ -5311,10 +5316,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
R_InterpolateMobjState(caster, FRACUNIT, &casterinterp);
|
R_InterpolateMobjState(caster, FRACUNIT, &casterinterp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caster && !P_MobjWasRemoved(caster))
|
groundz = R_GetShadowZ(thing, NULL);
|
||||||
{
|
floordiff = abs(((thing->eflags & MFE_VERTICALFLIP) ? caster->height : 0) + casterinterp.z - groundz);
|
||||||
fixed_t groundz = R_GetShadowZ(thing, NULL);
|
|
||||||
fixed_t floordiff = abs(((thing->eflags & MFE_VERTICALFLIP) ? caster->height : 0) + casterinterp.z - groundz);
|
|
||||||
|
|
||||||
shadowheight = FIXED_TO_FLOAT(floordiff);
|
shadowheight = FIXED_TO_FLOAT(floordiff);
|
||||||
shadowscale = FIXED_TO_FLOAT(FixedMul(FRACUNIT - floordiff/640, casterinterp.scale));
|
shadowscale = FIXED_TO_FLOAT(FixedMul(FRACUNIT - floordiff/640, casterinterp.scale));
|
||||||
|
|
Loading…
Reference in a new issue