Add a seed function that gives the same random seed within a ten minute period of time. This should be useful for synchronizing display systems.

This commit is contained in:
ehofman
2005-04-30 09:59:12 +00:00
parent eccd4d0325
commit f9cbf8361d
2 changed files with 14 additions and 0 deletions

View File

@@ -134,6 +134,13 @@ void sg_srandom_time() {
init_genrand(time(NULL));
}
// Seed the random number generater with time() in 10 minute intervals
// so we get the same sequence within 10 minutes interval.
// This is useful for synchronizing two display systems.
void sg_srandom_time_10() {
init_genrand(time(NULL) / 600);
}
// Seed the random number generater with your own seed so can set up
// repeatable randomization.

View File

@@ -40,6 +40,13 @@ extern "C" {
*/
void sg_srandom_time();
/**
* Seed the random number generater with time() in 10 minute intervals
* so we get the same sequence within 10 minutes interval.
* This is useful for synchronizing two display systems.
*/
void sg_srandom_time_10();
/**
* Seed the random number generater with your own seed so can set up
* repeatable randomization.