mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-10 04:31:34 -10:00
I've tested this through compiling and through hand checking. Normalises line endings in ALL files to \n.
35 lines
1.1 KiB
C
35 lines
1.1 KiB
C
/*
|
|
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
|
*
|
|
* All source code herein is the property of Volition, Inc. You may not sell
|
|
* or otherwise commercially exploit the source or things you created based on the
|
|
* source.
|
|
*
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _STATIC_RAND_H
|
|
|
|
#include "globalincs/pstypes.h"
|
|
|
|
#define SEMIRAND_MAX_LOG 4
|
|
#define SEMIRAND_MAX (2 << SEMIRAND_MAX_LOG) // Do not change this! Change SEMIRAND_MAX_LOG!
|
|
|
|
extern int Semirand[SEMIRAND_MAX]; // this array is saved by the ai code on save/restore
|
|
|
|
extern void init_semirand();
|
|
extern int static_rand(int num);
|
|
extern float static_randf(int num);
|
|
extern void static_randvec(int num, vec3d *vp);
|
|
extern float static_randf_range(int num, float min, float max);
|
|
void static_rand_cone(int num, vec3d *out, vec3d *in, float max_angle, matrix *orient = NULL);
|
|
|
|
// Alternate random number generator that doesn't affect rand() sequence
|
|
|
|
void srand_alt(int seed); // Seed the random number generator
|
|
int rand_alt(); // Get a random integer between 1 and RND_MAX
|
|
float frand_alt(); // Get a random float between 0 and 1.0
|
|
|
|
#endif
|