]> git.mxchange.org Git - flightgear.git/commitdiff
Tons of little changes to clean up the code and to remove fatal errors
authorcurt <curt>
Mon, 19 Jan 1998 18:40:15 +0000 (18:40 +0000)
committercurt <curt>
Mon, 19 Jan 1998 18:40:15 +0000 (18:40 +0000)
when building with the c++ compiler.

59 files changed:
Astro/depend
Astro/moon.c
Astro/moon.h
Astro/sky.c
Astro/sky.h
Astro/stars.c
Astro/stars.h
Astro/sun.c
Astro/sun.h
Cockpit/cockpit.c
Cockpit/cockpit.h
Cockpit/depend
Cockpit/hud.c
Cockpit/hud.h
Controls/controls.c
Controls/controls.h
FDM/flight.c
LaRCsim/atmos_62.c
LaRCsim/default_model_routines.c
LaRCsim/depend
LaRCsim/ls_accel.c
LaRCsim/ls_aux.c
LaRCsim/ls_geodesy.c
LaRCsim/ls_gravity.c
LaRCsim/ls_init.c
LaRCsim/ls_interface.c
LaRCsim/ls_interface.h
LaRCsim/ls_model.c
LaRCsim/ls_step.c
LaRCsim/mymain.c
LaRCsim/navion_aero.c
LaRCsim/navion_engine.c
LaRCsim/navion_gear.c
LaRCsim/navion_init.c
Main/GLUTmain.c
Main/depend
Main/fg_init.c
Scenery/depend
Scenery/geometry.c
Scenery/geometry.h
Scenery/mesh.c
Scenery/mesh.h
Scenery/scenery.c
Scenery/scenery.h
Scenery/tilemgr.c
Scenery/tilemgr.h
Simulator/Todo
Simulator/make.inc
Slew/slew.c
Slew/slew.h
Time/depend
Time/event.c
Time/event.h
Time/fg_timer.c
Time/fg_timer.h
Time/sunpos.c
Time/sunpos.h
Weather/weather.c
Weather/weather.h

index f73a25397f5ed005ecaaeab3ba53286f072b676c..223726e34dd1729dadc74b6eac79da513cbf38ab 100644 (file)
@@ -8,6 +8,17 @@ moon.o: moon.c ../XGL/xgl.h orbits.h ../Time/fg_time.h \
  ../Include/general.h ../Main/views.h ../Main/../Include/types.h \
  ../Main/../Flight/flight.h ../Main/../Math/mat3.h \
  ../Main/../Time/fg_time.h
+old_astro.o: old_astro.c ../XGL/xgl.h old_astro.h stars.h moon.h \
+ orbits.h ../Time/fg_time.h ../Time/../Include/types.h \
+ ../Time/../Flight/flight.h ../Time/../Flight/Slew/slew.h \
+ ../Time/../Flight/LaRCsim/ls_interface.h \
+ ../Time/../Flight/LaRCsim/../flight.h planets.h sun.h \
+ ../Include/constants.h ../Include/general.h ../Main/views.h \
+ ../Main/../Include/types.h ../Main/../Flight/flight.h \
+ ../Main/../Math/mat3.h ../Main/../Time/fg_time.h \
+ ../Aircraft/aircraft.h ../Aircraft/../Flight/flight.h \
+ ../Aircraft/../Controls/controls.h \
+ ../Aircraft/../Controls/../Include/limits.h
 orbits.o: orbits.c orbits.h ../Time/fg_time.h \
  ../Time/../Include/types.h ../Time/../Flight/flight.h \
  ../Time/../Flight/Slew/slew.h \
index aa99c92dd9cbd0c79594039a46d61228f2055aee..227743e9302e78fefa371525fde7c3d37f8b549a 100644 (file)
@@ -257,7 +257,7 @@ struct CelestialCoord fgCalculateMoon(struct OrbElements params,
 }
 
 
