]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mathlib.h
sprite code now uses left vector instead of right, and upright facing sprites now...
[xonotic/darkplaces.git] / mathlib.h
index f04b67a7a419b587a81a5690e3f210ecbaa8eae1..7e17c7a48237d8acd928fe10a1d64451325886f1 100644 (file)
--- a/mathlib.h
+++ b/mathlib.h
@@ -34,7 +34,7 @@ typedef vec_t vec8_t[8];
 struct mplane_s;
 extern vec3_t vec3_origin;
 
-extern int nanmask;
+#define nanmask (255<<23)
 #define        IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask)
 
 #define bound(min,num,max) (num >= min ? (num < max ? num : max) : min)
@@ -51,7 +51,7 @@ extern int nanmask;
 #define ANGLEMOD(a) (((int) ((a) * (65536.0f / 360.0f)) & 65535) * (360.0f / 65536.0f))
 
 #define VectorNegate(a,b) ((b)[0]=-((a)[0]),(b)[1]=-((a)[1]),(b)[2]=-((a)[2]))
-#define VectorSet(a,b,c,d) ((d)[0]=(a),(d)[1]=(b),(d)[2]=(c))
+#define VectorSet(a,b,c,d) ((a)[0]=(b),(a)[1]=(c),(a)[2]=(d))
 #define VectorClear(a) ((a)[0]=(a)[1]=(a)[2]=0)
 #define DotProduct(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2])
 #define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])
@@ -144,8 +144,8 @@ float Q_RSqrt(float number);
 #define NUMVERTEXNORMALS       162
 extern float m_bytenormals[NUMVERTEXNORMALS][3];
 
-byte NormalToByte(vec3_t n);
-void ByteToNormal(byte num, vec3_t n);
+qbyte NormalToByte(vec3_t n);
+void ByteToNormal(qbyte num, vec3_t n);
 
 void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]);
 void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]);