The Camera is always noclip, why does it slide traverse
This commit is contained in:
parent
f58ed92bd0
commit
c61c117168
3 changed files with 0 additions and 102 deletions
|
|
@ -167,7 +167,6 @@ extern fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS], t_cam_height[MAXSPLITSCREENPLA
|
|||
void P_AddPlayerScore(player_t *player, UINT32 amount);
|
||||
void P_ResetCamera(player_t *player, camera_t *thiscam);
|
||||
boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam);
|
||||
void P_SlideCameraMove(camera_t *thiscam);
|
||||
void P_DemoCameraMovement(camera_t *cam, UINT8 num);
|
||||
void P_ToggleDemoCamera(UINT8 viewnum);
|
||||
boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled);
|
||||
|
|
|
|||
99
src/p_map.c
99
src/p_map.c
|
|
@ -3382,105 +3382,6 @@ static boolean PTR_SlideTraverse(intercept_t *in)
|
|||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// P_SlideCameraMove
|
||||
//
|
||||
// Tries to slide the camera along a wall.
|
||||
//
|
||||
void P_SlideCameraMove(camera_t *thiscam)
|
||||
{
|
||||
fixed_t leadx, leady, trailx, traily, newx, newy;
|
||||
INT32 hitcount = 0;
|
||||
INT32 retval = 0;
|
||||
|
||||
bestslideline = NULL;
|
||||
|
||||
retry:
|
||||
if (++hitcount == 3)
|
||||
goto stairstep; // don't loop forever
|
||||
|
||||
// trace along the three leading corners
|
||||
if (thiscam->momx > 0)
|
||||
{
|
||||
leadx = thiscam->x + thiscam->radius;
|
||||
trailx = thiscam->x - thiscam->radius;
|
||||
}
|
||||
else
|
||||
{
|
||||
leadx = thiscam->x - thiscam->radius;
|
||||
trailx = thiscam->x + thiscam->radius;
|
||||
}
|
||||
|
||||
if (thiscam->momy > 0)
|
||||
{
|
||||
leady = thiscam->y + thiscam->radius;
|
||||
traily = thiscam->y - thiscam->radius;
|
||||
}
|
||||
else
|
||||
{
|
||||
leady = thiscam->y - thiscam->radius;
|
||||
traily = thiscam->y + thiscam->radius;
|
||||
}
|
||||
|
||||
bestslidefrac = FRACUNIT+1;
|
||||
|
||||
mapcampointer = thiscam;
|
||||
|
||||
P_PathTraverse(leadx, leady, leadx + thiscam->momx, leady + thiscam->momy,
|
||||
PT_ADDLINES, PTR_SlideCameraTraverse);
|
||||
P_PathTraverse(trailx, leady, trailx + thiscam->momx, leady + thiscam->momy,
|
||||
PT_ADDLINES, PTR_SlideCameraTraverse);
|
||||
P_PathTraverse(leadx, traily, leadx + thiscam->momx, traily + thiscam->momy,
|
||||
PT_ADDLINES, PTR_SlideCameraTraverse);
|
||||
|
||||
// move up to the wall
|
||||
if (bestslidefrac == FRACUNIT+1)
|
||||
{
|
||||
retval = P_TryCameraMove(thiscam->x, thiscam->y + thiscam->momy, thiscam);
|
||||
// the move must have hit the middle, so stairstep
|
||||
stairstep:
|
||||
if (!retval) // Allow things to drop off.
|
||||
P_TryCameraMove(thiscam->x + thiscam->momx, thiscam->y, thiscam);
|
||||
return;
|
||||
}
|
||||
|
||||
// fudge a bit to make sure it doesn't hit
|
||||
bestslidefrac -= 0x800;
|
||||
if (bestslidefrac > 0)
|
||||
{
|
||||
newx = FixedMul(thiscam->momx, bestslidefrac);
|
||||
newy = FixedMul(thiscam->momy, bestslidefrac);
|
||||
|
||||
retval = P_TryCameraMove(thiscam->x + newx, thiscam->y + newy, thiscam);
|
||||
|
||||
if (!retval)
|
||||
goto stairstep;
|
||||
}
|
||||
|
||||
// Now continue along the wall.
|
||||
// First calculate remainder.
|
||||
bestslidefrac = FRACUNIT - (bestslidefrac+0x800);
|
||||
|
||||
if (bestslidefrac > FRACUNIT)
|
||||
bestslidefrac = FRACUNIT;
|
||||
|
||||
if (bestslidefrac <= 0)
|
||||
return;
|
||||
|
||||
tmxmove = FixedMul(thiscam->momx, bestslidefrac);
|
||||
tmymove = FixedMul(thiscam->momy, bestslidefrac);
|
||||
|
||||
P_HitCameraSlideLine(bestslideline, thiscam); // clip the moves
|
||||
|
||||
thiscam->momx = tmxmove;
|
||||
thiscam->momy = tmymove;
|
||||
|
||||
retval = P_TryCameraMove(thiscam->x + tmxmove, thiscam->y + tmymove, thiscam);
|
||||
|
||||
if (!retval)
|
||||
goto retry;
|
||||
}
|
||||
|
||||
static void P_CheckLavaWall(mobj_t *mo, sector_t *sec)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
|
|
|
|||
|
|
@ -3642,8 +3642,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
|||
{
|
||||
fixed_t camspeed = P_AproxDistance(thiscam->momx, thiscam->momy);
|
||||
|
||||
P_SlideCameraMove(thiscam);
|
||||
|
||||
if (!resetcalled && P_AproxDistance(thiscam->momx, thiscam->momy) == camspeed)
|
||||
{
|
||||
P_ResetCamera(player, thiscam);
|
||||
|
|
|
|||
Loading…
Reference in a new issue