add maxinterpdist to shadows

This commit is contained in:
Alug committed 2024-06-02 22:15:28 +02:00
1 parent b8ecaf336c
commit 7696b115ae
2 files changed
+17 -5

No files matched your search

+5 -3
View File
@@ -3625,6 +3625,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
UINT8 i;
SINT8 flip = P_MobjFlip(thing);
UINT8 lightlevel = 0;
INT32 dist = -1;
fixed_t scalemul;
fixed_t floordiff;
@@ -3635,8 +3636,11 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
// uncapped/interpolation
interpmobjstate_t interp = {0};
if (cv_grmaxinterpdist.value)
dist = R_QuickCamDist(thing->x, thing->y);
// do interpolation
if (R_UsingFrameInterpolation() && !paused)
if (R_UsingFrameInterpolation() && !paused && (!cv_grmaxinterpdist.value || dist < cv_grmaxinterpdist.value))
{
R_InterpolateMobjState(thing, rendertimefrac, &interp);
}
@@ -3650,8 +3654,6 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
else
groundz = interp.floorz;
//if (abs(groundz - gr_viewz) / tz > 4) return; // Prevent stretchy shadows and possible crashes
floordiff = abs((flip < 0 ? thing->height : 0) + interp.z - groundz);
if (thing->whiteshadow)
+12 -2
View File
@@ -1092,11 +1092,16 @@ fixed_t R_GetShadowZ(
msecnode_t *node;
sector_t *sector;
ffloor_t *rover;
INT32 dist = -1;
// for frame interpolation
interpmobjstate_t interp = {0};
if (R_UsingFrameInterpolation() && !paused)
if (cv_grmaxinterpdist.value)
dist = R_QuickCamDist(thing->x, thing->y);
// do interpolation
if (R_UsingFrameInterpolation() && !paused && (!cv_grmaxinterpdist.value || dist < cv_grmaxinterpdist.value))
{
R_InterpolateMobjState(thing, rendertimefrac, &interp);
}
@@ -1205,13 +1210,18 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t tx, fix
fixed_t groundz;
pslope_t *groundslope;
boolean isflipped = thing->eflags & MFE_VERTICALFLIP;
INT32 dist = -1;
interpmobjstate_t interp = {0};
groundz = R_GetShadowZ(thing, &groundslope);
if (abs(groundz-viewz)/tz > 4) return; // Prevent stretchy shadows and possible crashes
if (R_UsingFrameInterpolation() && !paused)
if (cv_grmaxinterpdist.value)
dist = R_QuickCamDist(thing->x, thing->y);
// do interpolation
if (R_UsingFrameInterpolation() && !paused && (!cv_grmaxinterpdist.value || dist < cv_grmaxinterpdist.value))
{
R_InterpolateMobjState(thing, rendertimefrac, &interp);
}