-void fgMoonInit() {
+void fgMoonInit( void ) {
     struct fgLIGHT *l;
     static int dl_exists = 0;
 
@@ -298,7 +298,7 @@ void fgMoonInit() {
 
 
 /* Draw the moon */
-void fgMoonRender() {
+void fgMoonRender( void ) {
     struct fgLIGHT *l;
     GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
 
@@ -320,9 +320,13 @@ void fgMoonRender() {
 
 
 /* $Log$
-/* Revision 1.1  1998/01/07 03:16:16  curt
-/* Moved from .../Src/Scenery/ to .../Src/Astro/
+/* Revision 1.2  1998/01/19 18:40:16  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.1  1998/01/07 03:16:16  curt
+ * Moved from .../Src/Scenery/ to .../Src/Astro/
+ *
  * Revision 1.16  1998/01/06 01:20:24  curt
  * Tweaks to help building with MSVC++
  *
index c4d21ed20159927da39edb1d2c5c5e0763472742..90a94f98e7d0d7b59295159ddb69cacdc3819c17 100644 (file)
 
 
  /* Initialize the Moon Display management Subsystem */
-void fgMoonInit();
+void fgMoonInit( void );
 
 /* Draw the Stars */
-void fgMoonRender();
+void fgMoonRender( void );
 
 struct CelestialCoord fgCalculateMoon(struct OrbElements Params,
                                       struct OrbElements sunParams,
@@ -51,9 +51,13 @@ extern struct OrbElements pltOrbElements[9];
 
 
 /* $Log$
-/* Revision 1.1  1998/01/07 03:16:16  curt
-/* Moved from .../Src/Scenery/ to .../Src/Astro/
+/* Revision 1.2  1998/01/19 18:40:17  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.1  1998/01/07 03:16:16  curt
+ * Moved from .../Src/Scenery/ to .../Src/Astro/
+ *
  * Revision 1.4  1997/12/11 04:43:56  curt
  * Fixed sun vector and lighting problems.  I thing the moon is now lit
  * correctly.
index 4de37c7369d10e2fbf7beaf02ed1b824c363d00c..a7a7b098c6d38a66eaf9c344513363e069b2fab0 100644 (file)
@@ -72,7 +72,7 @@ static float outer_color[12][4];
 
 
 /* Calculate the sky structure vertices */
-void fgSkyVerticesInit() {
+void fgSkyVerticesInit( void ) {
     float theta;
     int i;
 
@@ -101,7 +101,7 @@ void fgSkyVerticesInit() {
 
 
 /* (Re)calculate the sky colors at each vertex */
-void fgSkyColorsInit() {
+void fgSkyColorsInit( void ) {
     struct fgLIGHT *l;
     float sun_angle, diff;
     float outer_param[3], outer_amt[3], outer_diff[3];
@@ -224,7 +224,7 @@ void fgSkyColorsInit() {
 
 
 /* Initialize the sky structure and colors */
-void fgSkyInit() {
+void fgSkyInit( void ) {
     printf("Initializing the sky\n");
 
     fgSkyVerticesInit();
@@ -236,7 +236,7 @@ void fgSkyInit() {
 
 
 /* Draw the Sky */
-void fgSkyRender() {
+void fgSkyRender( void ) {
     struct fgFLIGHT *f;
     struct fgLIGHT *l;
     struct fgVIEW *v;
@@ -329,9 +329,13 @@ void fgSkyRender() {
 
 
 /* $Log$
-/* Revision 1.1  1998/01/07 03:16:19  curt
-/* Moved from .../Src/Scenery/ to .../Src/Astro/
+/* Revision 1.2  1998/01/19 18:40:17  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.1  1998/01/07 03:16:19  curt
+ * Moved from .../Src/Scenery/ to .../Src/Astro/
+ *
  * Revision 1.11  1997/12/30 22:22:38  curt
  * Further integration of event manager.
  *
index 7ba4863e3d914a6eed7da68bcb5f9cbab1d0736b..0479a4b96c186ca87c1da9d20c08fd308ce573af 100644 (file)
 
 
 /* (Re)generate the display list */
-void fgSkyInit();
+void fgSkyInit( void );
 
 /* (Re)calculate the sky colors at each vertex */
-void fgSkyColorsInit();
+void fgSkyColorsInit( void );
 
 /* Draw the Sky */
-void fgSkyRender();
+void fgSkyRender( void );
 
 
 /* $Log$
-/* Revision 1.1  1998/01/07 03:16:19  curt
-/* Moved from .../Src/Scenery/ to .../Src/Astro/
+/* Revision 1.2  1998/01/19 18:40:17  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.1  1998/01/07 03:16:19  curt
+ * Moved from .../Src/Scenery/ to .../Src/Astro/
+ *
  * Revision 1.2  1997/12/22 23:45:49  curt
  * First stab at sunset/sunrise sky glow effects.
  *
index 6d3d4a53e94e15b0f73170a97997fc60b91b11f4..711a9a06bffd88e8ec658d5b04c44a0d6444e212 100644 (file)
@@ -56,7 +56,7 @@
 
 
 /* Initialize the Star Management Subsystem */
-void fgStarsInit() {
+void fgStarsInit( void ) {
     FILE *fd;
     struct fgGENERAL *g;
     struct CelestialCoord pltPos;
@@ -237,7 +237,7 @@ void fgStarsInit() {
 
 
 /* Draw the Stars */
-void fgStarsRender() {
+void fgStarsRender( void ) {
     struct fgFLIGHT *f;
     struct fgVIEW *v;
     struct fgLIGHT *l;
@@ -276,9 +276,13 @@ void fgStarsRender() {
 
 
 /* $Log$
-/* Revision 1.1  1998/01/07 03:16:20  curt
-/* Moved from .../Src/Scenery/ to .../Src/Astro/
+/* Revision 1.2  1998/01/19 18:40:18  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.1  1998/01/07 03:16:20  curt
+ * Moved from .../Src/Scenery/ to .../Src/Astro/
+ *
  * Revision 1.24  1997/12/30 22:22:39  curt
  * Further integration of event manager.
  *
index 19524e12084b3aa9af4ec9ad68a147b8ddfbbda4..b08ffda9502d86cb44cc27a53d9c514dc8c672bf 100644 (file)
 #define FG_MIN_STAR_MAG 0.738750 /* magnitude of weakest star we'll display */
 
 /* Initialize the Star Management Subsystem */
-void fgStarsInit();
+void fgStarsInit( void );
 
 /* Draw the Stars */
-void fgStarsRender();
+void fgStarsRender( void );
 extern struct OrbElements pltOrbElements[9];
 extern struct fgTIME cur_time_params;
 
@@ -44,9 +44,13 @@ extern struct fgTIME cur_time_params;
 
 
 /* $Log$
-/* Revision 1.1  1998/01/07 03:16:20  curt
-/* Moved from .../Src/Scenery/ to .../Src/Astro/
+/* Revision 1.2  1998/01/19 18:40:18  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.1  1998/01/07 03:16:20  curt
+ * Moved from .../Src/Scenery/ to .../Src/Astro/
+ *
  * Revision 1.6  1997/10/25 03:18:29  curt
  * Incorporated sun, moon, and planet position and rendering code contributed
  * by Durk Talsma.
index 43e2c353e100355aa803ffa946bda23aac185559..2c89ae3c1c58d22d10ec50bf6c8f9ed1078cc43c 100644 (file)
@@ -94,7 +94,7 @@ struct CelestialCoord fgCalculateSun(struct OrbElements params, struct fgTIME t)
 
 
 /* Initialize the Sun */
-void fgSunInit() {
+void fgSunInit( void ) {
     static int dl_exists = 0;
 
     printf("  Initializing the Sun\n");
@@ -126,7 +126,7 @@ void fgSunInit() {
 
 
 /* Draw the Sun */
-void fgSunRender() {
+void fgSunRender( void ) {
     struct fgVIEW *v;
     struct fgTIME *t;
     struct fgLIGHT *l;
@@ -190,9 +190,13 @@ void fgSunRender() {
 
 
 /* $Log$
-/* Revision 1.1  1998/01/07 03:16:20  curt
-/* Moved from .../Src/Scenery/ to .../Src/Astro/
+/* Revision 1.2  1998/01/19 18:40:18  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.1  1998/01/07 03:16:20  curt
+ * Moved from .../Src/Scenery/ to .../Src/Astro/
+ *
  * Revision 1.12  1998/01/05 18:44:36  curt
  * Add an option to advance/decrease time from keyboard.
  *
index 260101f76b9d4a438628766d23ac843091a9dbdd..9683462cc0bd7c8cd9c742cbfd332125a2fbcd29 100644 (file)
@@ -31,19 +31,23 @@ struct SunPos fgCalcSunPos(struct OrbElements sunParams);
 extern struct OrbElements pltOrbElements[9];
 
 /* Initialize the Sun */
-void fgSunInit();
+void fgSunInit( void );
 
 /* Draw the Sun */
-void fgSunRender();
+void fgSunRender( void );
 
 
 #endif /* SUN_H */
 
 
 /* $Log$
-/* Revision 1.1  1998/01/07 03:16:21  curt
-/* Moved from .../Src/Scenery/ to .../Src/Astro/
+/* Revision 1.2  1998/01/19 18:40:19  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.1  1998/01/07 03:16:21  curt
+ * Moved from .../Src/Scenery/ to .../Src/Astro/
+ *
  * Revision 1.3  1997/12/11 04:43:56  curt
  * Fixed sun vector and lighting problems.  I thing the moon is now lit
  * correctly.
index dae38487b4251cb20ec50967de1e7ba381bb3d5c..97b366cc0421f61133f1dc0e5e05a975a371f157 100644 (file)
@@ -79,7 +79,7 @@ struct fgCOCKPIT *fgCockpitAddHUD( struct fgCOCKPIT *cockpit, struct HUD *hud )
        cockpit->hud = hud;
 }
 
-void fgCockpitUpdate()
+void fgCockpitUpdate( void )
 {
 
        printf( "Cockpit: code %d   status %d\n", aircraft_cockpit->code, aircraft_cockpit->status );
@@ -90,9 +90,13 @@ void fgCockpitUpdate()
 
 
 /* $Log$
-/* Revision 1.4  1997/12/30 20:47:34  curt
-/* Integrated new event manager with subsystem initializations.
+/* Revision 1.5  1998/01/19 18:40:19  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.4  1997/12/30 20:47:34  curt
+ * Integrated new event manager with subsystem initializations.
+ *
  * Revision 1.3  1997/12/15 23:54:33  curt
  * Add xgl wrappers for debugging.
  * Generate terrain normals on the fly.
index be3aa7675c7eb13c1666eb4989cd1c832c013595..b8c032806968d24494234be9b7a3787cf1323a79 100644 (file)
@@ -39,14 +39,18 @@ struct fgCOCKPIT {
 };
 
 struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft );
-void fgCockpitUpdate();
+void fgCockpitUpdate( void );
 
 
 /* $Log$
-/* Revision 1.2  1997/12/10 22:37:39  curt
-/* Prepended "fg" on the name of all global structures that didn't have it yet.
-/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+/* Revision 1.3  1998/01/19 18:40:19  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.2  1997/12/10 22:37:39  curt
+ * Prepended "fg" on the name of all global structures that didn't have it yet.
+ * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+ *
  * Revision 1.1  1997/08/29 18:03:21  curt
  * Initial revision.
  *
index 1e0cb8cc7878d93aeeec6dfebaf8a3a39f0f799a..d5e9f450e0fe3204cf619b2e7820b456b47a56a0 100644 (file)
@@ -18,13 +18,3 @@ hud.o: hud.c hud.h ../Aircraft/aircraft.h \
  ../Scenery/scenery.h ../Scenery/../Include/types.h ../Math/mat3.h \
  ../Math/polar.h ../Math/../Include/types.h ../Time/fg_timer.h \
  ../Math/fg_random.h ../Weather/weather.h
-test.o: test.c test.h ../Aircraft/aircraft.h \
- ../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \
- ../Aircraft/../Flight/LaRCsim/ls_interface.h \
- ../Aircraft/../Flight/LaRCsim/../flight.h \
- ../Aircraft/../Controls/controls.h \
- ../Aircraft/../Controls/../Include/limits.h ../Flight/flight.h \
- ../Controls/controls.h ../Include/constants.h ../Scenery/mesh.h \
- ../Scenery/scenery.h ../Scenery/../Include/types.h ../Math/mat3.h \
- ../Math/polar.h ../Math/../Include/types.h ../Time/fg_timer.h \
- ../Math/fg_random.h ../Weather/weather.h
index ce189c1d36a63aed3cc432ffd14599e11b4b253b..0733aed6c27408111bc8dcdfcf2ece39c4c71fcd 100644 (file)
@@ -462,7 +462,7 @@ static void drawlabel( struct HUD_label label )
        
 }
 
-double get_speed()
+double get_speed( void )
 {
        struct fgFLIGHT *f;
               
@@ -470,7 +470,7 @@ double get_speed()
        return( FG_V_equiv_kts );
 }
 
-double get_aoa()
+double get_aoa( void )
 {
        struct fgFLIGHT *f;
               
@@ -478,7 +478,7 @@ double get_aoa()
        return( FG_Gamma_vert_rad*RAD_TO_DEG );
 }
 
-double get_roll()
+double get_roll( void )
 {
        struct fgFLIGHT *f;
               
@@ -486,7 +486,7 @@ double get_roll()
        return( FG_Phi );
 }
 
-double get_pitch()
+double get_pitch( void )
 {
        struct fgFLIGHT *f;
               
@@ -494,7 +494,7 @@ double get_pitch()
        return( FG_Theta );
 }
 
-double get_heading()
+double get_heading( void )
 {
        struct fgFLIGHT *f;
               
@@ -502,7 +502,7 @@ double get_heading()
        return( FG_Psi*RAD_TO_DEG ); 
 }
 
-double get_altitude()
+double get_altitude( void )
 {
        struct fgFLIGHT *f;
        double rough_elev;
@@ -551,7 +551,6 @@ Hptr fgHUDInit( struct fgAIRCRAFT 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;
@@ -571,7 +570,7 @@ Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, \
                return( NULL );
        
        instrument->type = ARTIFICIAL_HORIZON;
-       instrument->instr = *horizon;
+       instrument->instr.horizon = *horizon;
        instrument->instr.horizon.x_pos = x_pos;
        instrument->instr.horizon.y_pos = y_pos;
        instrument->instr.horizon.scr_width = length;
@@ -582,13 +581,11 @@ 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;
@@ -608,7 +605,7 @@ Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, i
                return( NULL );
        
        instrument->type = SCALE;
-       instrument->instr = *scale;
+       instrument->instr.scale = *scale;
        instrument->instr.scale.type = type;
        instrument->instr.scale.scr_pos = scr_pos;
        instrument->instr.scale.scr_min = scr_min;
@@ -625,13 +622,11 @@ 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;
@@ -651,7 +646,7 @@ Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int jus
                return( NULL );
        
        instrument->type = LABEL;
-       instrument->instr = *label;
+       instrument->instr.label = *label;
        instrument->instr.label.x_pos = x_pos;
        instrument->instr.label.y_pos = y_pos;
        instrument->instr.label.size = size;
@@ -666,14 +661,12 @@ 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;
@@ -693,7 +686,7 @@ Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_heig
                return( NULL );
 
        instrument->type = LADDER;
-       instrument->instr = *ladder;
+       instrument->instr.ladder = *ladder;
        instrument->instr.ladder.type = 0;      // Not used.
        instrument->instr.ladder.x_pos = x_pos;
        instrument->instr.ladder.y_pos = y_pos;
@@ -710,7 +703,6 @@ Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_heig
        hud->instruments = instrument;
 
        return( hud );
-#endif
 }
 
 /*
@@ -807,10 +799,14 @@ void fgUpdateHUD( Hptr hud )
 
 
 /* $Log$
-/* Revision 1.6  1997/12/15 23:54:34  curt
-/* Add xgl wrappers for debugging.
-/* Generate terrain normals on the fly.
+/* Revision 1.7  1998/01/19 18:40:20  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.6  1997/12/15 23:54:34  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
  * Revision 1.5  1997/12/10 22:37:39  curt
  * Prepended "fg" on the name of all global structures that didn't have it yet.
  * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
index 652bb838772e198e407cb41e35edab34cf2d8d93..f07ab2becf1cc185b3e8c115eebb0b07fe380dfd 100644 (file)
@@ -109,7 +109,7 @@ struct HUD_scale {
        int with_minimum;
        int minimum_value;
        int width_units;
-       double (*load_value)();
+       double (*load_value)( void );
 };
 
 struct HUD_circular_scale {
@@ -122,7 +122,7 @@ struct HUD_circular_scale {
        int orientation;
        int label_position;
        int width_units;
-       double (*load_value)();
+       double (*load_value)( void );
 };
 
 struct HUD_ladder {
@@ -135,8 +135,8 @@ struct HUD_ladder {
        int div_units;
        int label_position;
        int width_units;
-       double (*load_roll)();
-       double (*load_pitch)();
+       double (*load_roll)( void );
+       double (*load_pitch)( void );
 };
 
 struct HUD_circular_ladder {
@@ -147,7 +147,7 @@ struct HUD_circular_ladder {
        int orientation;
        int label_position;
        int width_units;
-       double (*load_value)();
+       double (*load_value)( void );
 };
 
 #define HORIZON_FIXED  1
@@ -159,7 +159,7 @@ struct HUD_horizon {
        int y_pos;
        int scr_width;
        int scr_hole;
-       double (*load_value)();
+       double (*load_value)( void );
 };
 
 #define LABEL_COUNTER  1
@@ -175,7 +175,7 @@ struct HUD_label {
        char *pre_str;
        char *post_str;
        char *format;
-       double (*load_value)();
+       double (*load_value)( void );
 };
 
 union HUD_instr_data {
@@ -208,14 +208,14 @@ struct HUD {
 typedef struct HUD *Hptr;
 
 Hptr fgHUDInit( struct fgAIRCRAFT cur_aircraft, int color );
-Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, double (*load_value)() );
+Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, double (*load_value)( void ) );
 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)() );
+                                       int orientation, int with_min, int min_value, int width_units, double (*load_value)( void ) );
 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)() );
+                                       char *pre_str, char *post_str, char *format, double (*load_value)( void ) );
 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 max_value, \
-                                       double (*load_roll)(), double (*load_pitch)() );
+                                       double (*load_roll)( void ), double (*load_pitch)( void ) );
                                        
                                        
                                        
@@ -225,7 +225,7 @@ struct HUD *fgHUDAddCircularLadder( Hptr hud, int scr_min, int scr_max, int div_
                                        int max_value, double *(load_value) );
 struct HUD *fgHUDAddNumDisp( Hptr hud, int x_pos, int y_pos, int size, int blink, \
                                        char *pre_str, char *post_str, double *(load_value) ); */
-void fgUpdateHUD();
+void fgUpdateHUD( Hptr hud );
 void fgUpdateHUD2( struct HUD *hud );
 
 
@@ -233,9 +233,13 @@ void fgUpdateHUD2( struct HUD *hud );
 
 
 /* $Log$
-/* Revision 1.3  1997/12/30 16:36:41  curt
-/* Merged in Durk's changes ...
+/* Revision 1.4  1998/01/19 18:40:21  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.3  1997/12/30 16:36:41  curt
+ * Merged in Durk's changes ...
+ *
  * Revision 1.2  1997/12/10 22:37:40  curt
  * Prepended "fg" on the name of all global structures that didn't have it yet.
  * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
index 6b2173e4d65e3701b8fbb53123abbecffaf9eaf0..aced6d24a5a61c0969356faca6cfeca2ca69fdfe 100644 (file)
@@ -28,7 +28,7 @@
 #include "../Aircraft/aircraft.h"
 
 
-void fgControlsInit() {
+void fgControlsInit( void ) {
     int i;
     struct fgCONTROLS *c;
     c = &current_aircraft.controls;
@@ -167,10 +167,14 @@ void fgThrottleSet(int engine, double pos) {
 
 
 /* $Log$
-/* Revision 1.4  1997/12/10 22:37:41  curt
-/* Prepended "fg" on the name of all global structures that didn't have it yet.
-/* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+/* Revision 1.5  1998/01/19 18:40:22  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.4  1997/12/10 22:37:41  curt
+ * Prepended "fg" on the name of all global structures that didn't have it yet.
+ * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+ *
  * Revision 1.3  1997/08/27 03:30:01  curt
  * Changed naming scheme of basic shared structures.
  *
index 6a03028eb3f52c499d53ee2fc5436cfeae4b5afa..d9f6ec5d16e3b78fe0685adc5f58072a8f2b7d65 100644 (file)
@@ -62,7 +62,7 @@ struct fgCONTROLS {
 */
 
 
-void fgControlsInit();
+void fgControlsInit( void );
 
 void fgElevMove(double amt);
 void fgElevSet(double pos);
@@ -81,10 +81,14 @@ void fgThrottleSet(int engine, double pos);
 
 
 /* $Log$
-/* Revision 1.7  1997/12/15 23:54:36  curt
-/* Add xgl wrappers for debugging.
-/* Generate terrain normals on the fly.
+/* Revision 1.8  1998/01/19 18:40:22  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.7  1997/12/15 23:54:36  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
  * Revision 1.6  1997/12/10 22:37:41  curt
  * Prepended "fg" on the name of all global structures that didn't have it yet.
  * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
index bd51d550061fd3152f96c48b575e6545b0609d40..f212c51a668a5034935eb41ff65cc91ebf1456a0 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <stdio.h>
 #include "flight.h"
+#include "LaRCsim/ls_interface.h"
 
 
 /* Initialize the flight model parameters */
@@ -67,9 +68,13 @@ int fgFlightModelUpdate(int model, struct fgFLIGHT *f, int multiloop) {
 
 
 /* $Log$
-/* Revision 1.6  1998/01/19 18:35:43  curt
-/* Minor tweaks and fixes for cygwin32.
+/* Revision 1.7  1998/01/19 18:40:23  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.6  1998/01/19 18:35:43  curt
+ * Minor tweaks and fixes for cygwin32.
+ *
  * Revision 1.5  1997/12/30 20:47:37  curt
  * Integrated new event manager with subsystem initializations.
  *
index f0ec1ab150345fec22d37ac2427a6624027c37fb..d50c98ad32f34e1c16575f26cd93353269c7428e 100644 (file)
@@ -59,6 +59,9 @@
 
 #include "ls_types.h"
 #include "ls_constants.h"
+
+#include "atmos_62.h"
+
 #include <math.h>
 
 #define        alt_0   d_a_table[index  ][0]
@@ -211,7 +214,7 @@ void ls_atmos( SCALAR altitude, SCALAR * sigma, SCALAR * v_sound,
        { 240000.,       1.08270E-07,    9.47120E+02,    0.00000E+00,    0.00000E+00    }
     };
     
-    index = altitude / 2000;
+    index = (int)( altitude / 2000 );
     if (index > (MAX_ALT_INDEX-2))
     {
      index = MAX_ALT_INDEX-2; /* limit maximum altitude */
index 65e72af77467cbf115203c6aca9952eb5e50b150..b888dba6cbfded2cffd547737d24eed94f7249b4 100644 (file)
 $Header$
 
 $Log$
+Revision 1.2  1998/01/19 18:40:23  curt
+Tons of little changes to clean up the code and to remove fatal errors
+when building with the c++ compiler.
+
 Revision 1.1  1997/05/29 00:09:53  curt
 Initial Flight Gear revision.
 
@@ -71,8 +75,12 @@ Initial Flight Gear revision.
 
 --------------------------------------------------------------------------*/
 
-void inertias()        {}
-void subsystems()      {}
+
+#include "ls_types.h"
+#include "default_model_routines.h"
+
+void inertias( SCALAR dt, int Initialize )     {}
+void subsystems( SCALAR dt, int Initialize )   {}
 /* void engine()       {} */
 /* void gear()         {} */
 
index b38be84dd41dcbc5ad3e272300cc9062d9394c30..de39a3ceb3e85d4fe4282a769cd45c3f1536c126 100644 (file)
@@ -1,25 +1,31 @@
 LaRCsim.o: LaRCsim.c ls_types.h ls_constants.h ls_generic.h \
  ls_sim_control.h ls_cockpit.h
-atmos_62.o: atmos_62.c ls_types.h ls_constants.h
-default_model_routines.o: default_model_routines.c
-ls_accel.o: ls_accel.c ls_types.h ls_generic.h ls_constants.h
-ls_aux.o: ls_aux.c ls_types.h ls_constants.h ls_generic.h
-ls_geodesy.o: ls_geodesy.c ls_types.h ls_constants.h
-ls_gravity.o: ls_gravity.c ls_types.h ls_constants.h
-ls_init.o: ls_init.c ls_types.h ls_sym.h ls_generic.h
+atmos_62.o: atmos_62.c ls_types.h ls_constants.h atmos_62.h
+default_model_routines.o: default_model_routines.c ls_types.h \
+ default_model_routines.h
+ls_accel.o: ls_accel.c ls_types.h ls_generic.h ls_constants.h \
+ ls_accel.h
+ls_aux.o: ls_aux.c ls_types.h ls_constants.h ls_generic.h ls_aux.h \
+ atmos_62.h ls_geodesy.h ls_gravity.h
+ls_geodesy.o: ls_geodesy.c ls_types.h ls_constants.h ls_geodesy.h
+ls_gravity.o: ls_gravity.c ls_types.h ls_constants.h ls_gravity.h
+ls_init.o: ls_init.c ls_types.h ls_sym.h ls_step.h ls_init.h \
+ navion_init.h ls_generic.h
 ls_interface.o: ls_interface.c ls_types.h ls_constants.h ls_generic.h \
  ls_sim_control.h ls_cockpit.h ls_interface.h ../flight.h \
- ../Slew/slew.h ../LaRCsim/ls_interface.h ../../Aircraft/aircraft.h \
+ ../Slew/slew.h ../LaRCsim/ls_interface.h ls_step.h ls_accel.h \
+ ls_aux.h ls_model.h ls_init.h ../../Aircraft/aircraft.h \
  ../../Aircraft/../Flight/flight.h \
  ../../Aircraft/../Controls/controls.h \
  ../../Aircraft/../Controls/../Include/limits.h
-ls_model.o: ls_model.c ls_types.h
-ls_step.o: ls_step.c ls_types.h ls_constants.h ls_generic.h
+ls_model.o: ls_model.c ls_types.h ls_model.h default_model_routines.h
+ls_step.o: ls_step.c ls_types.h ls_constants.h ls_generic.h ls_accel.h \
+ ls_aux.h ls_model.h ls_step.h ls_geodesy.h ls_gravity.h
 ls_sync.o: ls_sync.c ls_types.h ls_sim_control.h
 mymain.o: mymain.c ls_types.h ls_cockpit.h ls_generic.h
 navion_aero.o: navion_aero.c ls_types.h ls_generic.h ls_cockpit.h
 navion_engine.o: navion_engine.c ls_types.h ls_constants.h \
- ls_generic.h ls_cockpit.h ls_sim_control.h
+ ls_generic.h ls_sim_control.h ls_cockpit.h
 navion_gear.o: navion_gear.c ls_types.h ls_constants.h ls_generic.h \
  ls_cockpit.h
 navion_init.o: navion_init.c ls_types.h ls_generic.h ls_cockpit.h
index 172d2dafb41bdf8302a2640422921436f16fd84e..19fe7d3b28d8235b8e6cf0df304e0341cfed8eed 100644 (file)
            
 $Header$
 $Log$
+Revision 1.2  1998/01/19 18:40:24  curt
+Tons of little changes to clean up the code and to remove fatal errors
+when building with the c++ compiler.
+
 Revision 1.1  1997/05/29 00:09:53  curt
 Initial Flight Gear revision.
 
@@ -87,10 +91,10 @@ Initial Flight Gear revision.
 #include "ls_types.h"
 #include "ls_generic.h"
 #include "ls_constants.h"
+#include "ls_accel.h"
 #include <math.h>
 
-void ls_accel(  )
-{
+void ls_accel( void ) {
   
   SCALAR       inv_Mass, inv_Radius;
   SCALAR       ixz2, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10;
index b77f8df88d289b6cdae41740f08e62eb71d925ff..a372f2658453ae7cad887914229b412e62dea4fb 100644 (file)
 
 $Header$
 $Log$
+Revision 1.2  1998/01/19 18:40:24  curt
+Tons of little changes to clean up the code and to remove fatal errors
+when building with the c++ compiler.
+
 Revision 1.1  1997/05/29 00:09:54  curt
 Initial Flight Gear revision.
 
@@ -115,15 +119,22 @@ Initial Flight Gear revision.
 #include "ls_types.h"
 #include "ls_constants.h"
 #include "ls_generic.h"
+
+#include "ls_aux.h"
+
+#include "atmos_62.h"
+#include "ls_geodesy.h"
+#include "ls_gravity.h"
+
 #include <math.h>
 
-void   ls_aux()
-{
+
+void ls_aux( void ) {
 
        SCALAR  dx_pilot_from_cg, dy_pilot_from_cg, dz_pilot_from_cg;
-       SCALAR  inv_Mass;
+       /* SCALAR inv_Mass; */
        SCALAR  v_XZ_plane_2, signU, v_tangential;
-       SCALAR  inv_radius_ratio;
+       /* SCALAR inv_radius_ratio; */
        SCALAR  cos_rwy_hdg, sin_rwy_hdg;
        SCALAR  mach2, temp_ratio, pres_ratio;
        
index b083ee572fe884bd7e8a7a31cb5b29f8e0d35b26..89fbf1850587d6966fbd79def199b42af98abbbb 100644 (file)
 
 $Header$
 $Log$
+Revision 1.2  1998/01/19 18:40:25  curt
+Tons of little changes to clean up the code and to remove fatal errors
+when building with the c++ compiler.
+
 Revision 1.1  1997/05/29 00:09:56  curt
 Initial Flight Gear revision.
 
@@ -90,6 +94,7 @@ Initial Flight Gear revision.
 
 #include "ls_types.h"
 #include "ls_constants.h"
+#include "ls_geodesy.h"
 #include <math.h>
 
 /* ONE_SECOND is pi/180/60/60, or about 100 feet at earths' equator */
@@ -97,12 +102,8 @@ Initial Flight Gear revision.
 #define HALF_PI 0.5*PI
 
 
-void ls_geoc_to_geod(  lat_geoc, radius, lat_geod, alt, sea_level_r )
-     SCALAR lat_geoc;
-     SCALAR radius;
-     SCALAR *lat_geod;
-     SCALAR *alt;
-     SCALAR *sea_level_r;
+void ls_geoc_to_geod( SCALAR lat_geoc, SCALAR radius, SCALAR *lat_geod, 
+                     SCALAR *alt, SCALAR *sea_level_r )
 {
        SCALAR  t_lat, x_alpha, mu_alpha, delt_mu, r_alpha, l_point, rho_alpha;
        SCALAR  sin_mu_a, denom,delt_lambda, lambda_sl, sin_lambda_sl;
@@ -137,11 +138,9 @@ void ls_geoc_to_geod(  lat_geoc, radius, lat_geod, alt, sea_level_r )
          }
 }
 
-void ls_geod_to_geoc( lat_geod, alt, sl_radius, lat_geoc )
-    SCALAR lat_geod;
-    SCALAR alt;
-    SCALAR *sl_radius;
-    SCALAR *lat_geoc;
+
+void ls_geod_to_geoc( SCALAR lat_geod, SCALAR alt, 
+                     SCALAR *sl_radius, SCALAR *lat_geoc )
 {
     SCALAR lambda_sl, sin_lambda_sl, cos_lambda_sl, sin_mu, cos_mu, px, py;
     
index e146b5cb29472439deaad109f15129971678f460..8490e267aaf33101f6ae0438cf60cccd77f38e8a 100644 (file)
                                                                                
 $Header$
 $Log$
+Revision 1.2  1998/01/19 18:40:26  curt
+Tons of little changes to clean up the code and to remove fatal errors
+when building with the c++ compiler.
+
 Revision 1.1  1997/05/29 00:09:56  curt
 Initial Flight Gear revision.
 
@@ -71,6 +75,7 @@ Initial Flight Gear revision.
 --------------------------------------------------------------------------*/
 #include "ls_types.h"
 #include "ls_constants.h"
+#include "ls_gravity.h"
 #include <math.h>
 
 #define GM     1.4076431E16
index 583931c10e88a23b4e6129f79809a34d5a7d7558..b563e64688cf56bf617819f130a535107fbe6791 100644 (file)
 
 $Header$
 $Log$
+Revision 1.4  1998/01/19 18:40:26  curt
+Tons of little changes to clean up the code and to remove fatal errors
+when building with the c++ compiler.
+
 Revision 1.3  1998/01/05 22:19:25  curt
 #ifdef'd out some unused code that was problematic for MSVC++ to compile.
 
@@ -90,6 +94,9 @@ static char rcsid[] = "$Id$";
 #include <stdio.h>
 #include "ls_types.h"
 #include "ls_sym.h"
+#include "ls_step.h"
+#include "ls_init.h"
+#include "navion_init.h"
 
 /* temp */
 #include "ls_generic.h"
@@ -117,16 +124,16 @@ typedef struct
 
 extern SCALAR Simtime;
 
-static int Symbols_loaded = 0;
+/* static int Symbols_loaded = 0; */
 static int Number_of_Continuous_States = 0;
 static int Number_of_Discrete_States = 0;
 static cont_state_rec  Continuous_States[ MAX_NUMBER_OF_CONTINUOUS_STATES ];
 static disc_state_rec  Discrete_States[  MAX_NUMBER_OF_DISCRETE_STATES ];
 
 
-void ls_init_init()
-{
-    int i, error;
+void ls_init_init( void ) {
+    int i;
+    /* int error; */
 
     if (Number_of_Continuous_States == 0)
        {
@@ -178,9 +185,8 @@ void ls_init_init()
     */
 }
 
-void ls_init()
-{
-    int i;
+void ls_init( void ) {
+    /* int i; */
 
     Simtime = 0;
 
@@ -346,11 +352,10 @@ void ls_init_put_set( FILE *fp )
     return;
 }
 
-void ls_save_current_as_ic()
-{
+void ls_save_current_as_ic( void ) {
     /* Save current states as initial conditions */
 
-    int i, error;
+    /* int i, error; */
 
     /* commented out by CLO 
     for(i=0;i<Number_of_Continuous_States;i++)
index 32bbe8112e435bfc776fba05e6602013087b326c..5eb52d1fd4b2b98c848bb71589087c9438f85c94 100644 (file)
@@ -235,6 +235,11 @@ $Original log: LaRCsim.c,v $
 #include "ls_sim_control.h"
 #include "ls_cockpit.h"
 #include "ls_interface.h"
+#include "ls_step.h"
+#include "ls_accel.h"
+#include "ls_aux.h"
+#include "ls_model.h"
+#include "ls_init.h"
 #include "../flight.h"
 #include "../../Aircraft/aircraft.h"
 
@@ -271,8 +276,7 @@ static char  matname[MAX_FILE_NAME_LENGTH]  = "run.m";
 
 
 
-void ls_stamp()
-{
+void ls_stamp( void ) {
     char rcsid[] = "$Id$";
     char revid[] = "$Revision$";
     char dateid[] = "$Date$";
@@ -297,8 +301,7 @@ void ls_stamp()
     return;
 }
 
-void ls_setdefopts()
-{
+void ls_setdefopts( void ) {
     /* set default values for most options */
 
     sim_control_.debug = 0;            /* change to non-zero if in dbx! */
@@ -307,7 +310,6 @@ void ls_setdefopts()
     sim_control_.write_mat = 0;                /* write matrix-x/matlab script */
     sim_control_.write_tab = 0;                /* write tab delim. history file */
     sim_control_.write_asc1 = 0;       /* write GetData file */
-    sim_control_.sim_type = GLmouse;   /* hook up to mouse */
     sim_control_.save_spacing = DEFAULT_SAVE_SPACING;  
                                        /* interpolation on recording */
     sim_control_.write_spacing = DEFAULT_WRITE_SPACING;        
@@ -315,8 +317,8 @@ void ls_setdefopts()
     sim_control_.end_time = DEFAULT_END_TIME;
     sim_control_.model_hz = DEFAULT_MODEL_HZ;
     sim_control_.term_update_hz = DEFAULT_TERM_UPDATE_HZ;
-    sim_control_.time_slices = DEFAULT_END_TIME * DEFAULT_MODEL_HZ / 
-       DEFAULT_SAVE_SPACING;
+    sim_control_.time_slices = (long int)(DEFAULT_END_TIME * DEFAULT_MODEL_HZ / 
+       DEFAULT_SAVE_SPACING);
     sim_control_.paused = 0;
 
     speedup = 1.0;
@@ -482,12 +484,7 @@ int ls_checkopts(argc, argv)       /* check and set options flags */
 #endif /* COMPILE_THIS_CODE_THIS_USELESS_CODE */
 
 
-void ls_loop( dt, initialize )
-
-SCALAR dt;
-int initialize;
-
-{
+void ls_loop( SCALAR dt, int initialize ) {
     /* printf ("  In ls_loop()\n"); */
     ls_step( dt, initialize );
     /* if (sim_control_.sim_type == cockpit ) ls_ACES();  */
@@ -498,7 +495,7 @@ int initialize;
 
 
 
-int ls_cockpit() {
+int ls_cockpit( void ) {
     struct fgCONTROLS *c;
 
     sim_control_.paused = 0;
@@ -515,6 +512,7 @@ int ls_cockpit() {
     printf("%.4f,%.4f,%.2f  ", Latitude, Longitude, Altitude);
     printf("%.2f,%.2f,%.2f\n", Phi, Theta, Psi); */
 
+    return( 0 );
 }
 
 
@@ -734,6 +732,8 @@ int fgFlight_2_LaRCsim (struct fgFLIGHT *f) {
     X_pilot_rwy =       FG_X_pilot_rwy;
     Y_pilot_rwy =       FG_Y_pilot_rwy;
     H_pilot_rwy =       FG_H_pilot_rwy;
+
+    return( 0 );
 }
 
 
@@ -908,11 +908,17 @@ int fgLaRCsim_2_Flight (struct fgFLIGHT *f) {
     FG_X_pilot_rwy =    X_pilot_rwy;
     FG_Y_pilot_rwy =    Y_pilot_rwy;
     FG_H_pilot_rwy =    H_pilot_rwy;
+
+    return ( 0 );
 }
 
 /* Flight Gear Modification Log
  *
  * $Log$
+ * Revision 1.13  1998/01/19 18:40:26  curt
+ * Tons of little changes to clean up the code and to remove fatal errors
+ * when building with the c++ compiler.
+ *
  * Revision 1.12  1998/01/06 01:20:16  curt
  * Tweaks to help building with MSVC++
  *
index 93dc064bb89ea378a290d999709fa7b5b9176a8d..08d1e242a081eada593f258d351b8bcc61542381 100644 (file)
@@ -37,14 +37,24 @@ int fgLaRCsimInit(double dt);
 /* update position based on inputs, positions, velocities, etc. */
 int fgLaRCsimUpdate(int multiloop);
 
+/* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
+int fgFlight_2_LaRCsim (struct fgFLIGHT *f);
+
+/* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */
+int fgLaRCsim_2_Flight (struct fgFLIGHT *f);
+
 
 #endif /* LS_INTERFACE_H */
 
 
 /* $Log$
-/* Revision 1.3  1997/07/23 21:52:20  curt
-/* Put comments around the text after an #endif for increased portability.
+/* Revision 1.4  1998/01/19 18:40:27  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.3  1997/07/23 21:52:20  curt
+ * Put comments around the text after an #endif for increased portability.
+ *
  * Revision 1.2  1997/05/29 22:39:59  curt
  * Working on incorporating the LaRCsim flight model.
  *
index ff8fd20f17b24d9cbc658264542913ba44dc2d59..698b7c767a639448a3e70fc8c7c2bfc1aea11291 100644 (file)
        CURRENT RCS HEADER INFO:
 $Header$
 $Log$
+Revision 1.2  1998/01/19 18:40:27  curt
+Tons of little changes to clean up the code and to remove fatal errors
+when building with the c++ compiler.
+
 Revision 1.1  1997/05/29 00:09:58  curt
 Initial Flight Gear revision.
 
@@ -74,13 +78,14 @@ Initial Flight Gear revision.
 
 --------------------------------------------------------------------------*/
 #include "ls_types.h"
+#include "ls_model.h"
+#include "default_model_routines.h"
 
-void ls_model( SCALAR dt, int Initialize )
 
-{
-  inertias( dt, Initialize );
-  subsystems( dt, Initialize );
-  aero( dt, Initialize );
-  engine( dt, Initialize );
-  gear( dt, Initialize );
+void ls_model( SCALAR dt, int Initialize ) {
+    inertias( dt, Initialize );
+    subsystems( dt, Initialize );
+    aero( dt, Initialize );
+    engine( dt, Initialize );
+    gear( dt, Initialize );
 }
index 5f618f2023de133d7bba7ecfcc70ec981b941722..a58de794a6585a9d7c035daacfd7be98a7462e19 100644 (file)
 
 $Header$
 $Log$
+Revision 1.2  1998/01/19 18:40:28  curt
+Tons of little changes to clean up the code and to remove fatal errors
+when building with the c++ compiler.
+
 Revision 1.1  1997/05/29 00:09:59  curt
 Initial Flight Gear revision.
 
@@ -105,17 +109,18 @@ Initial Flight Gear revision.
 #include "ls_types.h"
 #include "ls_constants.h"
 #include "ls_generic.h"
+#include "ls_accel.h"
+#include "ls_aux.h"
+#include "ls_model.h"
+#include "ls_step.h"
+#include "ls_geodesy.h"
+#include "ls_gravity.h"
 /* #include "ls_sim_control.h" */
 #include <math.h>
 
 extern SCALAR Simtime;         /* defined in ls_main.c */
 
-void ls_step( dt, Initialize )
-
-SCALAR dt;
-int Initialize;
-
-{
+void ls_step( SCALAR dt, int Initialize ) {
        static  int     inited = 0;
                SCALAR  dth;
        static  SCALAR  v_dot_north_past, v_dot_east_past, v_dot_down_past;
@@ -178,7 +183,7 @@ int Initialize;
 /*     Initialize vehicle model                        */
 
                ls_aux();
-               ls_model();
+               ls_model(0.0, 0);
 
 /*     Calculate initial accelerations */
 
index 2d9acd9543bbf64afc7091430d5bfa3fb8e17971..b4ecbddeb05e59a29ed85dc1061452e4c4d028c2 100644 (file)
@@ -8,6 +8,6 @@
 COCKPIT cockpit_;
 GENERIC generic_;
 
-int main() {
+int main(int argc, char **argv) {
     model_init();
 }
index 18e1f3393c2fbfc829d03f2f3408b70932d869a7..6839e457c37de4371875bd3bd9c878522ce34a91 100644 (file)
@@ -112,8 +112,7 @@ ring is given below:
 extern COCKPIT cockpit_;
 
 
-void aero()
-{
+void aero( SCALAR dt, int Initialize ) {
   static int init = 0;
 
   SCALAR u, w;
@@ -123,7 +122,7 @@ void aero()
   static SCALAR yaw_scale  = -0.1;
   static SCALAR scale = 1.0;
   
-  static SCALAR trim_inc = 0.0002;
+  /* static SCALAR trim_inc = 0.0002; */
   /* static SCALAR long_trim; */
 
   static DATA U_0;
index 2110275ea4b23463c887b14fbc58b409b2f7a1ae..f84361f8b1fdab942a5cbbd2f4ccecc96fe0c2ae 100644 (file)
@@ -61,15 +61,15 @@ $Header$
 #include "ls_types.h"
 #include "ls_constants.h"
 #include "ls_generic.h"
-#include "ls_cockpit.h"
 #include "ls_sim_control.h"
+#include "ls_cockpit.h"
 
+extern SIM_CONTROL     sim_control_;
 
-void engine( SCALAR dt, int init )
-
-{
-    if (init || sim_control_.sim_type != cockpit) 
-       Throttle[3] = Throttle_pct;
+void engine( SCALAR dt, int init ) {
+    /* if (init) { */
+    Throttle[3] = Throttle_pct;
+    /* } */
 
     /* F_X_engine = Throttle[3]*813.4/0.2; */  /* original code */
     /* F_Z_engine = Throttle[3]*11.36/0.2; */  /* original code */
index e9c5b768a84d0ef68a6f34c32ff7bd91e1879338..a527159596d5ef01bba534911c5e1a679aaf5a7a 100644 (file)
 
 $Header$
 $Log$
+Revision 1.2  1998/01/19 18:40:29  curt
+Tons of little changes to clean up the code and to remove fatal errors
+when building with the c++ compiler.
+
 Revision 1.1  1997/05/29 00:10:02  curt
 Initial Flight Gear revision.
 
@@ -108,8 +112,7 @@ clear3( DATA v[] )
     v[0] = 0.; v[1] = 0.; v[2] = 0.;
 }
 
-gear()
-{
+void gear( SCALAR dt, int Initialize ) {
 char rcsid[] = "$Id$";
 
   /*
index 37aa1af96f45ef5b381b6fe62a564ffe2e780858..286c11d1a5ac9ee6af3f92dd3ec16db4cd8e58e3 100644 (file)
@@ -60,8 +60,7 @@
 #include "ls_generic.h"
 #include "ls_cockpit.h"
 
-void model_init()
-{
+void model_init( void ) {
 
   Throttle[3] = 0.2; Rudder_pedal = 0; Lat_control = 0; Long_control = 0;
   
index 0a94cb303ee10b1da9074db76e53bc9aa56c2c17..9bd72805a0fc4565d72d99daf037ce7291ad14e3 100644 (file)
@@ -70,7 +70,7 @@ static GLint winWidth, winHeight;
 /* pointer to scenery structure */
 /* static GLint scenery, runway; */
 
-double Simtime;
+/* double Simtime; */
 
 /* Another hack */
 int use_signals = 0;
@@ -86,7 +86,7 @@ int displayInstruments;
  * fgInitVisuals() -- Initialize various GL/view parameters
  **************************************************************************/
 
-static void fgInitVisuals() {
+static void fgInitVisuals( void ) {
     struct fgLIGHT *l;
     struct fgTIME *t;
     struct fgWEATHER *w;
@@ -121,7 +121,7 @@ static void fgInitVisuals() {
  * Update the view volume, position, and orientation
  **************************************************************************/
 
-static void fgUpdateViewParams() {
+static void fgUpdateViewParams( void ) {
     struct fgFLIGHT *f;
     struct fgLIGHT *l;
     struct fgTIME *t;
@@ -183,7 +183,7 @@ static void fgUpdateViewParams() {
 /*************************************************************************
  * Draw a basic instrument panel
  ************************************************************************/
-static void fgUpdateInstrViewParams() {
+static void fgUpdateInstrViewParams( void ) {
     xglViewport(0, 0 , (GLint)winWidth, (GLint)winHeight / 2);
   
     xglMatrixMode(GL_PROJECTION);
@@ -357,7 +357,7 @@ void fgUpdateTimeDepCalcs(int multi_loop) {
 }
 
 
-void fgInitTimeDepCalcs() {
+void fgInitTimeDepCalcs( void ) {
     /* initialize timer */
 
 #ifdef USE_ITIMER
@@ -517,7 +517,7 @@ static void fgMainLoop( void ) {
               FG_Altitude * FEET_TO_METER);
     }
 
-    /* fgAircraftOutputCurrent(a); */
+    fgAircraftOutputCurrent(a);
 
     /* see if we need to load any new scenery tiles */
     /* fgTileMgrUpdate(); */
@@ -636,9 +636,13 @@ int main( int argc, char *argv[] ) {
 
 
 /* $Log$
-/* Revision 1.48  1998/01/19 18:35:46  curt
-/* Minor tweaks and fixes for cygwin32.
+/* Revision 1.49  1998/01/19 18:40:31  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.48  1998/01/19 18:35:46  curt
+ * Minor tweaks and fixes for cygwin32.
+ *
  * Revision 1.47  1998/01/13 00:23:08  curt
  * Initial changes to support loading and management of scenery tiles.  Note,
  * there's still a fair amount of work left to be done.
index 087cf8d5193e2bbe7fabb772b426a042f22157e9..fe774ec848d678a85cf28e2c6bad145aa12229c2 100644 (file)
@@ -20,8 +20,8 @@ GLUTmain.o: GLUTmain.c ../XGL/xgl.h GLUTkey.h fg_init.h views.h \
  ../Cockpit/../Controls/controls.h ../Joystick/joystick.h \
  ../Math/fg_geodesy.h ../Math/polar.h ../Math/../Include/types.h \
  ../Scenery/mesh.h ../Scenery/scenery.h ../Scenery/../Include/types.h \
- ../Time/event.h ../Time/fg_timer.h ../Time/sunpos.h \
- ../Weather/weather.h
+ ../Scenery/tilemgr.h ../Time/event.h ../Time/fg_timer.h \
+ ../Time/sunpos.h ../Weather/weather.h
 fg_init.o: fg_init.c fg_init.h views.h ../Include/types.h \
  ../Flight/flight.h ../Flight/Slew/slew.h \
  ../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \
@@ -34,10 +34,9 @@ fg_init.o: fg_init.c fg_init.h views.h ../Include/types.h \
  ../Astro/stars.h ../Astro/sun.h ../Cockpit/cockpit.h ../Cockpit/hud.h \
  ../Cockpit/../Aircraft/aircraft.h ../Cockpit/../Flight/flight.h \
  ../Cockpit/../Controls/controls.h ../Joystick/joystick.h \
- ../Math/fg_random.h ../Scenery/tilemgr.h ../Scenery/mesh.h \
- ../Scenery/scenery.h ../Scenery/../Include/types.h ../Time/event.h \
+ ../Math/fg_random.h ../Scenery/mesh.h ../Scenery/scenery.h \
+ ../Scenery/../Include/types.h ../Scenery/tilemgr.h ../Time/event.h \
  ../Time/sunpos.h ../Weather/weather.h
-probdemo.o: probdemo.c ../XGL/xgl.h
 views.o: views.c views.h ../Include/types.h ../Flight/flight.h \
  ../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \
  ../Flight/LaRCsim/../flight.h ../Math/mat3.h ../Time/fg_time.h \
index c6ca50e40a2e203e6fef2f03438e9ea243eee722..c1c9df13372c0bde8eb2ea682a6c399cc2a3df20 100644 (file)
@@ -110,11 +110,23 @@ void fgInitSubsystems( void ) {
     FG_Runway_altitude = 3234.5;
     FG_Runway_heading = 102.0 * DEG_TO_RAD;
 
-    /* Initial Position at GLOBE airport */
+    /* Initial Position at (P13) GLOBE airport */
     FG_Longitude = ( -398391.28 / 3600.0 ) * DEG_TO_RAD;
     FG_Latitude  = (  120070.41 / 3600.0 ) * DEG_TO_RAD;
     FG_Altitude = FG_Runway_altitude + 3.758099;
     
+    /* Initial Position at (SEZ) SEDONA airport */
+    FG_Longitude = -111.7884614 * DEG_TO_RAD;
+    FG_Latitude  = 34.8486289 * DEG_TO_RAD;
+    FG_Runway_altitude = 4827;
+    FG_Altitude = FG_Runway_altitude + 3.758099;
+    
+    /* Initial Position at (ANE) Anoka County airport */
+    FG_Longitude = -93.2113889 * DEG_TO_RAD;
+    FG_Latitude  = 45.145 * DEG_TO_RAD;
+    FG_Runway_altitude = 912;
+    FG_Altitude = FG_Runway_altitude + 3.758099;
+    
     /* Initial Position north of the city of Globe */
     /* FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Latitude  = (  120625.64 / 3600.0 ) * DEG_TO_RAD; */
@@ -137,10 +149,8 @@ void fgInitSubsystems( void ) {
     /* FG_Longitude = ( 88128.00 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Latitude  = ( 93312.00 / 3600.0 ) * DEG_TO_RAD; */
 
-    FG_Runway_altitude = 4000.0;
-    FG_Altitude = FG_Runway_altitude + 3.758099;
-
-    printf("Initial position is: (%.4f, %.4f, %.2f)\n", 
+   printf("Initial position is: (%.4f, %.4f, %.2f)\n", 
           FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, 
           FG_Altitude * FEET_TO_METER);
 
@@ -277,10 +287,14 @@ void fgInitSubsystems( void ) {
 
 
 /* $Log$
-/* Revision 1.30  1998/01/13 00:23:09  curt
-/* Initial changes to support loading and management of scenery tiles.  Note,
-/* there's still a fair amount of work left to be done.
+/* Revision 1.31  1998/01/19 18:40:32  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.30  1998/01/13 00:23:09  curt
+ * Initial changes to support loading and management of scenery tiles.  Note,
+ * there's still a fair amount of work left to be done.
+ *
  * Revision 1.29  1998/01/08 02:22:08  curt
  * Beginning to integrate Tile management subsystem.
  *
index 8a3a00bb7685acefd83929568a68023c604511b3..d7c4966d2c9e7ed3b3b6c7dfa791646ed5ec87a0 100644 (file)
@@ -3,14 +3,16 @@ geometry.o: geometry.c geometry.h mesh.h
 mesh.o: mesh.c ../Include/constants.h ../Include/types.h \
  ../Math/fg_geodesy.h ../Math/fg_random.h ../Math/mat3.h \
  ../Math/polar.h ../Math/../Include/types.h mesh.h common.h scenery.h
-obj.o: obj.c ../XGL/xgl.h obj.h scenery.h ../Include/types.h \
+obj.o: obj.c ../XGL/xgl.h obj.h ../Include/types.h scenery.h \
  ../Math/mat3.h
-scenery.o: scenery.c ../XGL/xgl.h ../Include/general.h obj.h scenery.h \
- ../Include/types.h
-tilemgr.o: tilemgr.c ../XGL/xgl.h tileutils.h ../Aircraft/aircraft.h \
+scenery.o: scenery.c ../XGL/xgl.h ../Include/general.h obj.h \
+ ../Include/types.h scenery.h
+tilemgr.o: tilemgr.c ../XGL/xgl.h scenery.h ../Include/types.h \
+ tileutils.h obj.h ../Aircraft/aircraft.h \
  ../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \
  ../Aircraft/../Flight/LaRCsim/ls_interface.h \
  ../Aircraft/../Flight/LaRCsim/../flight.h \
  ../Aircraft/../Controls/controls.h \
- ../Aircraft/../Controls/../Include/limits.h
+ ../Aircraft/../Controls/../Include/limits.h ../Include/constants.h \
+ ../Include/general.h
 tileutils.o: tileutils.c tileutils.h ../Include/constants.h
index 1d09709210f89c8ab587babe1930900dd362b4b6..07a785ef989463477461d0a8c89df0158327eb8c 100644 (file)
@@ -95,7 +95,7 @@ void vrmlGeomOptionsValue(char *value) {
 /* We've finished parsing the current geometry.  Now do whatever needs
  * to be done with it (like generating the OpenGL call list for
  * instance */
-void vrmlHandleGeometry() {
+void vrmlHandleGeometry( void ) {
     switch(vrmlGeometryType) {
     case VRML_ELEV_GRID:
        mesh_do_it(&eg);
@@ -104,7 +104,7 @@ void vrmlHandleGeometry() {
 
 
 /* Finish up the current vrml geometry statement */
-int vrmlFreeGeometry() {
+int vrmlFreeGeometry( void ) {
     printf("Freeing geometry type = %d\n", vrmlGeometryType);
 
     switch(vrmlGeometryType) {
@@ -120,9 +120,13 @@ int vrmlFreeGeometry() {
 
 
 /* $Log$
-/* Revision 1.5  1998/01/06 01:20:23  curt
-/* Tweaks to help building with MSVC++
+/* Revision 1.6  1998/01/19 18:40:35  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.5  1998/01/06 01:20:23  curt
+ * Tweaks to help building with MSVC++
+ *
  * Revision 1.4  1997/08/27 03:30:26  curt
  * Changed naming scheme of basic shared structures.
  *
index 8b48c1d0ea6ee63433f480a8b5d89f71084cedcd..28de28c8ca39ef79925ec3ffa6aa202b7ddd9910 100644 (file)
@@ -46,19 +46,23 @@ void vrmlGeomOptionsValue(char *value);
 /* We've finished parsing the current geometry.  Now do whatever needs
  * to be done with it (like generating the OpenGL call list for
  * instance */
-void vrmlHandleGeometry();
+void vrmlHandleGeometry( void );
 
 /* Finish up the current vrml geometry statement */
-int vrmlFreeGeometry();
+int vrmlFreeGeometry( void );
 
 
 #endif /* GEOMETRY_H */
 
 
 /* $Log$
-/* Revision 1.2  1997/07/23 21:52:25  curt
-/* Put comments around the text after an #endif for increased portability.
+/* Revision 1.3  1998/01/19 18:40:36  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.2  1997/07/23 21:52:25  curt
+ * Put comments around the text after an #endif for increased portability.
+ *
  * Revision 1.1  1997/06/29 21:16:48  curt
  * More twiddling with the Scenery Management system.
  *
index cdecfb701ef6dfed552189ab97490e51e558d67c..4cbd2f53dc5bbbbc85eb586e72f013f7df6da758 100644 (file)
@@ -72,7 +72,7 @@ void mesh_init(struct MESH *m) {
 
 
 /* return a pointer to a new mesh structure (no data array allocated yet) */
-struct MESH *(new_mesh)() {
+struct MESH *(new_mesh)( void ) {
     struct MESH *mesh_ptr;
 
     mesh_ptr = (struct MESH *)malloc(sizeof(struct MESH));
@@ -396,9 +396,13 @@ GLint mesh_to_OpenGL(struct MESH *m) {
 
 
 /* $Log$
-/* Revision 1.25  1998/01/07 03:31:27  curt
-/* Miscellaneous tweaks.
+/* Revision 1.26  1998/01/19 18:40:36  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.25  1998/01/07 03:31:27  curt
+ * Miscellaneous tweaks.
+ *
  * Revision 1.24  1997/12/15 23:54:59  curt
  * Add xgl wrappers for debugging.
  * Generate terrain normals on the fly.
index ceb22f6b2ce502069b8c6a172a51add48567edf2..fe67be4d8bf6b3881af1f1ace1285baf12999fde 100644 (file)
@@ -52,7 +52,7 @@ struct MESH {
 
 
 /* return a pointer to a new mesh structure (no data array allocated yet) */
-struct MESH *(new_mesh)();
+struct MESH *(new_mesh)( void );
 
 /* initialize the non-array mesh values */
 void mesh_init(struct MESH *m);
@@ -82,9 +82,13 @@ GLint mesh_to_OpenGL(struct MESH *m);
 
 
 /* $Log$
-/* Revision 1.7  1997/08/27 03:30:29  curt
-/* Changed naming scheme of basic shared structures.
+/* Revision 1.8  1998/01/19 18:40:37  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.7  1997/08/27 03:30:29  curt
+ * Changed naming scheme of basic shared structures.
+ *
  * Revision 1.6  1997/08/02 19:10:15  curt
  * Incorporated mesh2GL.c into mesh.c
  *
index 9aee8c09266642429946708ddce93b1557a79030..27cfe289cccce16277352f09d98a1da6db15194f 100644 (file)
@@ -49,7 +49,7 @@ struct fgSCENERY scenery;
 
 
 /* Initialize the Scenery Management system */
-void fgSceneryInit() {
+void fgSceneryInit( void ) {
     printf("Initializing scenery subsystem\n");
 
     /* set the default terrain detail level */
@@ -81,7 +81,7 @@ void fgSceneryUpdate(double lon, double lat, double elev) {
 
 
 /* Render out the current scene */
-void fgSceneryRender() {
+void fgSceneryRender( void ) {
     static GLfloat terrain_color[4] = { 0.6, 0.8, 0.4, 1.0 };
     static GLfloat terrain_ambient[4];
     static GLfloat terrain_diffuse[4];
@@ -100,10 +100,14 @@ void fgSceneryRender() {
 
 
 /* $Log$
-/* Revision 1.31  1998/01/13 00:23:11  curt
-/* Initial changes to support loading and management of scenery tiles.  Note,
-/* there's still a fair amount of work left to be done.
+/* Revision 1.32  1998/01/19 18:40:37  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.31  1998/01/13 00:23:11  curt
+ * Initial changes to support loading and management of scenery tiles.  Note,
+ * there's still a fair amount of work left to be done.
+ *
  * Revision 1.30  1998/01/07 03:22:29  curt
  * Moved astro stuff to .../Src/Astro/
  *
index 869d893e80c366a790bb4ec53049516ea405a8d0..78b329dd8ad3b0a083da68aaf9b699ac68fa936d 100644 (file)
@@ -47,7 +47,7 @@ extern struct fgSCENERY scenery;
 
 
 /* Initialize the Scenery Management system */
-void fgSceneryInit();
+void fgSceneryInit( void );
 
 
 /* Tell the scenery manager where we are so it can load the proper data, and
@@ -56,17 +56,21 @@ void fgSceneryUpdate(double lon, double lat, double elev);
 
 
 /* Render out the current scene */
-void fgSceneryRender();
+void fgSceneryRender( void );
 
 
 #endif /* SCENERY_H */
 
 
 /* $Log$
-/* Revision 1.12  1997/12/15 23:55:03  curt
-/* Add xgl wrappers for debugging.
-/* Generate terrain normals on the fly.
+/* Revision 1.13  1998/01/19 18:40:38  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.12  1997/12/15 23:55:03  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
  * Revision 1.11  1997/12/10 22:37:52  curt
  * Prepended "fg" on the name of all global structures that didn't have it yet.
  * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
index e867da8b15a3715d25b2a9f6c4ec41a8f8e500df..9854b2f33f08f66bed719bce975e483fb3e9d6d5 100644 (file)
@@ -48,7 +48,7 @@ struct fgCartesianPoint local_refs[49];
 
 
 /* Initialize the Tile Manager subsystem */
-void fgTileMgrInit() {
+void fgTileMgrInit( void ) {
     printf("Initializing Tile Manager subsystem.\n");
     /* fgTileCacheInit(); */
 }
@@ -56,10 +56,11 @@ void fgTileMgrInit() {
 
 /* given the current lon/lat, fill in the array of local chunks.  If
  * the chunk isn't already in the cache, then read it from disk. */
-void fgTileMgrUpdate() {
+void fgTileMgrUpdate( void ) {
     struct fgFLIGHT *f;
     struct fgGENERAL *g;
     struct bucket p;
+    struct bucket p_last = {-1000, 0, 0, 0};
     char base_path[256];
     char file_name[256];
     int i, j;
@@ -70,6 +71,11 @@ void fgTileMgrUpdate() {
     find_bucket(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p);
     printf("Updating Tile list for %d,%d %d,%d\n", p.lon, p.lat, p.x, p.y);
 
+    if ( (p.lon == p_last.lon) && (p.lat == p_last.lat) && 
+        (p.x == p_last.x) && (p.y == p_last.y) ) {
+       /* same bucket as last time */
+    }
+
     gen_idx_array(&p, local_tiles, 7, 7);
 
     /* scenery.center = ref; */
@@ -92,7 +98,7 @@ void fgTileMgrUpdate() {
 
 
 /* Render the local tiles --- hack, hack, hack */
-void fgTileMgrRender() {
+void fgTileMgrRender( void ) {
     static GLfloat terrain_color[4] = { 0.6, 0.8, 0.4, 1.0 };
     static GLfloat terrain_ambient[4];
     static GLfloat terrain_diffuse[4];
@@ -118,10 +124,14 @@ void fgTileMgrRender() {
 
 
 /* $Log$
-/* Revision 1.3  1998/01/13 00:23:11  curt
-/* Initial changes to support loading and management of scenery tiles.  Note,
-/* there's still a fair amount of work left to be done.
+/* Revision 1.4  1998/01/19 18:40:38  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.3  1998/01/13 00:23:11  curt
+ * Initial changes to support loading and management of scenery tiles.  Note,
+ * there's still a fair amount of work left to be done.
+ *
  * Revision 1.2  1998/01/08 02:22:27  curt
  * Continue working on basic features.
  *
index cba5a948ed761f08e4006ee55a62306b156be031..c43db6f08b5e1c052f14985e0da73f9acf520429 100644 (file)
 
 
 /* Initialize the Tile Manager subsystem */
-void fgTileMgrInit();
+void fgTileMgrInit( void );
 
 
 /* given the current lon/lat, fill in the array of local chunks.  If
  * the chunk isn't already in the cache, then read it from disk. */
-void fgTileMgrUpdate();
+void fgTileMgrUpdate( void );
 
 
 /* Render the local tiles --- hack, hack, hack */
-void fgTileMgrRender();
+void fgTileMgrRender( void );
 
 
 /* $Log$
-/* Revision 1.2  1998/01/13 00:23:11  curt
-/* Initial changes to support loading and management of scenery tiles.  Note,
-/* there's still a fair amount of work left to be done.
+/* Revision 1.3  1998/01/19 18:40:38  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.2  1998/01/13 00:23:11  curt
+ * Initial changes to support loading and management of scenery tiles.  Note,
+ * there's still a fair amount of work left to be done.
+ *
  * Revision 1.1  1998/01/07 23:50:51  curt
  * "area" renamed to "tile"
  *
index 4dab0f771b12afa73f77baf9534c01754ca52cb6..62441ee0ff59f6a678c0f809c4fc0ee8576bbbd6 100644 (file)
 
 1/16/98 -  Release verison 0.23
 
+1/17/98 -  Change all "type function();" to "type function( void );"
+
 
 --------------------------------------------------------------------------
 | Todo 
 --------------------------------------------------------------------------
 
+1/17/98 -  Compile with c++
+
+1/17/98 -  in all .h's change #ifdef FILE_H -> #ifdef _FILE_H
+
+1/17/98 -  Remove some of the unused files such as ls_sync.c
+
 12/29/97 - Scenery area manager
 
 12/29/97 - View frustum culling
index 94b7fd85579dd33c46b962f56cfda374fa4e82d0..0aa2b1599762600d7e2c40cbfeb1cc3759de8dc9 100644 (file)
@@ -38,7 +38,7 @@ FG_VERSION = $(FG_VERSION_MAJOR).$(FG_VERSION_MINOR)
 # Choose your weapons
 #---------------------------------------------------------------------------
 
-CC = gcc
+CC = g++
 FLEX = flex -f -L
 BISON = bison -v --no-lines
 AR = ar
@@ -159,6 +159,10 @@ FG_CFLAGS = $(GLOBAL_CFLAGS) $(FG_DEBUG_FLAGS)
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.33  1998/01/19 18:40:15  curt
+# Tons of little changes to clean up the code and to remove fatal errors
+# when building with the c++ compiler.
+#
 # Revision 1.32  1998/01/19 18:35:40  curt
 # Minor tweaks and fixes for cygwin32.
 #
index 12702e04dbcd4ccb58bd6185911aca4f9f7f682b..01e1317fb736822442ed5583a856073523cd2881 100644 (file)
 
 /* reset flight params to a specific position */
 void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
-    struct FLIGHT *f;
+    struct fgFLIGHT *f;
 
     f = &current_aircraft.flight;
 
-    /*    f->pos_x = pos_x;
+    /*
+    f->pos_x = pos_x;
     f->pos_y = pos_y;
     f->pos_z = pos_z;
 
@@ -64,14 +65,15 @@ void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
     f->vel_Theta = 0.0;
     f->vel_Psi = 0.0;
 
-    f->Psi = heading; */
+    f->Psi = heading;
+    */
 }
 
 
 /* update position based on inputs, positions, velocities, etc. */
-void fgSlewUpdate() {
-    struct FLIGHT *f;
-    struct CONTROLS *c;
+void fgSlewUpdate( void ) {
+    struct fgFLIGHT *f;
+    struct fgCONTROLS *c;
 
     f = &current_aircraft.flight;
     c = &current_aircraft.controls;
@@ -91,10 +93,14 @@ void fgSlewUpdate() {
 
 
 /* $Log$
-/* Revision 1.7  1997/12/15 23:54:42  curt
-/* Add xgl wrappers for debugging.
-/* Generate terrain normals on the fly.
+/* Revision 1.8  1998/01/19 18:40:30  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.7  1997/12/15 23:54:42  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
  * Revision 1.6  1997/08/27 03:30:11  curt
  * Changed naming scheme of basic shared structures.
  *
index a6d8b746bf0e1eda7728dc279b10dffc0cfd899f..57e572aa1c0fd8fc4fa19d1a27a46e1ba2171d96 100644 (file)
 void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading);
 
 /* update position based on inputs, positions, velocities, etc. */
-void fgSlewUpdate();
+void fgSlewUpdate( void );
 
 
 #endif /* SLEW_H */
 
 
 /* $Log$
-/* Revision 1.2  1997/07/23 21:52:20  curt
-/* Put comments around the text after an #endif for increased portability.
+/* Revision 1.3  1998/01/19 18:40:30  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.2  1997/07/23 21:52:20  curt
+ * Put comments around the text after an #endif for increased portability.
+ *
  * Revision 1.1  1997/05/29 02:29:43  curt
  * Moved to their own directory.
  *
index c74a3909d0aea6110b5b0a60d54484c2abc7a2fc..d9a27d3e777febdf4110483de0b49ae15f416644 100644 (file)
@@ -4,8 +4,7 @@ fg_time.o: fg_time.c fg_time.h ../Include/types.h ../Flight/flight.h \
  ../Flight/LaRCsim/../flight.h ../Include/constants.h \
  ../Time/fg_time.h
 fg_timer.o: fg_timer.c fg_timer.h
-scheduler.o: scheduler.c
-sidereal.o: sidereal.c ../Include/constants.h
+sptest.o: sptest.c sunpos.h ../Include/types.h ../Include/constants.h
 sunpos.o: sunpos.c sunpos.h ../Include/types.h fg_time.h \
  ../Flight/flight.h ../Flight/Slew/slew.h \
  ../Flight/LaRCsim/ls_interface.h ../Flight/LaRCsim/../flight.h \
index 6eb8c0c4521df112f62e36df7c7cba7530688461..7938133a889e6898ed2610ba943f0216ecef23e6 100644 (file)
@@ -45,7 +45,7 @@
 struct fgEVENT {
     char description[256];
 
-    void (*event)();  /* pointer to function */
+    void (*event)( void );  /* pointer to function */
     int status;       /* status flag */
 
     long interval;    /* interval in ms between each iteration of this event */
@@ -80,13 +80,13 @@ int queue_end;
 
 
 /* initialize the run queue */
-void initq() {
+void initq( void ) {
     queue_front = queue_end = 0;
 }
 
 
 /* return queue empty status */
-int emptyq() {
+int emptyq( void ) {
     if ( queue_front == queue_end ) {
        return(1);
     } else {
@@ -96,7 +96,7 @@ int emptyq() {
 
 
 /* return queue full status */
-int fullq() {
+int fullq( void ) {
     if ( (queue_end + 1) % MAX_RUN_QUEUE == queue_front ) {
        return(1);
     } else {
@@ -121,7 +121,7 @@ void addq(int ptr) {
 
 
 /* remove a member from the front of the queue */
-int popq() {
+int popq( void ) {
     int ptr;
 
     if ( !emptyq() ) {
@@ -198,7 +198,7 @@ void fgEventRun(int ptr) {
 
 
 /* Initialize the scheduling subsystem */
-void fgEventInit() {
+void fgEventInit( void ) {
     printf("Initializing event manager\n");
     event_ptr = 0;
     initq();
@@ -207,7 +207,9 @@ void fgEventInit() {
 
 /* Register an event with the scheduler, returns a pointer into the
  * event table */
-int fgEventRegister(char *desc, void (*event)(), int status, int interval) {
+int fgEventRegister(char *desc, void (*event)( void ), int status, 
+                   int interval)
+{
     struct fgEVENT *e;
 
     e = &events[event_ptr];
@@ -240,27 +242,27 @@ int fgEventRegister(char *desc, void (*event)(), int status, int interval) {
 
 
 /* Update the scheduling parameters for an event */
-void fgEventUpdate() {
+void fgEventUpdate( void ) {
 }
 
 
 /* Delete a scheduled event */
-void fgEventDelete() {
+void fgEventDelete( void ) {
 }
 
 
 /* Temporarily suspend scheduling of an event */
-void fgEventSuspend() {
+void fgEventSuspend( void ) {
 }
 
 
 /* Resume scheduling and event */
-void fgEventResume() {
+void fgEventResume( void ) {
 }
 
 
 /* Dump scheduling stats */
-void fgEventPrintStats() {
+void fgEventPrintStats( void ) {
     int i;
 
     if ( event_ptr > 0 ) {
@@ -283,7 +285,7 @@ void fgEventPrintStats() {
 
 /* Add pending jobs to the run queue and run the job at the front of
  * the queue */
-void fgEventProcess() {
+void fgEventProcess( void ) {
 #ifdef USE_FTIME
     struct timeb current;
 #else
@@ -336,9 +338,13 @@ void fgEventProcess() {
 
 
 /* $Log$
-/* Revision 1.5  1998/01/06 01:20:27  curt
-/* Tweaks to help building with MSVC++
+/* Revision 1.6  1998/01/19 18:40:39  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.5  1998/01/06 01:20:27  curt
+ * Tweaks to help building with MSVC++
+ *
  * Revision 1.4  1997/12/31 17:46:50  curt
  * Tweaked fg_time.c to be able to use ftime() instead of gettimeofday()
  *
index b8853c61aad8f1ff326bd9cf3a5594f1b68674ed..88033c1f9518da74ac1362a32fb54762954f9e4e 100644 (file)
 
 
 /* Initialize the scheduling subsystem */
-void fgEventInit();
+void fgEventInit( void );
 
 /* Register an event with the scheduler, returns a pointer into the
  * event table */
-int fgEventRegister(char *desc, void (*event)(), int status, int interval);
+int fgEventRegister(char *desc, void (*event)( void ), int status, 
+                   int interval);
 
 /* Update the scheduling parameters for an event */
-void fgEventUpdate();
+void fgEventUpdate( void );
 
 /* Delete a scheduled event */
-void fgEventDelete();
+void fgEventDelete( void );
 
 /* Temporarily suspend scheduling of an event */
-void fgEventSuspend();
+void fgEventSuspend( void );
 
 /* Resume scheduling and event */
-void fgEventResume();
+void fgEventResume( void );
 
 /* Dump scheduling stats */
-void fgEventPrintStats();
+void fgEventPrintStats( void );
 
 /* Add pending jobs to the run queue and run the job at the front of
  * the queue */
-void fgEventProcess();
+void fgEventProcess( void );
 
 
 /* $Log$
-/* Revision 1.1  1997/12/30 04:19:22  curt
-/* Initial revision.
+/* Revision 1.2  1998/01/19 18:40:39  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.1  1997/12/30 04:19:22  curt
+ * Initial revision.
+ *
  */
index 6e1a8a3fb550497a43e99027aa55bdb78af34562..06fc5afe553d5166fc77753c5db2b0cbc39ff596 100644 (file)
@@ -44,7 +44,7 @@ unsigned long int fgSimTime;
 
 
 /* This routine catches the SIGALRM */
-void fgTimerCatch() {
+void fgTimerCatch( void ) {
     /* ignore any SIGALRM's until we come back from our EOM iteration */
     signal(SIGALRM, SIG_IGN);
 
@@ -87,7 +87,7 @@ void fgTimerInit(float dt, void (*f)()) {
 
 /* This function returns the number of milleseconds since the last
    time it was called. */
-int fgGetTimeInterval() {
+int fgGetTimeInterval( void ) {
     int interval;
     static int inited = 0;
 
@@ -131,9 +131,13 @@ int fgGetTimeInterval() {
 
 
 /* $Log$
-/* Revision 1.7  1997/12/30 13:06:58  curt
-/* A couple lighting tweaks ...
+/* Revision 1.8  1998/01/19 18:40:39  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.7  1997/12/30 13:06:58  curt
+ * A couple lighting tweaks ...
+ *
  * Revision 1.6  1997/07/12 02:13:04  curt
  * Add ftime() support for those that don't have gettimeofday()
  *
index 7205690aedf0db8a8768969b9cad194d818dad38..e6bd25e84d0e8d031d99abc25e783f4b404d48f2 100644 (file)
@@ -33,20 +33,24 @@ extern unsigned long int fgSimTime;
 /* this routine initializes the interval timer to generate a SIGALRM
  * after the specified interval (dt) the function f() will be called
  * at each signal */
-void fgTimerInit(float dt, void (*f)());
+void fgTimerInit( float dt, void (*f)( void ) );
 
 /* This function returns the number of milleseconds since the last
    time it was called. */
-int fgGetTimeInterval();
+int fgGetTimeInterval( void );
 
 
 #endif /* FG_TIMER_H */
 
 
 /* $Log$
-/* Revision 1.2  1997/07/23 21:52:27  curt
-/* Put comments around the text after an #endif for increased portability.
+/* Revision 1.3  1998/01/19 18:40:40  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.2  1997/07/23 21:52:27  curt
+ * Put comments around the text after an #endif for increased portability.
+ *
  * Revision 1.1  1997/06/16 19:24:20  curt
  * Initial revision.
  *
index 71cba1e6d1fecfa6d5648ac75a80f6a9e21c2d38..408ace291aa437c07cd7bbe0f24997020e457a64 100644 (file)
@@ -261,7 +261,7 @@ void fgSunPosition(time_t ssue, double *lon, double *lat) {
 
 
 /* update the cur_time_params structure with the current sun position */
-void fgUpdateSunPos() {
+void fgUpdateSunPos( void ) {
     struct fgLIGHT *l;
     struct fgTIME *t;
     struct fgVIEW *v;
@@ -373,9 +373,13 @@ void fgUpdateSunPos() {
 
 
 /* $Log$
-/* Revision 1.21  1997/12/30 23:10:19  curt
-/* Calculate lighting parameters here.
+/* Revision 1.22  1998/01/19 18:40:40  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.21  1997/12/30 23:10:19  curt
+ * Calculate lighting parameters here.
+ *
  * Revision 1.20  1997/12/30 22:22:43  curt
  * Further integration of event manager.
  *
index c248c81014d21263865a550936caa2ecb2627cbb..756b7fd240e2371d3e90fa28ce6e77cc70fe2eaf 100644 (file)
@@ -45,7 +45,7 @@
 #include "../Include/types.h"
 
 /* update the cur_time_params structure with the current sun position */
-void fgUpdateSunPos();
+void fgUpdateSunPos( void );
 
 void fgSunPosition(time_t ssue, double *lon, double *lat);
 
index d76d2d3e9f7e4a298c176ea63fee0b9d2b03d61d..032ca569732d319df40ae0f95f2c9041f613d39d 100644 (file)
@@ -34,7 +34,7 @@ struct fgWEATHER current_weather;
 
 
 /* Initialize the weather modeling subsystem */
-void fgWeatherInit(void) {
+void fgWeatherInit( void ) {
     struct fgWEATHER *w;
 
     w = &current_weather;
@@ -49,7 +49,7 @@ void fgWeatherInit(void) {
 
 
 /* Update the weather parameters for the current position */
-void fgWeatherUpdate() {
+void fgWeatherUpdate( void ) {
     struct fgFLIGHT *f;
     struct fgWEATHER *w;
 
@@ -64,9 +64,13 @@ void fgWeatherUpdate() {
 
 
 /* $Log$
-/* Revision 1.10  1997/12/30 22:22:46  curt
-/* Further integration of event manager.
+/* Revision 1.11  1998/01/19 18:40:41  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.10  1997/12/30 22:22:46  curt
+ * Further integration of event manager.
+ *
  * Revision 1.9  1997/12/30 20:48:03  curt
  * Integrated new event manager with subsystem initializations.
  *
index e050aedb949a8509cb78d4a28f3c549d189b5103..a6684ec34494eb4d2a3b7135d9217accb42c129f 100644 (file)
@@ -37,19 +37,23 @@ extern struct fgWEATHER current_weather;
 
 
 /* Initialize the weather modeling subsystem */
-void fgWeatherInit(void);
+void fgWeatherInit( void );
 
 /* Update the weather parameters for the current position */
-void fgWeatherUpdate();
+void fgWeatherUpdate( void );
 
 
 #endif /* WEATHER_H */
 
 
 /* $Log$
-/* Revision 1.6  1997/12/30 22:22:47  curt
-/* Further integration of event manager.
+/* Revision 1.7  1998/01/19 18:40:41  curt
+/* Tons of little changes to clean up the code and to remove fatal errors
+/* when building with the c++ compiler.
 /*
+ * Revision 1.6  1997/12/30 22:22:47  curt
+ * Further integration of event manager.
+ *
  * Revision 1.5  1997/12/10 22:37:56  curt
  * Prepended "fg" on the name of all global structures that didn't have it yet.
  * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"