From 0419841486bb8a19429bcc4a1b8260ae4f840931 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 2 May 1998 01:53:17 +0000 Subject: [PATCH] Fine tuning mktime() support because of varying behavior on different platforms. --- Time/fg_time.cxx | 10 +++++++++- Time/light.hxx | 6 +++++- Time/sunpos.cxx | 12 ++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Time/fg_time.cxx b/Time/fg_time.cxx index a4f85d592..e1a4afc60 100644 --- a/Time/fg_time.cxx +++ b/Time/fg_time.cxx @@ -217,7 +217,11 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) { long int offset; double diff, part, days, hours, lst; -#ifdef __CYGWIN32__ + // I believe the following is Unix vs. Win32 behavior difference. + // If you are having problems with incorrectly positioned + // astronomical bodies, this is a really good place to start + // looking. +#ifdef WIN32 int daylight; // not used but need to keep the compiler happy long int timezone; // not used but need to keep the compiler happy int mktime_is_gmt = 1; @@ -375,6 +379,10 @@ void fgTimeUpdate(fgFLIGHT *f, fgTIME *t) { // $Log$ +// Revision 1.6 1998/05/02 01:53:17 curt +// Fine tuning mktime() support because of varying behavior on different +// platforms. +// // Revision 1.5 1998/04/28 21:45:34 curt // Fixed a horible bug that cause the time to be *WAY* off when compiling // with the CygWin32 compiler. This may not yet completely address other diff --git a/Time/light.hxx b/Time/light.hxx index 1cb5d02bc..e0f7f3476 100644 --- a/Time/light.hxx +++ b/Time/light.hxx @@ -55,7 +55,7 @@ typedef struct { double sun_lon, sun_gc_lat; // in cartesian coordiantes - struct fgCartesianPoint fg_sunpos; + fgCartesianPoint3d fg_sunpos; // (in view coordinates) GLfloat sun_vec[4]; @@ -98,6 +98,10 @@ void fgLightUpdate( void); // $Log$ +// Revision 1.3 1998/05/02 01:53:18 curt +// Fine tuning mktime() support because of varying behavior on different +// platforms. +// // Revision 1.2 1998/04/24 00:52:31 curt // Wrapped "#include " in "#ifdef HAVE_CONFIG_H" // Fog color fixes. diff --git a/Time/sunpos.cxx b/Time/sunpos.cxx index bac2b5748..0f087b732 100644 --- a/Time/sunpos.cxx +++ b/Time/sunpos.cxx @@ -50,7 +50,7 @@ #include
#include #include -#include +#include #include #include @@ -276,6 +276,7 @@ void fgUpdateSunPos( void ) { fgTIME *t; fgVIEW *v; MAT3vec nup, nsun, v0; + fgPolarPoint3d p; double sun_gd_lat, sl_radius; double ntmp; @@ -290,7 +291,10 @@ void fgUpdateSunPos( void ) { fgGeodToGeoc(sun_gd_lat, 0.0, &sl_radius, &l->sun_gc_lat); - l->fg_sunpos = fgPolarToCart(l->sun_lon, l->sun_gc_lat, sl_radius); + p.lon = l->sun_lon; + p.lat = l->sun_gc_lat; + p.radius = sl_radius; + l->fg_sunpos = fgPolarToCart3d(p); printf( " t->cur_time = %ld\n", t->cur_time); printf( " Sun Geodetic lat = %.5f Geocentric lat = %.5f\n", @@ -346,6 +350,10 @@ void fgUpdateSunPos( void ) { // $Log$ +// Revision 1.8 1998/05/02 01:53:18 curt +// Fine tuning mktime() support because of varying behavior on different +// platforms. +// // Revision 1.7 1998/04/30 12:36:05 curt // C++-ifying a couple source files. // -- 2.39.2