From b9d0d937c6c60c4d41e07c7de3308dd3b113933e Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 18 Jul 2009 20:10:44 +0000 Subject: [PATCH] Added a VectorEquals macro. Because I can. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3303 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/mathlib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/common/mathlib.h b/engine/common/mathlib.h index fd880e958..16e311936 100644 --- a/engine/common/mathlib.h +++ b/engine/common/mathlib.h @@ -51,8 +51,8 @@ extern int nanmask; #define VectorClear(a) ((a)[0]=(a)[1]=(a)[2]=0) #define VectorNegate(a,b) ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2]) #define VectorLength(a) Length(a) -#define VectorMA(a,s,b,c) do{c[0] = a[0] + s*b[0];c[1] = a[1] + s*b[1];c[2] = a[2] + s*b[2];}while(0) - +#define VectorMA(a,s,b,c) do{(c)[0] = (a)[0] + (s)*(b)[0];(c)[1] = (a)[1] + (s)*(b)[1];(c)[2] = (a)[2] + (s)*(b)[2];}while(0) +#define VectorEquals(a,b) ((a)[0] == (b)[0] && (a)[1] == (b)[1] && (a)[2] == (b)[2]) typedef float matrix3x4[3][4];