xine-lib 1.2.13-20230125hg15249
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
10typedef struct _GOOM_RANDOM {
12 unsigned short pos;
14
16void goom_random_free(GoomRandom *grandom);
17
18inline 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
24inline 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
GoomRandom * goom_random_init(int i)
Definition goom_tools.c:9
void goom_random_free(GoomRandom *grandom)
Definition goom_tools.c:17
static int goom_random(GoomRandom *grandom)
Definition goom_tools.h:18
#define GOOM_NB_RAND
Definition goom_tools.h:8
struct _GOOM_RANDOM GoomRandom
static int goom_irand(GoomRandom *grandom, int i)
Definition goom_tools.h:24
void goom_random_update_array(GoomRandom *grandom, int numberOfValuesToChange)
Definition goom_tools.c:21
Definition goom_tools.h:10
int array[0x10000]
Definition goom_tools.h:11
unsigned short pos
Definition goom_tools.h:12