Random Seed utilities
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@539 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
4ef23ada7c
commit
4bfd113941
@ -203,6 +203,20 @@ void make_pseudo_random_seed (struct rand_seed_6uc *seed_ptr)
|
||||
seed_ptr->f = gen_rnd_number();
|
||||
}
|
||||
|
||||
Random_Seed nil_seed()
|
||||
{
|
||||
Random_Seed result = { (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0};
|
||||
return result;
|
||||
}
|
||||
|
||||
int is_nil_seed(Random_Seed a_seed)
|
||||
{
|
||||
if (a_seed.a | a_seed.b | a_seed.c | a_seed.d | a_seed.e | a_seed.f)
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rotate_seed (struct rand_seed_6uc *seed_ptr)
|
||||
{
|
||||
unsigned int x;
|
||||
|
@ -90,6 +90,9 @@ int gen_rnd_number (void);
|
||||
|
||||
void make_pseudo_random_seed (struct rand_seed_6uc *seed_ptr);
|
||||
|
||||
Random_Seed nil_seed();
|
||||
int is_nil_seed(Random_Seed a_seed);
|
||||
|
||||
void rotate_seed (struct rand_seed_6uc *seed_ptr);
|
||||
int rotate_byte_left (int x);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user