- minor angle stuff in Blood

This commit is contained in:
Christoph Oelckers 2022-08-21 19:19:47 +02:00
parent ed12e333e3
commit 45f37525e0
10 changed files with 19 additions and 20 deletions

View file

@ -1635,10 +1635,11 @@ typedef TAngle<double> DAngle;
constexpr DAngle nullAngle = DAngle::fromDeg(0.);
constexpr FAngle nullFAngle = FAngle::fromDeg(0.);
constexpr DAngle DAngle90 = DAngle::fromBam(ANGLE_90);
constexpr DAngle DAngle180 = DAngle::fromBam(ANGLE_180);
constexpr DAngle DAngle270 = DAngle::fromBam(ANGLE_270);
constexpr DAngle DAngle360 = DAngle::fromBam(ANGLE_MAX);
constexpr DAngle DAngle45 = DAngle::fromDeg(45);
constexpr DAngle DAngle90 = DAngle::fromDeg(90);
constexpr DAngle DAngle180 = DAngle::fromDeg(180);
constexpr DAngle DAngle270 = DAngle::fromDeg(270);
constexpr DAngle DAngle360 = DAngle::fromDeg(360);
class Plane
{

View file

@ -555,8 +555,6 @@ inline void SetActorZ(DCoreActor* actor, const DVector3& newpos)
SetActorZ(actor, &ipos);
}
inline int clipmove(vec3_t& pos, sectortype** const sect, int xvect, int yvect,
int const walldist, int const ceildist, int const flordist, unsigned const cliptype, CollisionBase& result, int clipmoveboxtracenum = 3)
{

View file

@ -317,7 +317,7 @@ static void batMoveForward(DBloodActor* actor)
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->set_int_ang((actor->int_ang() + 256) & 2047);
actor->spr.angle += DAngle45;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
@ -377,7 +377,7 @@ static void batMoveFly(DBloodActor* actor)
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->set_int_ang((actor->int_ang() + 512) & 2047);
actor->spr.angle += DAngle90;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;

View file

@ -420,7 +420,7 @@ static void sub_628A0(DBloodActor* actor)
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->set_int_ang((actor->int_ang() + 256) & 2047);
actor->spr.angle += DAngle45;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
@ -489,7 +489,7 @@ static void sub_62D7C(DBloodActor* actor)
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->set_int_ang((actor->int_ang() + 512) & 2047);
actor->spr.angle += DAngle90;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;

View file

@ -327,7 +327,7 @@ static void eelMoveForward(DBloodActor* actor)
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->set_int_ang((actor->int_ang() + 256) & 2047);
actor->spr.angle += DAngle45;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);

View file

@ -283,7 +283,7 @@ static void sub_65D04(DBloodActor* actor)
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->set_int_ang((actor->int_ang() + 256) & 2047);
actor->spr.angle += DAngle45;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
@ -354,7 +354,7 @@ static void sub_661E0(DBloodActor* actor)
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->set_int_ang((actor->int_ang() + 512) & 2047);
actor->spr.angle += DAngle90;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;

View file

@ -530,7 +530,7 @@ static void gargMoveForward(DBloodActor* actor)
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->set_int_ang((actor->int_ang() + 256) & 2047);
actor->spr.angle += DAngle45;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
@ -644,7 +644,7 @@ static void gargMoveFly(DBloodActor* actor)
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->set_int_ang((actor->int_ang() + 512) & 2047);
actor->spr.angle += DAngle90;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;

View file

@ -426,7 +426,7 @@ static void ghostMoveForward(DBloodActor* actor)
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->set_int_ang((actor->int_ang() + 256) & 2047);
actor->spr.angle += DAngle45;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
@ -534,7 +534,7 @@ static void ghostMoveFly(DBloodActor* actor)
int nAccel = pDudeInfo->frontSpeed << 2;
if (abs(nAng) > 341)
{
actor->set_int_ang((actor->int_ang() + 512) & 2047);
actor->spr.angle += DAngle90;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;

View file

@ -273,7 +273,7 @@ static void sub_6CB00(DBloodActor* actor)
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->set_int_ang((actor->int_ang() + 256) & 2047);
actor->spr.angle += DAngle45;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);
@ -342,7 +342,7 @@ static void sub_6D03C(DBloodActor* actor)
int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2;
if (abs(nAng) > 341)
{
actor->set_int_ang((actor->int_ang() + 512) & 2047);
actor->spr.angle += DAngle90;
return;
}
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;

View file

@ -1121,7 +1121,7 @@ void aiGenDudeMoveForward(DBloodActor* actor)
if (abs(nAng) > 341)
return;
if (actor->GetTarget() == nullptr)
actor->set_int_ang((actor->int_ang() + 256) & 2047);
actor->spr.angle += DAngle45;
int dx = actor->xspr.TargetPos.X - actor->int_pos().X;
int dy = actor->xspr.TargetPos.Y - actor->int_pos().Y;
int nDist = approxDist(dx, dy);