# include <sys/time.h> // for get/setitimer, gettimeofday, struct timeval
#endif
-#include <Astro/orbits.hxx>
-#include <Astro/sun.hxx>
+#ifdef WIN32
+# include <windows.h>
+# ifdef __CYGWIN32__
+# define NEAR /* */
+# define FAR /* */
+# endif
+# include <mmsystem.h>
+#endif
+
#include <Astro/sky.hxx>
+#include <Astro/solarsystem.hxx>
#include <Debug/fg_debug.h>
-#include <Flight/flight.h>
+#include <Flight/flight.hxx>
#include <Include/fg_constants.h>
#include <Main/options.hxx>
#include <Time/light.hxx>
// Force an update of the sky and lighting parameters
static void local_update_sky_and_lighting_params( void ) {
- fgSunInit();
+ // fgSunInit();
+ SolarSystem::theSolarSystem->rebuild();
cur_light_params.Update();
fgSkyColorsInit();
}
// Portability wrap to get current time.
void timestamp(fg_timestamp *timestamp) {
-#if defined( HAVE_GETTIMEOFDAY )
+#if defined( WIN32 )
+ unsigned int t;
+ t = timeGetTime();
+ timestamp->seconds = 0;
+ timestamp->millis = t;
+#elif defined( HAVE_GETTIMEOFDAY )
struct timeval current;
struct timezone tz;
// fg_timestamp currtime;
// Return duration in millis from first to last
long timediff(fg_timestamp *first, fg_timestamp *last) {
- return 1000 * (last->seconds - first->seconds) +
- (last->millis - first->millis);
+#if defined( WIN32 )
+ return (last->millis - first->millis);
+#else
+ return ( 1000 * (last->seconds - first->seconds) +
+ (last->millis - first->millis) );
+#endif
}
// Return new timestamp given a time stamp and an interval to add in
void timesum(fg_timestamp *res, fg_timestamp *start, long millis) {
+#ifdef WIN32
+ res->seconds = 0;
+ res->millis = ( start->millis + millis );
+#else
res->seconds = start->seconds +
( start->millis + millis ) / 1000;
res->millis = ( start->millis + millis ) % 1000;
+#endif
}
// $Log$
+// Revision 1.19 1998/10/17 01:34:29 curt
+// C++ ifying ...
+//
+// Revision 1.18 1998/10/02 21:36:09 curt
+// Fixes to try to break through the win95/98 18.3 fps barrier.
+//
+// Revision 1.17 1998/09/15 04:27:49 curt
+// Changes for new astro code.
+//
// Revision 1.16 1998/08/29 13:11:32 curt
// Bernie Bright writes:
// I've created some new classes to enable pointers-to-functions and