]> git.mxchange.org Git - flightgear.git/commitdiff
Fine tuning mktime() support because of varying behavior on different
authorcurt <curt>
Sat, 2 May 1998 01:53:17 +0000 (01:53 +0000)
committercurt <curt>
Sat, 2 May 1998 01:53:17 +0000 (01:53 +0000)
platforms.

Time/fg_time.cxx
Time/light.hxx
Time/sunpos.cxx

index a4f85d5929424b55b32892d7eebf549b05c24058..e1a4afc600abcf704c5c031b6b97cd5883d81cd9 100644 (file)
@@ -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
index 1cb5d02bc0a847a1067912d4e31f6348c05d6486..e0f7f34765ecf2c4aa3f8553b732aed5a781225f 100644 (file)
@@ -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 <config.h>" in "#ifdef HAVE_CONFIG_H"
 // Fog color fixes.
index bac2b574802fbeacb7adcd051d43cb2518c41eef..0f087b732263a1a0e46e2cb150502181f428d50d 100644 (file)
@@ -50,7 +50,7 @@
 #include <Main/views.hxx>
 #include <Math/fg_geodesy.h>
 #include <Math/mat3.h>
-#include <Math/polar.h>
+#include <Math/polar3d.h>
 #include <Math/vector.h>
 #include <Scenery/scenery.hxx>
 
@@ -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.
 //