- floatified p_trace, p_slopes and p_udmf.cpp.

- major cleanup of unused code.
This commit is contained in:
Christoph Oelckers 2016-03-30 16:30:22 +02:00
commit 66929cbaff
35 changed files with 350 additions and 529 deletions

View file

@ -105,6 +105,7 @@ fixed_t viewx;
fixed_t viewy;
fixed_t viewz;
int viewpitch;
angle_t viewangle;
extern "C"
{
@ -117,7 +118,6 @@ extern "C"
int otic;
angle_t viewangle;
sector_t *viewsector;
fixed_t viewcos, viewtancos;
@ -619,7 +619,7 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
DVector3a &end = InterpolationPath[i];
pathlen += FLOAT2FIXED((end.pos-start.pos).Length());
totalzdiff += FLOAT2FIXED(start.pos.Z);
totaladiff += FLOAT2ANGLE(start.angle.Degrees);
totaladiff += start.angle.BAMs();
}
fixed_t interpolatedlen = FixedMul(frac, pathlen);
@ -629,7 +629,7 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
DVector3a &end = InterpolationPath[i];
fixed_t fraglen = FLOAT2FIXED((end.pos - start.pos).Length());
zdiff += FLOAT2FIXED(start.pos.Z);
adiff += FLOAT2ANGLE(start.angle.Degrees);
adiff += start.angle.BAMs();
if (fraglen <= interpolatedlen)
{
interpolatedlen -= fraglen;
@ -683,11 +683,11 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
if (viewpitch > INT_MAX - delta)
{
viewpitch = FLOAT2ANGLE(player->MaxPitch.Degrees);
viewpitch = player->MaxPitch.BAMs();
}
else
{
viewpitch = MIN<int>(viewpitch + delta, FLOAT2ANGLE(player->MaxPitch.Degrees));
viewpitch = MIN<int>(viewpitch + delta, player->MaxPitch.BAMs());
}
}
else if (delta < 0)
@ -695,11 +695,11 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
if (viewpitch < INT_MIN - delta)
{
viewpitch = FLOAT2ANGLE(player->MinPitch.Degrees);
viewpitch = player->MinPitch.BAMs();
}
else
{
viewpitch = MAX<int>(viewpitch + delta, FLOAT2ANGLE(player->MinPitch.Degrees));
viewpitch = MAX<int>(viewpitch + delta, player->MinPitch.BAMs());
}
}
}
@ -994,13 +994,13 @@ void R_SetupFrame (AActor *actor)
viewsector = camera->Sector;
r_showviewer = false;
}
iview->nviewpitch = camera->_f_pitch();
iview->nviewpitch = camera->Angles.Pitch.BAMs();
if (camera->player != 0)
{
player = camera->player;
}
iview->nviewangle = camera->_f_angle();
iview->nviewangle = camera->Angles.Yaw.BAMs();
if (iview->otic == -1 || r_NoInterpolate)
{
R_ResetViewInterpolation ();