Inline anglemod

This commit is contained in:
Steam Deck User 2023-03-15 19:39:18 -04:00
parent b35cf6969d
commit a2a2504886
2 changed files with 6 additions and 14 deletions

View file

@ -210,19 +210,6 @@ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
/*-----------------------------------------------------------------*/
float anglemod(float a)
{
#if 0
if (a >= 0)
a -= 360*(int)(a/360);
else
a += 360*( 1 + (int)(-a/360) );
#endif
a = (360.0/65536) * ((int)(a*(65536/360.0)) & 65535);
return a;
}
/*
==================
BOPS_Error

View file

@ -120,7 +120,12 @@ int GreatestCommonDivisor (int i1, int i2);
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct mplane_s *plane);
float anglemod(float a);
static inline float anglemod(float a)
{
a = (360.0/65536) * ((int)(a*(65536/360.0)) & 65535);
return a;
}
#define VectorL2Compare(v, w, m) \
(_mathlib_temp_float1 = (m) * (m), \