goat3d
diff libs/vmath/matrix.h @ 28:9ba3e2fb8a33
modified vmath to work with vs2012, still memory corruptions in 3dsmax...
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 29 Sep 2013 08:46:19 +0300 |
parents | 4deb0b12fe14 |
children |
line diff
1.1 --- a/libs/vmath/matrix.h Sun Sep 29 08:20:19 2013 +0300 1.2 +++ b/libs/vmath/matrix.h Sun Sep 29 08:46:19 2013 +0300 1.3 @@ -27,27 +27,27 @@ 1.4 #endif /* __cplusplus */ 1.5 1.6 /* C matrix 3x3 functions */ 1.7 -static inline void m3_identity(mat3_t m); 1.8 -static inline void m3_cons(mat3_t m, 1.9 +static VMATH_INLINE void m3_identity(mat3_t m); 1.10 +static VMATH_INLINE void m3_cons(mat3_t m, 1.11 scalar_t m11, scalar_t m12, scalar_t m13, 1.12 scalar_t m21, scalar_t m22, scalar_t m23, 1.13 scalar_t m31, scalar_t m32, scalar_t m33); 1.14 -static inline void m3_copy(mat3_t dest, mat3_t src); 1.15 +static VMATH_INLINE void m3_copy(mat3_t dest, mat3_t src); 1.16 void m3_to_m4(mat4_t dest, mat3_t src); 1.17 1.18 void m3_print(FILE *fp, mat3_t m); 1.19 1.20 /* C matrix 4x4 functions */ 1.21 -static inline void m4_identity(mat4_t m); 1.22 -static inline void m4_cons(mat4_t m, 1.23 +static VMATH_INLINE void m4_identity(mat4_t m); 1.24 +static VMATH_INLINE void m4_cons(mat4_t m, 1.25 scalar_t m11, scalar_t m12, scalar_t m13, scalar_t m14, 1.26 scalar_t m21, scalar_t m22, scalar_t m23, scalar_t m24, 1.27 scalar_t m31, scalar_t m32, scalar_t m33, scalar_t m34, 1.28 scalar_t m41, scalar_t m42, scalar_t m43, scalar_t m44); 1.29 -static inline void m4_copy(mat4_t dest, mat4_t src); 1.30 +static VMATH_INLINE void m4_copy(mat4_t dest, mat4_t src); 1.31 void m4_to_m3(mat3_t dest, mat4_t src); 1.32 1.33 -static inline void m4_mult(mat4_t res, mat4_t m1, mat4_t m2); 1.34 +static VMATH_INLINE void m4_mult(mat4_t res, mat4_t m1, mat4_t m2); 1.35 1.36 void m4_set_translation(mat4_t m, scalar_t x, scalar_t y, scalar_t z); 1.37 void m4_translate(mat4_t m, scalar_t x, scalar_t y, scalar_t z); 1.38 @@ -69,8 +69,8 @@ 1.39 void m4_set_scaling(mat4_t m, scalar_t x, scalar_t y, scalar_t z); 1.40 void m4_scale(mat4_t m, scalar_t x, scalar_t y, scalar_t z); 1.41 1.42 -static inline void m4_set_column(mat4_t m, vec4_t v, int idx); 1.43 -static inline void m4_set_row(mat4_t m, vec4_t v, int idx); 1.44 +static VMATH_INLINE void m4_set_column(mat4_t m, vec4_t v, int idx); 1.45 +static VMATH_INLINE void m4_set_row(mat4_t m, vec4_t v, int idx); 1.46 1.47 void m4_transpose(mat4_t res, mat4_t m); 1.48 scalar_t m4_determinant(mat4_t m); 1.49 @@ -116,10 +116,10 @@ 1.50 1.51 friend void operator *=(Matrix3x3 &mat, scalar_t scalar); 1.52 1.53 - inline scalar_t *operator [](int index); 1.54 - inline const scalar_t *operator [](int index) const; 1.55 + VMATH_INLINE scalar_t *operator [](int index); 1.56 + VMATH_INLINE const scalar_t *operator [](int index) const; 1.57 1.58 - inline void reset_identity(); 1.59 + VMATH_INLINE void reset_identity(); 1.60 1.61 void translate(const Vector2 &trans); 1.62 void set_translation(const Vector2 &trans); 1.63 @@ -190,7 +190,7 @@ 1.64 1.65 friend void operator +=(Matrix4x4 &m1, const Matrix4x4 &m2); 1.66 friend void operator -=(Matrix4x4 &m1, const Matrix4x4 &m2); 1.67 - friend inline void operator *=(Matrix4x4 &m1, const Matrix4x4 &m2); 1.68 + friend VMATH_INLINE void operator *=(Matrix4x4 &m1, const Matrix4x4 &m2); 1.69 1.70 /* binary operations matrix (op) scalar and scalar (op) matrix */ 1.71 friend Matrix4x4 operator *(const Matrix4x4 &mat, scalar_t scalar); 1.72 @@ -198,10 +198,10 @@ 1.73 1.74 friend void operator *=(Matrix4x4 &mat, scalar_t scalar); 1.75 1.76 - inline scalar_t *operator [](int index); 1.77 - inline const scalar_t *operator [](int index) const; 1.78 + VMATH_INLINE scalar_t *operator [](int index); 1.79 + VMATH_INLINE const scalar_t *operator [](int index) const; 1.80 1.81 - inline void reset_identity(); 1.82 + VMATH_INLINE void reset_identity(); 1.83 1.84 void translate(const Vector3 &trans); 1.85 void set_translation(const Vector3 &trans); 1.86 @@ -239,11 +239,11 @@ 1.87 /* binary operations matrix (op) matrix */ 1.88 Matrix4x4 operator +(const Matrix4x4 &m1, const Matrix4x4 &m2); 1.89 Matrix4x4 operator -(const Matrix4x4 &m1, const Matrix4x4 &m2); 1.90 -inline Matrix4x4 operator *(const Matrix4x4 &m1, const Matrix4x4 &m2); 1.91 +VMATH_INLINE Matrix4x4 operator *(const Matrix4x4 &m1, const Matrix4x4 &m2); 1.92 1.93 void operator +=(Matrix4x4 &m1, const Matrix4x4 &m2); 1.94 void operator -=(Matrix4x4 &m1, const Matrix4x4 &m2); 1.95 -inline void operator *=(Matrix4x4 &m1, const Matrix4x4 &m2); 1.96 +VMATH_INLINE void operator *=(Matrix4x4 &m1, const Matrix4x4 &m2); 1.97 1.98 /* binary operations matrix (op) scalar and scalar (op) matrix */ 1.99 Matrix4x4 operator *(const Matrix4x4 &mat, scalar_t scalar);