From 93a37df90a8a9954259d7bf1375fd7532c97a482 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 4 Dec 2000 04:12:33 +0000 Subject: [PATCH] Renamed fg_random -> sg_random. --- simgear/math/Makefile.am | 4 ++-- simgear/math/{fg_random.c => sg_random.c} | 8 ++++---- simgear/math/{fg_random.h => sg_random.h} | 12 ++++++------ simgear/sky/cloud.cxx | 4 ++-- simgear/sky/dome.cxx | 1 - simgear/sky/sky.cxx | 6 +++--- 6 files changed, 17 insertions(+), 18 deletions(-) rename simgear/math/{fg_random.c => sg_random.c} (92%) rename simgear/math/{fg_random.h => sg_random.h} (87%) diff --git a/simgear/math/Makefile.am b/simgear/math/Makefile.am index 5ad69704..e6d49044 100644 --- a/simgear/math/Makefile.am +++ b/simgear/math/Makefile.am @@ -10,24 +10,24 @@ lib_LIBRARIES = libsgmath.a include_HEADERS = \ fg_memory.h \ - fg_random.h \ interpolater.hxx \ leastsqs.hxx \ localconsts.hxx \ point3d.hxx \ polar3d.hxx \ sg_geodesy.hxx \ + sg_random.h \ sg_types.hxx \ vector.hxx EXTRA_DIST = linintp2.h linintp2.inl sphrintp.h sphrintp.inl libsgmath_a_SOURCES = \ - fg_random.c \ interpolater.cxx \ leastsqs.cxx \ polar3d.cxx \ sg_geodesy.cxx \ + sg_random.c \ vector.cxx INCLUDES += -I$(top_srcdir) $(ZLIB_INCL) diff --git a/simgear/math/fg_random.c b/simgear/math/sg_random.c similarity index 92% rename from simgear/math/fg_random.c rename to simgear/math/sg_random.c index 32a207b8..654cf21c 100644 --- a/simgear/math/fg_random.c +++ b/simgear/math/sg_random.c @@ -1,4 +1,4 @@ -// fg_random.c -- routines to handle random number generation +// sg_random.c -- routines to handle random number generation // // Written by Curtis Olson, started July 1997. // @@ -30,7 +30,7 @@ #include // for random(), srandom() #include // for time() to seed srandom() -#include "fg_random.h" +#include "sg_random.h" #ifndef HAVE_RAND # ifdef sgi @@ -49,7 +49,7 @@ // Seed the random number generater with time() so we don't see the // same sequence every time -void fg_srandom(void) { +void sg_srandom(void) { // fgPrintf( FG_MATH, FG_INFO, "Seeding random number generater\n"); #ifdef HAVE_RAND @@ -61,7 +61,7 @@ void fg_srandom(void) { // return a random number between [0.0, 1.0) -double fg_random(void) { +double sg_random(void) { #ifdef HAVE_RAND return(rand() / (double)RAND_MAX); #else diff --git a/simgear/math/fg_random.h b/simgear/math/sg_random.h similarity index 87% rename from simgear/math/fg_random.h rename to simgear/math/sg_random.h index 731a3c93..3c41071e 100644 --- a/simgear/math/fg_random.h +++ b/simgear/math/sg_random.h @@ -1,4 +1,4 @@ -// fg_random.h -- routines to handle random number generation +// sg_random.h -- routines to handle random number generation // // Written by Curtis Olson, started July 1997. // @@ -22,8 +22,8 @@ // $Id$ -#ifndef _FG_RANDOM_H -#define _FG_RANDOM_H +#ifndef _SG_RANDOM_H +#define _SG_RANDOM_H #ifdef __cplusplus @@ -33,10 +33,10 @@ extern "C" { // Seed the random number generater with time() so we don't see the // same sequence every time -void fg_srandom(void); +void sg_srandom(void); // return a random number between [0.0, 1.0) -double fg_random(void); +double sg_random(void); #ifdef __cplusplus @@ -44,6 +44,6 @@ double fg_random(void); #endif -#endif // _FG_RANDOM_H +#endif // _SG_RANDOM_H diff --git a/simgear/sky/cloud.cxx b/simgear/sky/cloud.cxx index 0b439771..372360b9 100644 --- a/simgear/sky/cloud.cxx +++ b/simgear/sky/cloud.cxx @@ -26,9 +26,9 @@ #include #include -#include #include #include +#include #include "cloud.hxx" @@ -70,7 +70,7 @@ void SGCloudLayer::build( double s, double asl, double thickness, sgSetVec3( vertex, -size, -size, 0.0f ); sgVec2 base; - sgSetVec2( base, fg_random(), fg_random() ); + sgSetVec2( base, sg_random(), sg_random() ); sgSetVec2( tc, base[0], base[1] ); cl->add( color ); vl->add( vertex ); diff --git a/simgear/sky/dome.cxx b/simgear/sky/dome.cxx index 0175a563..374fc3aa 100644 --- a/simgear/sky/dome.cxx +++ b/simgear/sky/dome.cxx @@ -39,7 +39,6 @@ #include #include -#include #include "dome.hxx" diff --git a/simgear/sky/sky.cxx b/simgear/sky/sky.cxx index e200def8..a3f756be 100644 --- a/simgear/sky/sky.cxx +++ b/simgear/sky/sky.cxx @@ -30,7 +30,7 @@ #include #include -#include +#include #include "sky.hxx" @@ -328,11 +328,11 @@ void SGSky::modify_vis( float alt, float time_factor ) { if ( ratio < 1.0 ) { if ( ! in_puff ) { // calc chance of entering cloud puff - double rnd = fg_random(); + double rnd = sg_random(); double chance = rnd * rnd * rnd; if ( chance > 0.95 /* * (diff - 25) / 50.0 */ ) { in_puff = true; - puff_length = fg_random() * 2.0; // up to 2 seconds + puff_length = sg_random() * 2.0; // up to 2 seconds puff_progression = 0.0; } } -- 2.39.5