]> git.mxchange.org Git - flightgear.git/commitdiff
Tweaks to get things to compile with gcc-win32.
authorcurt <curt>
Tue, 23 Sep 1997 00:29:27 +0000 (00:29 +0000)
committercurt <curt>
Tue, 23 Sep 1997 00:29:27 +0000 (00:29 +0000)
Cockpit/hud.c
Main/GLUTmain.c
Main/fg_init.c
Scenery/stars.c
Simulator/Makefile
Simulator/make.inc
Time/fg_time.c

index 33a00435515edcaf7b9959167501f16a55704e72..207a7983099181e222f6c01c1e2ed367497e684d 100644 (file)
@@ -551,6 +551,7 @@ Hptr fgHUDInit( struct AIRCRAFT current_aircraft, int color )
 Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, \
                                                int hole_len, double (*load_value)() )
 {
+#ifndef WIN32
        struct HUD_horizon *horizon;
        struct HUD_instr *instrument;
        HIptr tmp_first, tmp_next;
@@ -581,11 +582,13 @@ Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, \
        hud->instruments = instrument;
 
        return( hud );
+#endif
 }
 
 Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \
                                        int orientation, int with_min, int min_value, int width_units, double (*load_value)() )
 {
+#ifndef WIN32
        struct HUD_scale *scale;
        struct HUD_instr *instrument;
        HIptr tmp_first, tmp_next;
@@ -622,11 +625,13 @@ Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, i
        hud->instruments = instrument;
 
        return( hud );
+#endif
 }
 
 Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \
                                        char *pre_str, char *post_str, char *format, double (*load_value)() )
 {
+#ifndef WIN32
        struct HUD_label *label;
        struct HUD_instr *instrument;
        HIptr tmp_first, tmp_next;
@@ -661,12 +666,14 @@ Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int jus
        hud->instruments = instrument;
 
        return( hud );
+#endif
 }
 
 Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_height, \
                                        int hole_len, int div_units, int label_pos, int width_units, \
                                        double (*load_roll)(), double (*load_pitch)() )
 {
+#ifndef WIN32
        struct HUD_ladder *ladder;
        struct HUD_instr *instrument;
        HIptr tmp_first, tmp_next;
@@ -703,6 +710,7 @@ Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_heig
        hud->instruments = instrument;
 
        return( hud );
+#endif
 }
 
 /*
@@ -799,9 +807,12 @@ void fgUpdateHUD( Hptr hud )
 
 
 /* $Log$
-/* Revision 1.3  1997/09/05 14:17:26  curt
-/* More tweaking with stars.
+/* Revision 1.4  1997/09/23 00:29:32  curt
+/* Tweaks to get things to compile with gcc-win32.
 /*
+ * Revision 1.3  1997/09/05 14:17:26  curt
+ * More tweaking with stars.
+ *
  * Revision 1.2  1997/09/04 02:17:30  curt
  * Shufflin' stuff.
  *
index c5a21745b24da5337052b9085e11d8f7a7015261..7ecd89eab0978e8e9cce1288c6c8fdb8470cf755 100644 (file)
@@ -192,7 +192,7 @@ static void fgUpdateViewParams() {
 
     sky = 0.85 * pow(1.2, -x_8 / 20.0) + 0.15;
 
-    sky = 0.15; /* force a dark sky (for testing) */
+    /* sky = 0.15; */ /* to force a dark sky (for testing) */
 
     if ( ambient < 0.1 ) { ambient = 0.1; }
     if ( diffuse < 0.0 ) { diffuse = 0.0; }
