]> git.mxchange.org Git - simgear.git/blobdiff - simgear/math/sg_random.c
Ignore generated binaries.
[simgear.git] / simgear / math / sg_random.c
index fa3f213dac91a8cab62a7cc38bd09d4d5a39929b..c602bb53cd84f65ed63c84efe2bd46c1286c7896 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Written by Curtis Olson, started July 1997.
 //
-// Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+// Copyright (C) 1997  Curtis L. Olson  - http://www.flightgear.org/~curt
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Library General Public
@@ -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.