]> icculus.org git repositories - taylor/freespace2.git/blob - include/staticrand.h
Initial revision
[taylor/freespace2.git] / include / staticrand.h
1 /*
2  * $Logfile: /Freespace2/code/Math/StaticRand.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * header for Static Random functions
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 2     10/07/98 10:53a Dave
15  * Initial checkin.
16  * 
17  * 1     10/07/98 10:49a Dave
18  * 
19  * 4     3/17/98 12:16a Allender
20  * asteroids in multiplayer -- minor problems with position being correct
21  * 
22  * 3     12/30/97 5:46p Lawrance
23  * Rename rnd() to rand_alt().
24  * 
25  * 2     12/30/97 4:27p Lawrance
26  * Add new rnd() function that doesn't affect rand() sequence.
27  * 
28  * 1     8/08/97 3:38p Allender
29  * 
30 */
31
32 #ifndef _STATIC_RAND_H
33
34 #include "pstypes.h"
35
36 #define SEMIRAND_MAX_LOG        4
37 #define SEMIRAND_MAX            (2 << SEMIRAND_MAX_LOG) //      Do not change this!  Change SEMIRAND_MAX_LOG!
38
39 extern int Semirand[SEMIRAND_MAX];                      // this array is saved by the ai code on save/restore
40
41 extern void init_semirand();
42 extern int static_rand(int num);
43 extern float static_randf(int num);
44 extern void static_randvec(int num, vector *vp);
45 extern float static_randf_range(int num, float min, float max);
46
47 // Alternate random number generator that doesn't affect rand() sequence
48
49 void    srand_alt(int seed);    // Seed the random number generator
50 int     rand_alt();                             // Get a random integer between 1 and RND_MAX
51 float   frand_alt();                            // Get a random float between 0 and 1.0
52
53 #endif
54