- gameinput.h: Remove precise bool from `horizsumfrac()`, `look_anghalf()` and `looking_arc()` added in a4895cb270.

* It looks terrible to have low precision math versions of look_anghalf and looking_arc since we always interpolate `look_ang` now, so lets just not.
This commit is contained in:
Mitchell Richters 2021-04-20 21:12:17 +10:00
parent ccdf9d13f1
commit d34070b8ae
9 changed files with 20 additions and 20 deletions

View File

@ -94,9 +94,9 @@ struct PlayerHorizon
return q16horiz(interpolatedvalue(osum().asq16(), sum().asq16(), smoothratio));
}
double horizsumfrac(bool const precise, double const smoothratio)
double horizsumfrac(double const smoothratio)
{
return !precise ? sum().asq16() >> 20 : (!SyncInput() ? sum() : interpolatedsum(smoothratio)).asbuildf() * (1. / 16.); // Used within draw code for Duke.
return (!SyncInput() ? sum() : interpolatedsum(smoothratio)).asbuildf() * (1. / 16.); // Used within draw code for Duke.
}
void sethorizon(float const horz, ESyncBits* actions, double const scaleAdjust = 1);
@ -229,14 +229,14 @@ struct PlayerAngle
return interpolatedangle(orotscrnang, rotscrnang, smoothratio);
}
double look_anghalf(bool const precise, double const smoothratio)
double look_anghalf(double const smoothratio)
{
return !precise ? look_ang.signedbam() >> 22 : (!SyncInput() ? look_ang : interpolatedlookang(smoothratio)).signedbuildf() * 0.5; // Used within draw code for weapon and crosshair when looking left/right.
return (!SyncInput() ? look_ang : interpolatedlookang(smoothratio)).signedbuildf() * 0.5; // Used within draw code for weapon and crosshair when looking left/right.
}
double looking_arc(bool const precise, double const smoothratio)
double looking_arc(double const smoothratio)
{
return !precise ? abs(look_ang.signedbuild()) / 9 : fabs((!SyncInput() ? look_ang : interpolatedlookang(smoothratio)).signedbuildf()) * (1. / 9.); // Used within draw code for weapon and crosshair when looking left/right.
return fabs((!SyncInput() ? look_ang : interpolatedlookang(smoothratio)).signedbuildf()) * (1. / 9.); // Used within draw code for weapon and crosshair when looking left/right.
}
void applylook(float const avel, ESyncBits* actions, double const scaleAdjust = 1);

View File

@ -91,13 +91,13 @@ static void viewBurnTime(int gScale)
void hudDraw(PLAYER *gView, int nSectnum, double bobx, double boby, double zDelta, int basepal, double smoothratio)
{
double look_anghalf = gView->angle.look_anghalf(cl_hudinterpolation, smoothratio);
double look_anghalf = gView->angle.look_anghalf(smoothratio);
DrawCrosshair(kCrosshairTile, gView->pXSprite->health >> 4, -look_anghalf, 0, 2);
if (gViewPos == 0)
{
double looking_arc = gView->angle.looking_arc(cl_hudinterpolation, smoothratio);
double looking_arc = gView->angle.looking_arc(smoothratio);
double cX = 160 - look_anghalf;
double cY = 220 + looking_arc;

View File

@ -293,7 +293,7 @@ void drawoverlays(double smoothratio)
if (ps[myconnectindex].newOwner == nullptr && ud.cameraactor == nullptr)
{
DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -pp->angle.look_anghalf(cl_hudinterpolation, smoothratio), pp->over_shoulder_on ? 2.5 : 0, isRR() ? 0.5 : 1);
DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -pp->angle.look_anghalf(smoothratio), pp->over_shoulder_on ? 2.5 : 0, isRR() ? 0.5 : 1);
}
if (paused == 2)

View File

@ -244,9 +244,9 @@ void displayweapon_d(int snum, double smoothratio)
}
plravel = getavel(snum) * (1. / 16.);
horiz16th = p->horizon.horizsumfrac(cl_hudinterpolation, smoothratio);
look_anghalf = p->angle.look_anghalf(cl_hudinterpolation, smoothratio);
looking_arc = p->angle.looking_arc(cl_hudinterpolation, smoothratio);
horiz16th = p->horizon.horizsumfrac(smoothratio);
look_anghalf = p->angle.look_anghalf(smoothratio);
looking_arc = p->angle.looking_arc(smoothratio);
hard_landing *= 8.;
gun_pos -= fabs(p->GetActor()->s->xrepeat < 32 ? bsinf(weapon_sway * 4., -9) : bsinf(weapon_sway * 0.5, -10));

View File

@ -133,8 +133,8 @@ void displayweapon_r(int snum, double smoothratio)
TiltStatus = p->TiltStatus;
}
look_anghalf = p->angle.look_anghalf(cl_hudinterpolation, smoothratio);
looking_arc = p->angle.looking_arc(cl_hudinterpolation, smoothratio);
look_anghalf = p->angle.look_anghalf(smoothratio);
looking_arc = p->angle.looking_arc(smoothratio);
hard_landing *= 8.;
gun_pos -= fabs(p->GetActor()->s->xrepeat < 8 ? bsinf(weapon_sway * 4., -9) : bsinf(weapon_sway * 0.5, -10));

View File

@ -93,7 +93,7 @@ void GameInterface::Render()
DrawView(smoothratio);
DrawStatusBar();
DrawCrosshair(MAXTILES, PlayerList[nLocalPlayer].nHealth >> 3, -PlayerList[nLocalPlayer].angle.look_anghalf(cl_hudinterpolation, smoothratio), 0, 1);
DrawCrosshair(MAXTILES, PlayerList[nLocalPlayer].nHealth >> 3, -PlayerList[nLocalPlayer].angle.look_anghalf(smoothratio), 0, 1);
if (paused && !M_Active())
{

View File

@ -997,8 +997,8 @@ void DrawWeapons(double smooth)
nShade = sprite[PlayerList[nLocalPlayer].nSprite].shade;
}
double const look_anghalf = PlayerList[nLocalPlayer].angle.look_anghalf(cl_hudinterpolation, smooth);
double const looking_arc = PlayerList[nLocalPlayer].angle.looking_arc(cl_hudinterpolation, smooth);
double const look_anghalf = PlayerList[nLocalPlayer].angle.look_anghalf(smooth);
double const looking_arc = PlayerList[nLocalPlayer].angle.looking_arc(smooth);
xOffset -= look_anghalf;
yOffset += looking_arc;

View File

@ -1100,7 +1100,7 @@ void DrawCrosshair(PLAYERp pp)
if (!(CameraTestMode))
{
USERp u = User[pp->PlayerSprite];
::DrawCrosshair(2326, u->Health, -pp->angle.look_anghalf(cl_hudinterpolation, smoothratio), TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE) ? 5 : 0, 2, shadeToLight(10));
::DrawCrosshair(2326, u->Health, -pp->angle.look_anghalf(smoothratio), TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE) ? 5 : 0, 2, shadeToLight(10));
}
}

View File

@ -6897,8 +6897,8 @@ pDisplaySprites(PLAYERp pp, double smoothratio)
short ang;
int flags;
double const look_anghalf = pp->angle.look_anghalf(cl_hudinterpolation, smoothratio);
double const looking_arc = pp->angle.looking_arc(cl_hudinterpolation, smoothratio);
double const look_anghalf = pp->angle.look_anghalf(smoothratio);
double const looking_arc = pp->angle.looking_arc(smoothratio);
TRAVERSE(&pp->PanelSpriteList, psp, next)
{