mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-25 18:21:47 +00:00
- Tidy up remaining Build angle constants in gamefuncs.h
.
This commit is contained in:
parent
de8353f085
commit
c3f276a08a
4 changed files with 17 additions and 43 deletions
|
@ -28,6 +28,16 @@ BitArray clipsectormap;
|
|||
|
||||
int32_t quickloadboard=0;
|
||||
|
||||
static inline int bsin(const int ang)
|
||||
{
|
||||
return int(g_sinbam(ang * (1 << 21)) * 16384);
|
||||
}
|
||||
|
||||
static inline int bcos(const int ang)
|
||||
{
|
||||
return int(g_cosbam(ang * (1 << 21)) * 16384);
|
||||
}
|
||||
|
||||
////////// CLIPMOVE //////////
|
||||
inline uint8_t bitmap_test(uint8_t const* const ptr, int const n) { return ptr[n >> 3] & (1 << (n & 7)); }
|
||||
|
||||
|
|
|
@ -197,42 +197,6 @@ inline void dragpoint(walltype* startwall, const DVector2& pos)
|
|||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Constants used for Build sine/cosine functions.
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
enum
|
||||
{
|
||||
BAMBITS = 21,
|
||||
BAMUNIT = 1 << BAMBITS,
|
||||
};
|
||||
|
||||
constexpr double BAngRadian = pi::pi() * (1. / 1024.);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Build sine inline functions.
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
inline int bsin(const int ang)
|
||||
{
|
||||
return int(g_sinbam(ang * BAMUNIT) * 16384);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Build cosine inline functions.
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
inline int bcos(const int ang)
|
||||
{
|
||||
return int(g_cosbam(ang * BAMUNIT) * 16384);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
|
|
|
@ -1675,7 +1675,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
|
|||
if (p->MotoSpeed >= 20 && p->on_ground == 1 && (p->vehTurnLeft || p->vehTurnRight))
|
||||
{
|
||||
velAdjustment = p->vehTurnLeft ? -adjust : adjust;
|
||||
auto angAdjustment = (velAdjustment > nullAngle ? 350 : -350) << BAMBITS;
|
||||
auto angAdjustment = velAdjustment > nullAngle ? 734003200 : -734003200;
|
||||
|
||||
if (p->moto_on_mud || p->moto_on_oil || !p->NotOnWater)
|
||||
{
|
||||
|
@ -1712,7 +1712,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
|
|||
}
|
||||
|
||||
p->vel.XY() += (p->GetActor()->spr.Angles.Yaw + velAdjustment).ToVector() * currSpeed;
|
||||
p->GetActor()->spr.Angles.Yaw += deltaangle(p->GetActor()->spr.Angles.Yaw, p->GetActor()->spr.Angles.Yaw - DAngle::fromBam(angAdjustment));
|
||||
p->GetActor()->spr.Angles.Yaw = (p->GetActor()->spr.Angles.Yaw - DAngle::fromBam(angAdjustment)).Normalized360();
|
||||
}
|
||||
else if (p->MotoSpeed >= 20 && p->on_ground == 1 && (p->moto_on_mud || p->moto_on_oil))
|
||||
{
|
||||
|
@ -1942,7 +1942,7 @@ static void onBoat(int snum, ESyncBits &actions)
|
|||
|
||||
int currSpeed = int(p->MotoSpeed * 4.);
|
||||
DAngle velAdjustment = p->vehTurnLeft ? -adjust : adjust;
|
||||
auto angAdjustment = (velAdjustment > nullAngle ? 350 : -350) << BAMBITS;
|
||||
auto angAdjustment = velAdjustment > nullAngle ? 734003200 : -734003200;
|
||||
|
||||
if (p->moto_do_bump)
|
||||
{
|
||||
|
@ -1956,7 +1956,7 @@ static void onBoat(int snum, ESyncBits &actions)
|
|||
}
|
||||
|
||||
p->vel.XY() += (p->GetActor()->spr.Angles.Yaw + velAdjustment).ToVector() * currSpeed;
|
||||
p->GetActor()->spr.Angles.Yaw += deltaangle(p->GetActor()->spr.Angles.Yaw, p->GetActor()->spr.Angles.Yaw - DAngle::fromBam(angAdjustment));
|
||||
p->GetActor()->spr.Angles.Yaw = (p->GetActor()->spr.Angles.Yaw - DAngle::fromBam(angAdjustment)).Normalized360();
|
||||
}
|
||||
if (p->NotOnWater && p->MotoSpeed > 50)
|
||||
p->MotoSpeed -= (p->MotoSpeed / 2.);
|
||||
|
|
|
@ -455,9 +455,9 @@ void EXSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
|
|||
else if (type == SOURCE_Swirly)
|
||||
{
|
||||
int which = *(int*)source;
|
||||
double phase = (PlayClock << (4 + which)) * BAngRadian;
|
||||
pos->X = fcampos.X + float(256 * cos(phase));
|
||||
pos->Z = fcampos.Z + float(256 * sin(phase));
|
||||
double phase = PlayClock << (4 + which);
|
||||
pos->X = fcampos.X + float(256 * BobVal(phase + 512));
|
||||
pos->Z = fcampos.Z + float(256 * BobVal(phase));
|
||||
}
|
||||
else if (type == SOURCE_EXBoss)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue