goat3d

diff libs/vmath/vmath.inl @ 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/vmath.inl	Sun Sep 29 08:20:19 2013 +0300
     1.2 +++ b/libs/vmath/vmath.inl	Sun Sep 29 08:46:19 2013 +0300
     1.3 @@ -18,7 +18,7 @@
     1.4  
     1.5  #include <stdlib.h>
     1.6  
     1.7 -static inline scalar_t smoothstep(float a, float b, float x)
     1.8 +static VMATH_INLINE scalar_t smoothstep(float a, float b, float x)
     1.9  {
    1.10  	if(x < a) return 0.0;
    1.11  	if(x >= b) return 1.0;
    1.12 @@ -28,13 +28,13 @@
    1.13  }
    1.14  
    1.15  /** Generates a random number in [0, range) */
    1.16 -static inline scalar_t frand(scalar_t range)
    1.17 +static VMATH_INLINE scalar_t frand(scalar_t range)
    1.18  {
    1.19  	return range * (scalar_t)rand() / (scalar_t)RAND_MAX;
    1.20  }
    1.21  
    1.22  /** Generates a random vector on the surface of a sphere */
    1.23 -static inline vec3_t sphrand(scalar_t rad)
    1.24 +static VMATH_INLINE vec3_t sphrand(scalar_t rad)
    1.25  {
    1.26  	scalar_t u = (scalar_t)rand() / RAND_MAX;
    1.27  	scalar_t v = (scalar_t)rand() / RAND_MAX;
    1.28 @@ -50,7 +50,7 @@
    1.29  }
    1.30  
    1.31  /** linear interpolation */
    1.32 -static inline scalar_t lerp(scalar_t a, scalar_t b, scalar_t t)
    1.33 +static VMATH_INLINE scalar_t lerp(scalar_t a, scalar_t b, scalar_t t)
    1.34  {
    1.35  	return a + (b - a) * t;
    1.36  }