mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 03:01:36 +00:00
- Use the static constexpr nullAngle
everywhere possible.
This commit is contained in:
parent
02dfe2cb62
commit
5c84f93c08
10 changed files with 20 additions and 20 deletions
|
@ -67,7 +67,7 @@ inline static void scaletozero(DAngle& object, const double value, const double
|
|||
if (auto sgn = object.Sgn())
|
||||
{
|
||||
object -= getscaledangle(value, scaleAdjust, object, push == DBL_MAX ? sgn * getPushScale(scaleAdjust) : push);
|
||||
if (sgn != object.Sgn()) object = DAngle::fromDeg(0.);
|
||||
if (sgn != object.Sgn()) object = nullAngle;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ struct PlayerAngle
|
|||
else
|
||||
{
|
||||
ang = target;
|
||||
target = DAngle::fromBam(0);
|
||||
target = nullAngle;
|
||||
}
|
||||
}
|
||||
else if (adjustment)
|
||||
|
|
|
@ -412,17 +412,17 @@ void viewUpdateDelirium(void)
|
|||
return;
|
||||
}
|
||||
gScreenTilt = gScreenTilt.Normalized180();
|
||||
if (gScreenTilt > DAngle::fromDeg(0.))
|
||||
if (gScreenTilt > nullAngle)
|
||||
{
|
||||
gScreenTilt -= DAngle::fromBuild(8);
|
||||
if (gScreenTilt < DAngle::fromDeg(0.))
|
||||
gScreenTilt = DAngle::fromDeg(0.);
|
||||
if (gScreenTilt < nullAngle)
|
||||
gScreenTilt = nullAngle;
|
||||
}
|
||||
else if (gScreenTilt < DAngle::fromDeg(0.))
|
||||
else if (gScreenTilt < nullAngle)
|
||||
{
|
||||
gScreenTilt += DAngle::fromBuild(8);
|
||||
if (gScreenTilt >= DAngle::fromDeg(0.))
|
||||
gScreenTilt = DAngle::fromDeg(0.);
|
||||
if (gScreenTilt >= nullAngle)
|
||||
gScreenTilt = nullAngle;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2255,7 +2255,7 @@ int ParseState::parse(void)
|
|||
ps[g_p].weapreccnt = 0;
|
||||
ps[g_p].ftq = 0;
|
||||
ps[g_p].vel.X = ps[g_p].vel.Y = 0;
|
||||
if (!isRR()) ps[g_p].angle.orotscrnang = ps[g_p].angle.rotscrnang = DAngle::fromDeg(0.);
|
||||
if (!isRR()) ps[g_p].angle.orotscrnang = ps[g_p].angle.rotscrnang = nullAngle;
|
||||
|
||||
ps[g_p].falling_counter = 0;
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ void resetplayerstats(int snum)
|
|||
p->holoduke_on = nullptr;
|
||||
|
||||
p->angle.olook_ang = p->angle.look_ang = DAngle::fromBuild(512 - (((~currentLevel->levelNumber) & 1) << 10));
|
||||
p->angle.orotscrnang = p->angle.rotscrnang = DAngle::fromDeg(0.);
|
||||
p->angle.orotscrnang = p->angle.rotscrnang = nullAngle;
|
||||
|
||||
p->newOwner =nullptr;
|
||||
p->jumping_counter = 0;
|
||||
|
|
|
@ -95,7 +95,7 @@ void GameInterface::UpdateCameras(double smoothratio)
|
|||
display_mirror = 1; // should really be 'display external view'.
|
||||
auto cstat = camera->spr.cstat;
|
||||
camera->spr.cstat = CSTAT_SPRITE_INVISIBLE;
|
||||
render_camtex(camera, camera->int_pos(), camera->sector(), camera->interpolatedang(smoothratio), buildhoriz(camera->spr.shade), DAngle::fromDeg(0.), tex, rect, smoothratio);
|
||||
render_camtex(camera, camera->int_pos(), camera->sector(), camera->interpolatedang(smoothratio), buildhoriz(camera->spr.shade), nullAngle, tex, rect, smoothratio);
|
||||
camera->spr.cstat = cstat;
|
||||
display_mirror = 0;
|
||||
});
|
||||
|
@ -263,7 +263,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
|
|||
auto bh = buildhoriz(act->spr.yvel);
|
||||
auto cstat = act->spr.cstat;
|
||||
act->spr.cstat = CSTAT_SPRITE_INVISIBLE;
|
||||
renderView(act, act->sector(), act->int_pos().X, act->int_pos().Y, act->int_pos().Z - (4 << 8), cang, bh, DAngle::fromDeg(0.), smoothratio, sceneonly, fov);
|
||||
renderView(act, act->sector(), act->int_pos().X, act->int_pos().Y, act->int_pos().Z - (4 << 8), cang, bh, nullAngle, smoothratio, sceneonly, fov);
|
||||
act->spr.cstat = cstat;
|
||||
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
|
|||
cposy = act->int_pos().Y;
|
||||
cposz = act->int_pos().Z;
|
||||
sect = act->sector();
|
||||
rotscrnang = DAngle::fromDeg(0.);
|
||||
rotscrnang = nullAngle;
|
||||
smoothratio = MaxSmoothRatio;
|
||||
viewer = act;
|
||||
camview = true;
|
||||
|
|
|
@ -212,7 +212,7 @@ void DrawView(double smoothRatio, bool sceneonly)
|
|||
playerZ = pActor->int_pos().Z;
|
||||
pSector = pActor->sector();
|
||||
nAngle = DAngle::fromBuild(pActor->int_ang());
|
||||
rotscrnang = DAngle::fromDeg(0.);
|
||||
rotscrnang = nullAngle;
|
||||
|
||||
SetGreenPal();
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ void CopySectorMatch(int match)
|
|||
|
||||
// update sprites postions so they aren't in the
|
||||
// wrong place for one frame
|
||||
GlobSpeedSO = DAngle::fromDeg(0.);
|
||||
GlobSpeedSO = nullAngle;
|
||||
RefreshPoints(sop, 0, 0, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -410,7 +410,7 @@ void drawroomstotile(int daposx, int daposy, int daposz,
|
|||
|
||||
screen->RenderTextureView(canvas, [=](IntRect& rect)
|
||||
{
|
||||
render_camtex(nullptr, { daposx, daposy, daposz }, dacursect, ang, horiz, DAngle::fromDeg(0.), tileGetTexture(tilenume), rect, smoothratio);
|
||||
render_camtex(nullptr, { daposx, daposy, daposz }, dacursect, ang, horiz, nullAngle, tileGetTexture(tilenume), rect, smoothratio);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -726,7 +726,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
pp->RevolveAng = pp->angle.ang;
|
||||
pp->Revolve.X = pp->pos.X;
|
||||
pp->Revolve.Y = pp->pos.Y;
|
||||
pp->RevolveDeltaAng = DAngle::fromDeg(0.);
|
||||
pp->RevolveDeltaAng = nullAngle;
|
||||
pp->Flags |= (PF_PLAYER_RIDING);
|
||||
|
||||
pp->sop_riding = sop;
|
||||
|
@ -1519,7 +1519,7 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, int nx, int ny)
|
|||
pp->Revolve.Y = pp->pos.Y;
|
||||
|
||||
// set the delta angle to 0 when moving
|
||||
pp->RevolveDeltaAng = DAngle::fromDeg(0.);
|
||||
pp->RevolveDeltaAng = nullAngle;
|
||||
}
|
||||
|
||||
pp->pos.X += nx;
|
||||
|
@ -1543,7 +1543,7 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, int nx, int ny)
|
|||
pp->Revolve.Y = pp->pos.Y;
|
||||
|
||||
// set the delta angle to 0 when moving
|
||||
pp->RevolveDeltaAng = DAngle::fromDeg(0.);
|
||||
pp->RevolveDeltaAng = nullAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2599,7 +2599,7 @@ void OperateSectorObjectForTics(SECTOR_OBJECT* sop, short newang, int newx, int
|
|||
}
|
||||
}
|
||||
|
||||
GlobSpeedSO = DAngle::fromDeg(0.);
|
||||
GlobSpeedSO = nullAngle;
|
||||
|
||||
//sop->ang_tgt = newang;
|
||||
sop->ang_moving = newang;
|
||||
|
|
Loading…
Reference in a new issue