@@ -577,9 +577,12 @@ int main( int argc, char *argv[] ) {
 
 
 /* $Log$
-/* Revision 1.20  1997/09/22 14:44:19  curt
-/* Continuing to try to align stars correctly.
+/* Revision 1.21  1997/09/23 00:29:38  curt
+/* Tweaks to get things to compile with gcc-win32.
 /*
+ * Revision 1.20  1997/09/22 14:44:19  curt
+ * Continuing to try to align stars correctly.
+ *
  * Revision 1.19  1997/09/18 16:20:08  curt
  * At dusk/dawn add/remove stars in stages.
  *
index 4c97095ac804742586cd2283f801016948d871d0..1b7950e851bca2016cecd922b158cf6fcb8df43b 100644 (file)
@@ -111,8 +111,9 @@ void fgInitSubsystems( void ) {
     /* FG_Latitude  = (  45.15 ) * DEG_TO_RAD; */
     /* FG_Altitude = FG_Runway_altitude + 3.758099; */
 
-    FG_Longitude = ( -583200.00 / 3600.0 ) * DEG_TO_RAD;
-    FG_Latitude  = (  110808.41 / 3600.0 ) * DEG_TO_RAD;
+    /* A random test position */
+    /* FG_Longitude = ( 88128.00 / 3600.0 ) * DEG_TO_RAD; */
+    /* FG_Latitude  = ( 93312.00 / 3600.0 ) * DEG_TO_RAD; */
 
     printf("Initial position is: (%.4f, %.4f, %.2f)\n", 
           FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, 
@@ -215,9 +216,12 @@ void fgInitSubsystems( void ) {
 
 
 /* $Log$
-/* Revision 1.8  1997/09/22 14:44:20  curt
-/* Continuing to try to align stars correctly.
+/* Revision 1.9  1997/09/23 00:29:39  curt
+/* Tweaks to get things to compile with gcc-win32.
 /*
+ * Revision 1.8  1997/09/22 14:44:20  curt
+ * Continuing to try to align stars correctly.
+ *
  * Revision 1.7  1997/09/16 15:50:30  curt
  * Working on star alignment and time issues.
  *
index fb2f67beb38dd1921884acdcd7e1828eaf938c2d..c6e889c041909f145aab21a8f8296b957f7a12ce 100644 (file)
@@ -213,7 +213,7 @@ void fgStarsRender() {
 
     /* FG_PI_2 + 0.1 is about 6 degrees after sundown and before sunrise */
 
-    t->sun_angle = 3.0; /* force stars (for testing) */
+    /* t->sun_angle = 3.0; */ /* to force stars to be drawn (for testing) */
 
     if ( t->sun_angle > (FG_PI_2 + 5 * DEG_TO_RAD ) ) {
        /* determine which star structure to draw */
@@ -254,9 +254,12 @@ void fgStarsRender() {
 
 
 /* $Log$
-/* Revision 1.11  1997/09/22 14:44:21  curt
-/* Continuing to try to align stars correctly.
+/* Revision 1.12  1997/09/23 00:29:43  curt
+/* Tweaks to get things to compile with gcc-win32.
 /*
+ * Revision 1.11  1997/09/22 14:44:21  curt
+ * Continuing to try to align stars correctly.
+ *
  * Revision 1.10  1997/09/20 03:34:32  curt
  * Still trying to get those durned stars aligned properly.
  *
index 96e80aa28331ffd05ceba3d6ce6d7d2acc500c48..01a2cbaac4a42157be126c3182afabaefed6bde4 100644 (file)
@@ -82,7 +82,7 @@ bin-tar: all
        tar cvzf bin-$(VERSION).tar.gz FlightGear/fgtop FlightGear/fg0 \
        FlightGear/runfg FlightGear/COPYING FlightGear/Docs FlightGear/Thanks)
 
-bin-zip: all
+bin-zip: 
        cp GLUT/fg0.exe GLUT/runfg.bat GLUT/cygwin.dll ..
        (cd ../..; \
        zip -r bin-$(VERSION).zip FlightGear/fgtop FlightGear/fg0.exe \
@@ -92,6 +92,9 @@ bin-zip: all
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.27  1997/09/23 00:29:27  curt
+# Tweaks to get things to compile with gcc-win32.
+#
 # Revision 1.26  1997/09/04 02:17:18  curt
 # Shufflin' stuff.
 #
index 19e926ac5452a1b04d31f79649bc3e89818b36fa..5adadbacac5c7a3f60ccf371a09b9f75cc91a907 100644 (file)
@@ -98,28 +98,31 @@ GLOBAL_CFLAGS = -g -Wall -DVERSION=\"$(VERSION)\"
 #---------------------------------------------------------------------------
 # Linux/Mesa with the GLUT toolkit
 #
-INTERFACE_FLAGS = -DGLUT
-INTERFACE_LIBS = -lglut
-INTERFACE_FILES = GLUTmain.c GLUTkey.c
-MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
-X11_LIBS =  -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
-GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
-FG_CFLAGS = $(GLOBAL_CFLAGS)
+INTERFACE_FLAGS = -DGLUT
+INTERFACE_LIBS = -lglut
+INTERFACE_FILES = GLUTmain.c GLUTkey.c
+MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
+X11_LIBS =  -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
+GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
+FG_CFLAGS = $(GLOBAL_CFLAGS)
 #---------------------------------------------------------------------------
 
 #---------------------------------------------------------------------------
 # Cygnus Win32 (gcc based) with a static version of the GLUT toolkit
 #
-INTERFACE_FLAGS = -DGLUT 
-INTERFACE_LIBS = ../Win32/libglut.a
-INTERFACE_FILES = GLUTmain.c GLUTkey.c
-GRAPHICS_LIBS = -lglu32 -lopengl32 -luser32 -lgdi32
-FG_CFLAGS = $(GLOBAL_CFLAGS) -DWIN32 -DUSE_RAND
+INTERFACE_FLAGS = -DGLUT 
+INTERFACE_LIBS = ../Win32/libglut.a
+INTERFACE_FILES = GLUTmain.c GLUTkey.c
+GRAPHICS_LIBS = -lglu32 -lopengl32 -luser32 -lgdi32
+FG_CFLAGS = $(GLOBAL_CFLAGS) -DWIN32 -DUSE_RAND
 #---------------------------------------------------------------------------
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.15  1997/09/23 00:29:27  curt
+# Tweaks to get things to compile with gcc-win32.
+#
 # Revision 1.14  1997/09/16 22:14:47  curt
 # Tweaked time of day lighting equations.  Don't draw stars during the day.
 #
index 4b9c23075fd91d9b7ece5014fd4fec4c0b3eb825..e05c870d5e9b97eca7d7c497317656e3e77f7bc2 100644 (file)
 #include <stdlib.h>
 #include <time.h>
 
+#ifdef WIN32
+#include <sys/time.h> /* for gettimeofday() */
+#include <unistd.h>   /* for gettimeofday() */
+#endif
+
 #include "fg_time.h"
 #include "../constants.h"
 #include "../Flight/flight.h"
@@ -152,6 +157,14 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
     long int offset;
     double diff, part, days, hours, lst;
 
+#ifdef WIN32
+    int daylight;
+    long int timezone;
+
+    struct timeval tv;
+    struct timezone tz;
+#endif
+
     printf("COURSE: GMT = %d/%d/%2d %d:%02d:%02d\n", 
            gmt->tm_mon, gmt->tm_mday, gmt->tm_year,
            gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
@@ -165,6 +178,18 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
 
     start = mktime(&mt);
 
+#ifdef WIN32
+    daylight = mt.tm_isdst;
+    gettimeofday(&tv, &tz);
+    timezone = tz.tz_minuteswest * 60;
+#endif
+
+    if ( daylight > 0 ) {
+       daylight = 1;
+    } else if ( daylight < 0 ) {
+       printf("OOOPS, big time problem in fg_time.c, no daylight savings info.\n");
+    }
+
     offset = -(timezone / 3600 - daylight);
 
     printf("Raw time zone offset = %ld\n", timezone);
@@ -259,9 +284,12 @@ void fgTimeUpdate(struct FLIGHT *f, struct fgTIME *t) {
 
 
 /* $Log$
-/* Revision 1.6  1997/09/20 03:34:34  curt
-/* Still trying to get those durned stars aligned properly.
+/* Revision 1.7  1997/09/23 00:29:50  curt
+/* Tweaks to get things to compile with gcc-win32.
 /*
+ * Revision 1.6  1997/09/20 03:34:34  curt
+ * Still trying to get those durned stars aligned properly.
+ *
  * Revision 1.5  1997/09/16 22:14:52  curt
  * Tweaked time of day lighting equations.  Don't draw stars during the day.
  *