From 42665deda0b35e5c6a0bd9553b092519342dd968 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 12 Feb 2008 01:41:13 +0000 Subject: [PATCH] changed ANGLEMOD to use floor instead of conversion to 16bit fixed-point git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8082 d7cf8633-e32d-0410-b094-e92efae38249 --- mathlib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathlib.h b/mathlib.h index 1e0f98c0..76ff03cc 100644 --- a/mathlib.h +++ b/mathlib.h @@ -68,7 +68,7 @@ unsigned int CeilPowerOf2(unsigned int value); #define DEG2RAD(a) ((a) * ((float) M_PI / 180.0f)) #define RAD2DEG(a) ((a) * (180.0f / (float) M_PI)) -#define ANGLEMOD(a) (((int) ((a) * (65536.0f / 360.0f)) & 65535) * (360.0f / 65536.0f)) +#define ANGLEMOD(a) ((a) - 360.0 * floor((a) / 360.0)) #define DotProduct4(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2]+(a)[3]*(b)[3]) #define Vector4Clear(a) ((a)[0]=(a)[1]=(a)[2]=(a)[3]=0) -- 2.39.2