X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=mathlib.h;h=55f1218e462d0571a44fd3313ed51292d9f6697b;hp=aeab1db8b40b03cf40b4bc0169e08863ef874571;hb=7b70abc823ed3391ea31938fbc2188bc2bf45d12;hpb=0a05c446ba26bd5897645a37ceec8646c5bc93eb diff --git a/mathlib.h b/mathlib.h index aeab1db8..55f1218e 100644 --- a/mathlib.h +++ b/mathlib.h @@ -83,6 +83,8 @@ unsigned int CeilPowerOf2(unsigned int value); #define RAD2DEG(a) ((a) * (180.0f / (float) M_PI)) #define ANGLEMOD(a) ((a) - 360.0 * floor((a) / 360.0)) +#define Q_rint(x) ((x) > 0 ? (int)((x) + 0.5) : (int)((x) - 0.5)) //johnfitz -- from joequake + #define DotProduct2(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]) #define Vector2Clear(a) ((a)[0]=(a)[1]=0) #define Vector2Compare(a,b) (((a)[0]==(b)[0])&&((a)[1]==(b)[1]))