]> icculus.org git repositories - taylor/freespace2.git/blob - include/staticrand.h
fix issue with looping audio streams
[taylor/freespace2.git] / include / staticrand.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Math/StaticRand.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * header for Static Random functions
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:15  relnev
19  * added copyright header
20  *
21  * Revision 1.1.1.1  2002/05/03 03:28:12  root
22  * Initial import.
23  *
24  * 
25  * 2     10/07/98 10:53a Dave
26  * Initial checkin.
27  * 
28  * 1     10/07/98 10:49a Dave
29  * 
30  * 4     3/17/98 12:16a Allender
31  * asteroids in multiplayer -- minor problems with position being correct
32  * 
33  * 3     12/30/97 5:46p Lawrance
34  * Rename rnd() to rand_alt().
35  * 
36  * 2     12/30/97 4:27p Lawrance
37  * Add new rnd() function that doesn't affect rand() sequence.
38  * 
39  * 1     8/08/97 3:38p Allender
40  * 
41 */
42
43 #ifndef _STATIC_RAND_H
44
45 #include "pstypes.h"
46
47 #define SEMIRAND_MAX_LOG        4
48 #define SEMIRAND_MAX            (2 << SEMIRAND_MAX_LOG) //      Do not change this!  Change SEMIRAND_MAX_LOG!
49
50 extern int Semirand[SEMIRAND_MAX];                      // this array is saved by the ai code on save/restore
51
52 extern void init_semirand();
53 extern int static_rand(int num);
54 extern float static_randf(int num);
55 extern void static_randvec(int num, vector *vp);
56 extern float static_randf_range(int num, float min, float max);
57
58 // Alternate random number generator that doesn't affect rand() sequence
59
60 void    srand_alt(int seed);    // Seed the random number generator
61 int     rand_alt();                             // Get a random integer between 1 and RND_MAX
62 float   frand_alt();                            // Get a random float between 0 and 1.0
63
64 #endif
65