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:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user