diff options
author | Thibaut Mattern <tmattern@users.sourceforge.net> | 2003-09-14 15:45:55 +0000 |
---|---|---|
committer | Thibaut Mattern <tmattern@users.sourceforge.net> | 2003-09-14 15:45:55 +0000 |
commit | 9b70d40e54265ee8e4519d64382f38b3900e7fd6 (patch) | |
tree | ad3acc28e7db7f72a7dfc7ef8d3348e979581db3 /src/post/goom/goom_tools.h | |
parent | f3da42db0b3c3f01c2f65471c99f1678990c3063 (diff) | |
download | xine-lib-9b70d40e54265ee8e4519d64382f38b3900e7fd6.tar.gz xine-lib-9b70d40e54265ee8e4519d64382f38b3900e7fd6.tar.bz2 |
newer goom version.
CVS patchset: 5378
CVS date: 2003/09/14 15:45:55
Diffstat (limited to 'src/post/goom/goom_tools.h')
-rw-r--r-- | src/post/goom/goom_tools.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/post/goom/goom_tools.h b/src/post/goom/goom_tools.h index 2bd74b95b..8e4fdd314 100644 --- a/src/post/goom/goom_tools.h +++ b/src/post/goom/goom_tools.h @@ -5,25 +5,29 @@ /* in graphic.c */ extern int *rand_tab; -extern unsigned short rand_pos; +static unsigned short rand_pos; #define RAND_INIT(i) \ srand (i) ;\ - if (!rand_tab)\ - rand_tab = (int *) malloc (NB_RAND * sizeof(int)) ;\ + if (!rand_tab) rand_tab = (int *) malloc (NB_RAND * sizeof(int)) ;\ rand_pos = 1 ;\ - while (rand_pos != 0)\ - rand_tab [rand_pos++] = rand () ; + while (rand_pos != 0) rand_tab [rand_pos++] = rand () ; -#define RAND()\ - (rand_tab[rand_pos = (rand_pos + 1) % NB_RAND]) + +static inline int RAND() { + ++rand_pos; + return rand_tab[rand_pos]; +} #define RAND_CLOSE()\ free (rand_tab);\ rand_tab = 0; -/* #define iRAND(i) ((guint32)((float)i * RAND()/RAND_MAX)) */ +//#define iRAND(i) ((guint32)((float)i * RAND()/RAND_MAX)) #define iRAND(i) (RAND()%i) +//inline unsigned int RAND(void); +//inline unsigned int iRAND(int i); + #endif |