xine-lib: xine-lib-1.2.12/src/post/goom/goom_tools.h Source File

xine-lib 1.2.12

goom_tools.h
Go to the documentation of this file.
1#ifndef _GOOMTOOLS_H
2#define _GOOMTOOLS_H
3
8#define GOOM_NB_RAND 0x10000
9
10 typedef struct _GOOM_RANDOM {
11 int array[GOOM_NB_RAND];
12 unsigned short pos;
13} GoomRandom;
14
15 GoomRandom *goom_random_init(int i);
16void goom_random_free(GoomRandom *grandom);
17
18 inline static int goom_random(GoomRandom *grandom) {
19
20 grandom->pos++; /* works because pos is an unsigned short */
21 return grandom->array[grandom->pos];
22}
23
24 inline static int goom_irand(GoomRandom *grandom, int i) {
25
26 grandom->pos++;
27 return grandom->array[grandom->pos] % i;
28}
29
30/* called to change the specified number of value in the array, so that the array does not remain the same*/
31void goom_random_update_array(GoomRandom *grandom, int numberOfValuesToChange);
32
33#endif
goom_random_init
GoomRandom * goom_random_init(int i)
Definition: goom_tools.c:9
goom_random_free
void goom_random_free(GoomRandom *grandom)
Definition: goom_tools.c:17
goom_random
static int goom_random(GoomRandom *grandom)
Definition: goom_tools.h:18
GOOM_NB_RAND
#define GOOM_NB_RAND
Definition: goom_tools.h:8
GoomRandom
struct _GOOM_RANDOM GoomRandom
goom_irand
static int goom_irand(GoomRandom *grandom, int i)
Definition: goom_tools.h:24
goom_random_update_array
void goom_random_update_array(GoomRandom *grandom, int numberOfValuesToChange)
Definition: goom_tools.c:21
_GOOM_RANDOM
Definition: goom_tools.h:10
_GOOM_RANDOM::array
int array[0x10000]
Definition: goom_tools.h:11
_GOOM_RANDOM::pos
unsigned short pos
Definition: goom_tools.h:12