Add R_RelativeTeleportViewInterpolation

Adjusts pview_old for relative teleport to attempt a contigious motion
This commit is contained in:
toaster 2022-10-27 13:38:13 +01:00
parent 054bbd7745
commit 2bab452268
3 changed files with 11 additions and 0 deletions

View file

@ -2395,6 +2395,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
camera[i].y += y; camera[i].y += y;
camera[i].z += z; camera[i].z += z;
camera[i].subsector = R_PointInSubsector(camera[i].x, camera[i].y); camera[i].subsector = R_PointInSubsector(camera[i].x, camera[i].y);
R_RelativeTeleportViewInterpolation(i, x, y, z, 0);
break; break;
} }
} }

View file

@ -210,6 +210,14 @@ void R_ResetViewInterpolation(UINT8 p)
} }
} }
void R_RelativeTeleportViewInterpolation(UINT8 p, fixed_t xdiff, fixed_t ydiff, fixed_t zdiff, angle_t angdiff)
{
pview_old[p].x += xdiff;
pview_old[p].y += ydiff;
pview_old[p].z += zdiff;
pview_old[p].angle += angdiff;
}
void R_SetViewContext(enum viewcontext_e _viewcontext) void R_SetViewContext(enum viewcontext_e _viewcontext)
{ {
UINT8 i = 0; UINT8 i = 0;

View file

@ -115,6 +115,8 @@ void R_InterpolateView(fixed_t frac);
void R_UpdateViewInterpolation(void); void R_UpdateViewInterpolation(void);
// Reset the view states (e.g. after level load) so R_InterpolateView doesn't interpolate invalid data // Reset the view states (e.g. after level load) so R_InterpolateView doesn't interpolate invalid data
void R_ResetViewInterpolation(UINT8 p); void R_ResetViewInterpolation(UINT8 p);
// Update old view for seamless relative teleport
void R_RelativeTeleportViewInterpolation(UINT8 p, fixed_t xdiff, fixed_t ydiff, fixed_t zdiff, angle_t angdiff);
// Set the current view context (the viewvars pointed to by newview) // Set the current view context (the viewvars pointed to by newview)
void R_SetViewContext(enum viewcontext_e _viewcontext); void R_SetViewContext(enum viewcontext_e _viewcontext);