diff options
-rw-r--r-- | snowglobe-internal.h | 11 | ||||
-rw-r--r-- | util.c | 24 |
2 files changed, 4 insertions, 31 deletions
diff --git a/snowglobe-internal.h b/snowglobe-internal.h index 4db8748..1e68d2a 100644 --- a/snowglobe-internal.h +++ b/snowglobe-internal.h @@ -19,7 +19,10 @@ #include <math.h> #include <float.h> -#include <math.h> +//return random number in range [0,x) +#define randf(x) ((float) (rand()/(((double)RAND_MAX + 1)/(x)))) + + #include <compiz-core.h> #include <compiz-cube.h> @@ -163,12 +166,6 @@ void finDrawSnowflake(void); void DrawSnowman (int); -//utility methods -float randf(float); //random float -float minimum(float,float); //my compiler at home didn't have min or fminf! -float maximum(float,float); //nor did it have max or fmaxf! -float symmDistr(void); //symmetric distribution - //All calculations that matter with angles are done clockwise from top. //I think of it as x=radius, y=0 being the top (towards 1st desktop from above view) @@ -1,24 +0,0 @@ -//a collection of utility methods - -#include "snowglobe-internal.h" -#include <math.h> -#include <float.h> - - -float -randf (float x) -{ //return random number in range [0,x) - return rand()/(((double)RAND_MAX + 1) / x); -} - -float -minimum (float x, float y) -{ - return ((x) < (y) ? (x) : (y)); -} - -float -maximum (float x, float y) -{ - return ((x) > (y) ? (x) : (y)); -} |