]> git.mxchange.org Git - flightgear.git/blobdiff - Time/fg_time.cxx
Renamed class fgFLIGHT to class FGState as per request by JSB.
[flightgear.git] / Time / fg_time.cxx
index d872690f8527740df34ed58c8ddb3de26176c727..11cb3b9a359fd9a7e98c21a1ee14eb928fc983cc 100644 (file)
@@ -97,61 +97,6 @@ void fgTimeInit(fgTIME *t) {
 }
 
 
-/*
-// Portability wrap to get current time.
-void timestamp(fg_timestamp *timestamp) {
-#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;
-    gettimeofday(&current, &tz);
-    timestamp->seconds = current.tv_sec;
-    timestamp->millis = current.tv_usec / 1000;
-#elif defined( HAVE_GETLOCALTIME )
-    SYSTEMTIME current;
-    GetLocalTime(&current);
-    timestamp->seconds = current.wSecond;
-    timestamp->millis = current.wMilliseconds;
-#elif defined( HAVE_FTIME )
-    struct timeb current;
-    ftime(&current);
-    timestamp->seconds = current.time;
-    timestamp->millis = current.millitm;
-#else
-# error Port me
-#endif
-}
-
-
-// Return duration in millis from first to last
-long timediff(fg_timestamp *first, fg_timestamp *last) {
-#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
-}
-*/
-
 // given a date in months, mn, days, dy, years, yr, return the
 // modified Julian date (number of days elapsed since 1900 jan 0.5),
 // mjd.  Adapted from Xephem.
@@ -387,7 +332,7 @@ double sidereal_course(fgTIME *t, double lng) {
 
 
 // Update time variables such as gmt, julian date, and sidereal time
-void fgTimeUpdate(fgFLIGHT *f, fgTIME *t) {
+void fgTimeUpdate(FGState *f, fgTIME *t) {
     double gst_precise, gst_course;
 
     FG_LOG( FG_EVENT, FG_DEBUG, "Updating time" );
@@ -453,6 +398,13 @@ void fgTimeUpdate(fgFLIGHT *f, fgTIME *t) {
 
 
 // $Log$
+// Revision 1.26  1998/12/05 15:54:28  curt
+// Renamed class fgFLIGHT to class FGState as per request by JSB.
+//
+// Revision 1.25  1998/12/05 14:21:30  curt
+// Moved struct fg_timestamp to class fgTIMESTAMP and moved it's definition
+// to it's own file, timestamp.hxx.
+//
 // Revision 1.24  1998/12/04 01:32:49  curt
 // Converted "struct fg_timestamp" to "class fgTIMESTAMP" and added some
 // convenience inline operators.