system and commandline/config file processing code.
#include <stdio.h>
#include <Aircraft/aircraft.h>
-#include <Include/constants.h>
-
+#include <Include/fg_constants.h>
+#include <Main/fg_debug.h>
/* This is a record containing all the info for the aircraft currently
being operated */
f = &a->flight;
c = &a->controls;
- printf("Pos = (%.2f,%.2f,%.2f) (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n",
- FG_Longitude * 3600.0 * RAD_TO_DEG,
- FG_Latitude * 3600.0 * RAD_TO_DEG,
- FG_Altitude, FG_Phi, FG_Theta, FG_Psi);
- printf("Kts = %.0f Elev = %.2f, Aileron = %.2f, Rudder = %.2f Power = %.2f\n",
- FG_V_equiv_kts, FG_Elevator, FG_Aileron, FG_Rudder, FG_Throttle[0]);
+ fgPrintf( FG_FLIGHT, FG_DEBUG,
+ "Pos = (%.2f,%.2f,%.2f) (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n",
+ FG_Longitude * 3600.0 * RAD_TO_DEG,
+ FG_Latitude * 3600.0 * RAD_TO_DEG,
+ FG_Altitude, FG_Phi, FG_Theta, FG_Psi);
+ fgPrintf( FG_FLIGHT, FG_DEBUG,
+ "Kts = %.0f Elev = %.2f, Aileron = %.2f, Rudder = %.2f Power = %.2f\n",
+ FG_V_equiv_kts, FG_Elevator, FG_Aileron, FG_Rudder, FG_Throttle[0]);
}
/* $Log$
-/* Revision 1.14 1998/01/19 19:26:56 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.15 1998/01/27 00:47:46 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.14 1998/01/19 19:26:56 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* Revision 1.13 1997/12/15 23:54:30 curt
* Add xgl wrappers for debugging.
* Generate terrain normals on the fly.
#include <Astro/moon.h>
#include <Aircraft/aircraft.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Include/general.h>
#include <Main/views.h>
#include <Time/fg_time.h>
+#include <Main/fg_debug.h>
struct CelestialCoord moonPos;
struct fgLIGHT *l;
static int dl_exists = 0;
- printf("Initializing the Moon\n");
+ fgPrintf( FG_ASTRO, FG_INFO, "Initializing the Moon\n");
l = &cur_light_params;
moonPos = fgCalculateMoon(pltOrbElements[1], pltOrbElements[0],
cur_time_params);
#ifdef DEBUG
- printf("Moon found at %f (ra), %f (dec)\n", moonPos.RightAscension,
- moonPos.Declination);
+ fgPrintf( FG_ASTRO, FG_DEBUG,
+ "Moon found at %f (ra), %f (dec)\n", moonPos.RightAscension,
+ moonPos.Declination);
#endif
xMoon = 60000.0 * cos(moonPos.RightAscension) * cos(moonPos.Declination);
/* $Log$
-/* Revision 1.3 1998/01/19 19:26:57 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.4 1998/01/27 00:47:46 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.3 1998/01/19 19:26:57 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.
#include <Include/general.h>
#include <Time/fg_time.h>
-
+#include <Main/fg_debug.h>
struct OrbElements pltOrbElements[9];
int i;
FILE *data;
- printf("Initializing solar system\n");
+ fgPrintf( FG_ASTRO, FG_INFO, "Initializing solar system\n");
/* build the full path name to the orbital elements database file */
g = &general;
if ( (data = fopen(path, "r")) == NULL )
{
- printf("Cannot open data file: '%s'\n", path);
+ fgPrintf( FG_ASTRO, FG_ALERT, "Cannot open data file: '%s'\n", path);
return;
}
#ifdef DEBUG
- printf(" reading datafile %s\n", path);
+ fgPrintf( FG_ASTRO, FG_INFO, " reading datafile %s\n", path);
#endif
/* for all the objects... */
/* $Log$
-/* Revision 1.3 1998/01/22 02:59:27 curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.4 1998/01/27 00:47:47 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.3 1998/01/22 02:59:27 curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
* Revision 1.2 1998/01/19 19:26:58 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
#include <Astro/orbits.h>
#include <Astro/planets.h>
#include <Astro/sun.h>
-
+#include <Main/fg_debug.h>
struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
struct OrbElements theSun,
result.magnitude = -6.90 + 5*log10 (r*R) + 0.001 *FV;
break;
default:
- printf("index %d out of range !!!!\n", idx);
+ fgPrintf( FG_ASTRO, FG_ALERT, "index %d out of range !!!!\n", idx);
}
- printf(" Planet found at %f (ra), %f (dec)\n",
- result.RightAscension, result.Declination);
- printf(" Geocentric dist %f\n"
- " Heliocentric dist %f\n"
- " Distance to the sun %f\n"
- " Phase angle %f\n"
- " Brightness %f\n", R, r, s, FV, result.magnitude);
+ fgPrintf( FG_ASTRO, FG_DEBUG,
+ " Planet found at %f (ra), %f (dec)\n",
+ result.RightAscension, result.Declination);
+ fgPrintf( FG_ASTRO, FG_DEBUG,
+ " Geocentric dist %f\n"
+ " Heliocentric dist %f\n"
+ " Distance to the sun %f\n"
+ " Phase angle %f\n"
+ " Brightness %f\n", R, r, s, FV, result.magnitude);
return result;
}
/* $Log$
-/* Revision 1.2 1998/01/19 19:26:59 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.3 1998/01/27 00:47:47 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.2 1998/01/19 19:26:59 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* Revision 1.1 1998/01/07 03:16:18 curt
* Moved from .../Src/Scenery/ to .../Src/Astro/
*
#include <Aircraft/aircraft.h>
#include <Flight/flight.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Main/views.h>
#include <Math/fg_random.h>
/* $Log$
-/* Revision 1.4 1998/01/26 15:54:28 curt
-/* Added a "skirt" to try to help hide gaps between scenery and sky. This will
-/* have to be revisited in the future.
+/* Revision 1.5 1998/01/27 00:47:48 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.4 1998/01/26 15:54:28 curt
+ * Added a "skirt" to try to help hide gaps between scenery and sky. This will
+ * have to be revisited in the future.
+ *
* Revision 1.3 1998/01/19 19:26:59 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
#include <Astro/planets.h>
#include <Astro/stars.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Include/general.h>
#include <Aircraft/aircraft.h>
#include <Main/views.h>
#include <Time/fg_time.h>
-
+#include <Main/fg_debug.h>
#define EpochStart (631065600)
#define DaysSinceEpoch(secs) (((secs)-EpochStart)*(1.0/(24*3600)))
double ra_save1, decl_save1;
int count, i, j, max_stars;
- printf("Initializing stars\n");
+ fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n");
g = &general;
max_stars = FG_MAX_STARS;
for ( i = 0; i < FG_STAR_LEVELS; i++ ) {
- printf(" Loading %d Stars: %s\n", max_stars, path);
+ fgPrintf( FG_ASTRO, FG_INFO, " Loading %d Stars: %s\n", max_stars, path);
if ( (fd = fopen(path, "r")) == NULL ) {
- printf("Cannot open star file: '%s'\n", path);
+ fgPrintf( FG_ASTRO, FG_ALERT, "Cannot open star file: '%s'\n", path);
return;
}
/* $Log$
-/* Revision 1.3 1998/01/19 19:26:59 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.4 1998/01/27 00:47:49 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.3 1998/01/19 19:26:59 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.
#include <Main/views.h>
#include <Astro/orbits.h>
#include <Astro/sun.h>
+#include <Main/fg_debug.h>
GLint sun_obj;
void fgSunInit( void ) {
static int dl_exists = 0;
- printf(" Initializing the Sun\n");
+ fgPrintf( FG_ASTRO, FG_INFO, " Initializing the Sun\n");
fgSolarSystemUpdate(&(pltOrbElements[0]), cur_time_params);
sunPos = fgCalculateSun(pltOrbElements[0], cur_time_params);
#ifdef DEBUG
- printf("Sun found at %f (ra), %f (dec)\n", sunPos.RightAscension,
- sunPos.Declination);
+ fgPrintf( FG_ASTRO, FG_INFO,
+ "Sun found at %f (ra), %f (dec)\n",
+ sunPos.RightAscension, sunPos.Declination);
#endif
xSun = 60000.0 * cos(sunPos.RightAscension) * cos(sunPos.Declination);
amb[2] = 0.00 + ((ambient * 6.66) - 1.6);
amb[3] = 0.00;
#ifdef DEBUG
- printf("Color of the sun: %f, %f, %f\n"
- "Ambient value : %f\n"
- "Sun Angle : %f\n" , amb[0], amb[1], amb[2], ambient, t->sun_angle);
+ fgPrintf( FG_ASTRO, FG_INFO,
+ "Color of the sun: %f, %f, %f\n"
+ "Ambient value : %f\n"
+ "Sun Angle : %f\n" , amb[0], amb[1], amb[2], ambient, t->sun_angle);
#endif
diff[0] = 0.0;
diff[1] = 0.0;
/* $Log$
-/* Revision 1.3 1998/01/19 19:27:00 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.4 1998/01/27 00:47:50 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.3 1998/01/19 19:27:00 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.
#include <stdlib.h>
#include <Cockpit/cockpit.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Aircraft/aircraft.h>
#include <Scenery/mesh.h>
#include <Math/fg_random.h>
#include <Weather/weather.h>
+#include <Main/fg_debug.h>
+
// #define DEBUG
/* This is a structure that contains all data related to cockpit/panel/hud system */
struct fgCOCKPIT *cockpit;
Hptr hud;
- printf("Initializing cockpit subsystem\n");
+ fgPrintf( FG_COCKPIT, FG_INFO, "Initializing cockpit subsystem\n");
cockpit = (struct fgCOCKPIT *)calloc(sizeof(struct fgCOCKPIT),1);
if( cockpit == NULL )
aircraft_cockpit = cockpit;
- printf(" Code %d Status %d\n", cockpit->hud->code,
- cockpit->hud->status );
+ fgPrintf( FG_COCKPIT, FG_INFO,
+ " Code %d Status %d\n", cockpit->hud->code, cockpit->hud->status );
return( cockpit );
}
struct fgCOCKPIT *fgCockpitAddHUD( struct fgCOCKPIT *cockpit, struct HUD *hud )
{
cockpit->hud = hud;
+ return(cockpit);
}
void fgCockpitUpdate( void )
{
- printf( "Cockpit: code %d status %d\n", aircraft_cockpit->code, aircraft_cockpit->status );
+ fgPrintf( FG_COCKPIT, FG_INFO,
+ "Cockpit: code %d status %d\n",
+ aircraft_cockpit->code, aircraft_cockpit->status );
if( aircraft_cockpit->hud != NULL ) // That is, if the aircraft has a HUD,
fgUpdateHUD( aircraft_cockpit->hud ); // then draw it.
/* $Log$
-/* Revision 1.6 1998/01/19 19:27:01 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.7 1998/01/27 00:47:51 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.6 1998/01/19 19:27:01 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.
#endif /* not WIN32 */
#include "hud.h"
-#include "../Include/constants.h"
+#include <Include/fg_constants.h>
-#include "../Aircraft/aircraft.h"
-#include "../Scenery/mesh.h"
-#include "../Scenery/scenery.h"
-#include "../Math/mat3.h"
-#include "../Math/polar.h"
-#include "../Time/fg_timer.h"
-#include "../Math/fg_random.h"
-#include "../Weather/weather.h"
+#include <Aircraft/aircraft.h>
+#include <Scenery/mesh.h>
+#include <Scenery/scenery.h>
+#include <Math/mat3.h>
+#include <Math/polar.h>
+#include <Time/fg_timer.h>
+#include <Math/fg_random.h>
+#include <Weather/weather.h>
// #define DEBUG
sprintf( string, buffer, (*label.load_value)() );
#ifdef DEBUG
- printf( buffer );
- printf( "\n" );
- printf( string );
- printf( "\n" );
+ fgPrintf( FG_COCKPIT, FG_DEBUG, buffer );
+ fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
+ fgPrintf( FG_COCKPIT, FG_DEBUG, string );
+ fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
#endif
lenstr = strlen( string );
double get_altitude( void )
{
struct fgFLIGHT *f;
- double rough_elev;
+ /* double rough_elev; */
f = ¤t_aircraft.flight;
- rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
- FG_Latitude * RAD_TO_ARCSEC);
+ /* rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
+ FG_Latitude * RAD_TO_ARCSEC); */
- return( FG_Altitude*FEET_TO_METER-rough_elev );
+ return( FG_Altitude * FEET_TO_METER /* - rough_elev */ );
}
void add_instrument( Hptr hud, HIptr instrument )
glColor3f (0.1, 0.9, 0.1);
#ifdef DEBUG
- printf( "HUD Code %d Status %d\n", hud->code, hud->status );
+ fgPrintf( FG_COCKPIT, FG_DEBUG, "HUD Code %d Status %d\n",
+ hud->code, hud->status );
#endif
hud_instr = hud->instruments;
while( hud_instr != NULL )
{
instr_data = hud_instr->instr;
#ifdef DEBUG
- printf("Instr Type %d SubType %d Orient %d\n", hud_instr->type, hud_instr->sub_type, hud_instr->orientation );
+ fgPrintf( FG_COCKPIT, FG_DEBUG,
+ "Instr Type %d SubType %d Orient %d\n",
+ hud_instr->type, hud_instr->sub_type, hud_instr->orientation );
#endif
if( hud_instr->type == ARTIFICIAL_HORIZON )
{
/* $Log$
-/* 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.8 1998/01/27 00:47:51 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * 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.
#define _CONTROLS_H
-#include "../Include/limits.h"
+#include "../Include/fg_limits.h"
/* Define a structure containing the control parameters */
/* $Log$
-/* Revision 1.9 1998/01/22 02:59:31 curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.10 1998/01/27 00:47:52 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.9 1998/01/22 02:59:31 curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
* 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.
#include <stdio.h>
#include <Flight/flight.h>
#include <Flight/LaRCsim/ls_interface.h>
-
+#include <Main/fg_debug.h>
/* Initialize the flight model parameters */
int fgFlightModelInit(int model, struct fgFLIGHT *f, double dt) {
int result;
- printf("Initializing flight model\n");
+ fgPrintf(FG_FLIGHT,FG_INFO,"Initializing flight model\n");
if ( model == FG_LARCSIM ) {
fgFlight_2_LaRCsim(f); /* translate FG to LaRCsim structure */
fgLaRCsimInit(dt);
- printf("FG pos = %.2f\n", FG_Latitude);
+ fgPrintf(FG_FLIGHT,FG_INFO,"FG pos = %.2f\n", FG_Latitude);
fgLaRCsim_2_Flight(f); /* translate LaRCsim back to FG structure */
} else {
- printf("Unimplemented flight model == %d\n", model);
+ fgPrintf(FG_FLIGHT,FG_WARN,"Unimplemented flight model == %d\n", model);
}
result = 1;
fgLaRCsimUpdate(multiloop);
fgLaRCsim_2_Flight(f); /* translate LaRCsim back to FG structure */
} else {
- printf("Unimplemented flight model == %d\n", model);
+ fgPrintf(FG_FLIGHT,FG_WARN,"Unimplemented flight model == %d\n", model);
}
result = 1;
/* $Log$
-/* Revision 1.8 1998/01/19 19:27:03 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.9 1998/01/27 00:47:53 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.8 1998/01/19 19:27:03 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.
#endif
+#include <Main/fg_debug.h>
+
static joy_x_min=0, joy_x_ctr=0, joy_x_max=0;
static joy_y_min=0, joy_y_ctr=0, joy_y_max=0;
static joy_x_dead_min=1000, joy_x_dead_max=-1000;
static int joystick_fd;
int fgJoystickInit( int joy_num ) {
- printf("Initializing joystick\n");
+
+ fgPrintf( FG_INPUT, FG_INFO, "Initializing joystick\n");
#ifdef HAVE_JOYSTICK
int status;
return( 1 );
}
- printf( "\nMove joystick around dead spot and press any joystick button.\n" );
+ fgPrintf( FG_INPUT,FG_ALERT,
+ "\nMove joystick around dead spot and press any joystick button.\n" );
status = read(joystick_fd, &js, JS_RETURN);
if (status != JS_RETURN) {
perror("js");
return( 1 );
}
- printf("\nJoystick calibration: X_dead_min = %d, X_dead_max = %d\n", joy_x_dead_min, joy_x_dead_max );
- printf(" Y_dead_min = %d, Y_dead_max = %d\n", joy_y_dead_min, joy_y_dead_max );
+ fgPrintf( FG_INPUT, FG_DEBUG,
+ "\nJoystick calibration: X_dead_min = %d, X_dead_max = %d\n",
+ joy_x_dead_min, joy_x_dead_max );
+ fgPrintf( FG_INPUT, FG_DEBUG,
+ " Y_dead_min = %d, Y_dead_max = %d\n",
+ joy_y_dead_min, joy_y_dead_max );
sleep( 1 );
- printf( "\nCenter joystick and press any joystick button.\n" );
+ fgPrintf( FG_INPUT, FG_DEBUG,
+ "\nCenter joystick and press any joystick button.\n" );
status = read(joystick_fd, &js, JS_RETURN);
if (status != JS_RETURN) {
perror("js");
joy_x_ctr = js.x;
joy_y_ctr = js.y;
- printf("Joystick calibration: X_ctr = %d, Y_ctr = %d\n", joy_x_ctr, joy_y_ctr );
+ fgPrintf( FG_INPUT, FG_DEBUG,
+ "Joystick calibration: X_ctr = %d, Y_ctr = %d\n",
+ joy_x_ctr, joy_y_ctr );
sleep( 1 );
- printf( "\nMove joystick to upper left and press any joystick button.\n" );
+ fgPrintf( FG_INPUT, FG_DEBUG,
+ "\nMove joystick to upper left and press any joystick button.\n" );
status = read(joystick_fd, &js, JS_RETURN);
if (status != JS_RETURN) {
perror("js");
}
joy_x_min = js.x;
joy_y_min = js.y;
- printf("Joystick calibration: X_min = %d, Y_min = %d\n", joy_x_min, joy_y_min );
+ fgPrintf( FG_INPUT, FG_DEBUG,
+ "Joystick calibration: X_min = %d, Y_min = %d\n",
+ joy_x_min, joy_y_min );
sleep( 1 );
- printf( "\nMove joystick to lower right and press any joystick button.\n" );
+ fgPrintf( FG_INPUT, FG_DEBUG,
+ "\nMove joystick to lower right and press any joystick button.\n" );
status = read(joystick_fd, &js, JS_RETURN);
if (status != JS_RETURN) {
perror("js");
joy_x_max = js.x;
joy_y_max = js.y;
- printf("Joystick calibration: X_max = %d, Y_max = %d\n", joy_x_max, joy_y_max );
+ fgPrintf( FG_INPUT, FG_DEBUG,
+ "Joystick calibration: X_max = %d, Y_max = %d\n",
+ joy_x_max, joy_y_max );
// joy_x_ctr = (joy_x_max-joy_x_min)/2;
// joy_y_ctr = (joy_y_max-joy_y_min)/2;
/* $Log$
-/* Revision 1.2 1997/12/30 20:47:40 curt
-/* Integrated new event manager with subsystem initializations.
+/* Revision 1.3 1998/01/27 00:47:54 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.2 1997/12/30 20:47:40 curt
+ * Integrated new event manager with subsystem initializations.
+ *
* Revision 1.1 1997/08/29 18:06:54 curt
* Initial revision.
*
#include <stdio.h>
#include <Main/GLUTkey.h>
+#include <Main/fg_debug.h>
#include <Main/views.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Aircraft/aircraft.h>
#include <Weather/weather.h>
v = ¤t_view;
w = ¤t_weather;
- printf("Key hit = %d", k);
+ fgPrintf( FG_INPUT, FG_DEBUG, "Key hit = %d", k);
if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) {
- printf(" SHIFTED\n");
+ fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
switch (k) {
case 49: /* numeric keypad 1 */
v->goal_view_offset = FG_PI * 0.75;
case 90: /* Z key */
w->visibility /= 1.10;
xglFogf(GL_FOG_END, w->visibility);
- printf("Fog density = %.4f\n", w->visibility);
+ fgPrintf( FG_INPUT, FG_DEBUG, "Fog density = %.4f\n", w->visibility);
return;
}
} else {
- printf("\n");
+ fgPrintf( FG_INPUT, FG_DEBUG, "\n");
switch (k) {
case 50: /* numeric keypad 2 */
fgElevMove(-0.05);
case 122: /* z key */
w->visibility *= 1.10;
xglFogf(GL_FOG_END, w->visibility);
- printf("Fog density = %.4f\n", w->visibility);
+ fgPrintf( FG_INPUT, FG_DEBUG, "Fog density = %.4f\n", w->visibility);
return;
case 27: /* ESC */
exit(0);
c = ¤t_aircraft.controls;
v = ¤t_view;
- printf("Special key hit = %d", k);
+ fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k);
if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) {
- printf(" SHIFTED\n");
+ fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
switch (k) {
case GLUT_KEY_END: /* numeric keypad 1 */
v->goal_view_offset = FG_PI * 0.75;
return;
}
} else {
- printf("\n");
+ fgPrintf( FG_INPUT, FG_DEBUG, "\n");
switch (k) {
case GLUT_KEY_UP:
fgElevMove(0.05);
/* $Log$
-/* Revision 1.26 1998/01/19 19:27:07 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.27 1998/01/27 00:47:55 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.26 1998/01/19 19:27:07 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* Revision 1.25 1998/01/05 18:44:34 curt
* Add an option to advance/decrease time from keyboard.
*
#include <Main/GLUTkey.h>
#include <Main/fg_init.h>
+#include <Main/fg_debug.h>
#include <Main/views.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Include/general.h>
#include <Aircraft/aircraft.h>
struct fgFLIGHT *f;
struct fgTIME *t;
- printf("Running Main Loop\n");
- printf("======= ==== ====\n");
+ fgPrintf( FG_ALL, FG_DEBUG, "Running Main Loop\n");
+ fgPrintf( FG_ALL, FG_DEBUG, "======= ==== ====\n");
a = ¤t_aircraft;
f = &a->flight;
/* Calculate model iterations needed */
elapsed = fgGetTimeInterval();
- printf("Time interval is = %d, previous remainder is = %d\n", elapsed,
- remainder);
- printf("--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
+ fgPrintf( FG_ALL, FG_BULK, "Time interval is = %d, previous remainder is = %d\n",
+ elapsed, remainder);
+ fgPrintf( FG_ALL, FG_BULK, "--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
elapsed += remainder;
multi_loop = ((float)elapsed * 0.001) * DEFAULT_MODEL_HZ;
remainder = elapsed - ((multi_loop*1000) / DEFAULT_MODEL_HZ);
- printf("Model iterations needed = %d, new remainder = %d\n", multi_loop,
- remainder);
+ fgPrintf( FG_ALL, FG_BULK, "Model iterations needed = %d, new remainder = %d\n",
+ multi_loop, remainder);
/* Run flight model */
if ( ! use_signals ) {
/* now set aircraft altitude above ground */
FG_Altitude = cur_elev * METER_TO_FEET + 3.758099;
- printf("<*> resetting altitude to %.0f meters\n",
+ fgPrintf( FG_ALL, FG_BULK, "<*> resetting altitude to %.0f meters\n",
FG_Altitude * FEET_TO_METER);
}
/* redraw display */
fgRenderFrame();
- printf("\n");
+ fgPrintf( FG_ALL, FG_DEBUG, "\n");
}
/* $Log$
-/* Revision 1.51 1998/01/26 15:57:05 curt
-/* Tweaks for dynamic scenery development.
+/* Revision 1.52 1998/01/27 00:47:56 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.51 1998/01/26 15:57:05 curt
+ * Tweaks for dynamic scenery development.
+ *
* Revision 1.50 1998/01/19 19:27:07 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
TARGET = fg-$(FG_VERSION)
-CFILES = fg_init.c views.c $(INTERFACE_FILES)
+CFILES = fg_init.c fg_debug.c views.c $(INTERFACE_FILES)
FGLIBS = -lAircraft -lAstro -lCockpit -lControls -lFlight \
-lJoystick -lLaRCsim -lSlew -lScenery -lTime -lWeather -lMath \
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.45 1998/01/27 00:47:57 curt
+# Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+# system and commandline/config file processing code.
+#
# Revision 1.44 1998/01/22 22:04:00 curt
# Tweaked extention stuff.
#
#include <Main/fg_init.h>
#include <Main/views.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Include/general.h>
#include <Aircraft/aircraft.h>
#include <Time/fg_time.h>
#include <Time/sunpos.h>
#include <Weather/weather.h>
-
+#include <Main/fg_debug.h>
extern int show_hud; /* HUD state */
extern int displayInstruments;
g = &general;
- printf("General Initialization\n");
- printf("======= ==============\n");
+ fgInitDebug();
+
+ fgPrintf( FG_GENERAL, FG_INFO, "General Initialization\n" );
+ fgPrintf( FG_GENERAL, FG_INFO, "======= ==============\n" );
/* seed the random number generater */
fg_srandom();
/* determine the fg root path */
if ( (g->root_dir = getenv("FG_ROOT")) == NULL ) {
/* environment variable not defined */
- printf("FG_ROOT needs to be defined! See the documentation.\n");
- exit(0);
+ fgPrintf(FG_GENERAL, FG_EXIT, "FG_ROOT needs to be defined! "
+ "See the documentation.\n");
}
- printf("FG_ROOT = %s\n", g->root_dir);
-
- printf("\n");
+ fgPrintf( FG_GENERAL, FG_INFO, "FG_ROOT = %s\n\n", g->root_dir);
}
t = &cur_time_params;
v = ¤t_view;
- printf("Initialize Subsystems\n");
- printf("========== ==========\n");
+ fgPrintf( FG_GENERAL, FG_INFO, "Initialize Subsystems\n");
+ fgPrintf( FG_GENERAL, FG_INFO, "========== ==========\n");
/****************************************************************
* The following section sets up the flight model EOM parameters and
FG_Latitude = ( 120070.41 / 3600.0 ) * DEG_TO_RAD;
FG_Runway_altitude = (3234.5 + 300);
FG_Altitude = FG_Runway_altitude + 3.758099;
-
+
/* Initial Position at (SEZ) SEDONA airport */
/* FG_Longitude = (-111.7884614 + 0.02) * DEG_TO_RAD; */
/* FG_Latitude = ( 34.8486289 - 0.04) * DEG_TO_RAD; */
/* Initial Posisition near where I used to live in Globe, AZ */
/* FG_Longitude = ( -398757.6 / 3600.0 ) * DEG_TO_RAD; */
- /* FG_Latitude = ( 120160.0 / 3600.0 ) * DEG_TO_RAD; */
+ /* FG_Latitude = ( 120160.0 / 3600.0 ) * DEG_TO_RAD; */
/* FG_Runway_altitude = 5000.0; */
/* FG_Altitude = FG_Runway_altitude + 3.758099; */
/* 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,
- FG_Altitude * FEET_TO_METER);
+ fgPrintf( FG_GENERAL, FG_INFO,
+ "Initial position is: (%.4f, %.4f, %.2f)\n",
+ FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG,
+ FG_Altitude * FEET_TO_METER);
- /* Initial Velocity */
+ /* Initial Velocity */
FG_V_north = 0.0 /* 7.287719E+00 */;
FG_V_east = 0.0 /* 1.521770E+03 */;
FG_V_down = 0.0 /* -1.265722E-05 */;
/* Initialize the Cockpit subsystem */
if( fgCockpitInit( current_aircraft ) == NULL ) {
- printf( "Error in Cockpit initialization!\n" );
- exit( 1 );
+ fgPrintf( FG_GENERAL, FG_EXIT, "Error in Cockpit initialization!\n" );
}
/* Initialize the orbital elements of sun, moon and mayor planets */
* eventually */
cur_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0,
FG_Latitude * RAD_TO_DEG * 3600.0);
- printf("True ground elevation is %.2f meters here.\n", cur_elev);
+ fgPrintf( FG_GENERAL, FG_INFO, "True ground elevation is %.2f meters here.\n",
+ cur_elev);
if ( cur_elev > -9990.0 ) {
FG_Runway_altitude = cur_elev * METER_TO_FEET;
}
if ( FG_Altitude < FG_Runway_altitude ) {
FG_Altitude = FG_Runway_altitude + 3.758099;
}
- printf("Updated position (after elevation adj): (%.4f, %.4f, %.2f)\n",
+ fgPrintf(FG_GENERAL, FG_INFO,
+ "Updated position (after elevation adj): (%.4f, %.4f, %.2f)\n",
FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG,
FG_Altitude * FEET_TO_METER);
/* end of thing that I just stuck in that I should probably move */
/* One more try here to get the sky synced up */
fgSkyColorsInit();
- printf("\n");
+ fgPrintf(FG_GENERAL, FG_INFO,"\n");
}
/* $Log$
-/* Revision 1.34 1998/01/22 02:59:37 curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.35 1998/01/27 00:47:57 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.34 1998/01/22 02:59:37 curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
* Revision 1.33 1998/01/21 21:11:34 curt
* Misc. tweaks.
*
#include <Main/views.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Flight/flight.h>
#include <Math/mat3.h>
#include <Math/vector.h>
#include <Scenery/scenery.h>
#include <Time/fg_time.h>
-
+#include <Main/fg_debug.h>
/* This is a record containing current view parameters */
struct fgVIEW current_view;
/* Initialize a view structure */
void fgViewInit(struct fgVIEW *v) {
- printf("Initializing View parameters\n");
+ fgPrintf( FG_VIEW, FG_INFO, "Initializing View parameters\n");
v->view_offset = 0.0;
v->goal_view_offset = 0.0;
v->view_pos.y -= scenery.center.y;
v->view_pos.z -= scenery.center.z;
- printf("View pos = %.4f, %.4f, %.4f\n",
+ fgPrintf( FG_VIEW, FG_DEBUG, "View pos = %.4f, %.4f, %.4f\n",
v->view_pos.x, v->view_pos.y, v->view_pos.z);
/* make a vector to the current view position */
/* $Log$
-/* Revision 1.10 1998/01/19 19:27:09 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.11 1998/01/27 00:47:58 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.10 1998/01/19 19:27:09 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* Revision 1.9 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.
#define _VIEWS_H
-#include <Include/types.h>
+#include <Include/fg_types.h>
#include <Flight/flight.h>
#include <Math/mat3.h>
#include <Time/fg_time.h>
/* $Log$
-/* Revision 1.7 1998/01/22 02:59:38 curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.8 1998/01/27 00:47:58 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.7 1998/01/22 02:59:38 curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
* Revision 1.6 1998/01/19 19:27:10 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
#include <stdio.h>
#include <Scenery/bucketutils.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
/* Generate the unique scenery tile index containing the specified
/* $Log$
-/* Revision 1.2 1998/01/24 00:03:28 curt
-/* Initial revision.
+/* Revision 1.3 1998/01/27 00:48:01 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.2 1998/01/24 00:03:28 curt
+ * Initial revision.
+ *
* Revision 1.1 1998/01/23 20:06:51 curt
* tileutils.* renamed to bucketutils.*
*
#include <GL/glut.h>
-#include <Include/constants.h>
-#include <Include/types.h>
+#include <Include/fg_constants.h>
+#include <Include/fg_types.h>
#include <Math/fg_geodesy.h>
#include <Math/fg_random.h>
#include <Math/mat3.h>
/* $Log$
-/* Revision 1.27 1998/01/19 19:27:15 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.28 1998/01/27 00:48:02 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.27 1998/01/19 19:27:15 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.
#include <GL/glut.h>
-#include <Include/types.h>
+#include <Include/fg_types.h>
/* Load a .obj file and generate the GL call list */
/* $Log$
-/* Revision 1.4 1998/01/22 02:59:41 curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.5 1998/01/27 00:48:03 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.4 1998/01/22 02:59:41 curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
* Revision 1.3 1998/01/19 19:27:17 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
#define _SCENERY_H
-#include <Include/types.h>
+#include <Include/fg_types.h>
/* Define a structure containing global scenery parameters */
/* $Log$
-/* Revision 1.15 1998/01/22 02:59:41 curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.16 1998/01/27 00:48:03 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.15 1998/01/22 02:59:41 curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
* Revision 1.14 1998/01/19 19:27:17 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
/**************************************************************************
- * tilecache.c -- routines to hancle scenery tile caching
+ * tilecache.c -- routines to handle scenery tile caching
*
* Written by Curtis Olson, started January 1998.
*
/* $Log$
-/* Revision 1.2 1998/01/26 15:55:24 curt
-/* Progressing on building dynamic scenery system.
+/* Revision 1.3 1998/01/27 00:48:03 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.2 1998/01/26 15:55:24 curt
+ * Progressing on building dynamic scenery system.
+ *
* Revision 1.1 1998/01/24 00:03:29 curt
* Initial revision.
*
/**************************************************************************
- * tilecache.h -- routines to hancle scenery tile caching
+ * tilecache.h -- routines to handle scenery tile caching
*
* Written by Curtis Olson, started January 1998.
*
#include <XGL/xgl.h>
#include <Scenery/bucketutils.h>
-#include <Include/types.h>
+#include <Include/fg_types.h>
#define FG_TILE_CACHE_SIZE 100 /* Must be > FG_LOCAL_X_Y */
GLint display_list;
struct fgCartesianPoint local_ref;
int used;
+ int priority;
};
/* tile cache */
/* $Log$
-/* Revision 1.1 1998/01/24 00:03:29 curt
-/* Initial revision.
+/* Revision 1.2 1998/01/27 00:48:04 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.1 1998/01/24 00:03:29 curt
+ * Initial revision.
+ *
*/
#include <Scenery/tilecache.h>
#include <Aircraft/aircraft.h>
-#include <Include/constants.h>
-#include <Include/types.h>
+#include <Include/fg_constants.h>
+#include <Include/fg_types.h>
#define FG_LOCAL_X 3 /* should be odd */
AT ULTRA HIGH SPEEDS THIS ASSUMPTION MAY NOT BE VALID IF
THE AIRCRAFT CAN SKIP A TILE IN A SINGLE ITERATION. */
- if ( (p1.lon > p_last.lon) || (p1.x > p_last.x) ) {
+ if ( (p1.lon > p_last.lon) ||
+ ( (p1.lon == p_last.lon) && (p1.x > p_last.x) ) ) {
for ( j = 0; j < FG_LOCAL_Y; j++ ) {
/* scrolling East */
for ( i = 0; i < FG_LOCAL_X - 1; i++ ) {
fgBucketOffset(&p_last, &p2, dw + 1, j - dh);
fgTileMgrLoadTile(&p2, &tiles[(j*FG_LOCAL_Y) + FG_LOCAL_X - 1]);
}
- } else if ( (p1.lon < p_last.lon) || (p1.x < p_last.x) ) {
+ } else if ( (p1.lon < p_last.lon) ||
+ ( (p1.lon == p_last.lon) && (p1.x < p_last.x) ) ) {
for ( j = 0; j < FG_LOCAL_Y; j++ ) {
/* scrolling West */
for ( i = FG_LOCAL_X - 1; i > 0; i-- ) {
}
}
- if ( (p1.lat > p_last.lat) || (p1.y > p_last.y) ) {
+ if ( (p1.lat > p_last.lat) ||
+ ( (p1.lat == p_last.lat) && (p1.y > p_last.y) ) ) {
for ( i = 0; i < FG_LOCAL_X; i++ ) {
/* scrolling North */
for ( j = 0; j < FG_LOCAL_Y - 1; j++ ) {
fgTileMgrLoadTile(&p2,
&tiles[((FG_LOCAL_Y-1)*FG_LOCAL_Y) + i]);
}
- } else if ( (p1.lat < p_last.lat) || (p1.y < p_last.y) ) {
+ } else if ( (p1.lat < p_last.lat) ||
+ ( (p1.lat == p_last.lat) && (p1.y < p_last.y) ) ) {
for ( i = 0; i < FG_LOCAL_X; i++ ) {
/* scrolling South */
for ( j = FG_LOCAL_Y - 1; j > 0; j-- ) {
/* $Log$
-/* Revision 1.7 1998/01/26 15:55:25 curt
-/* Progressing on building dynamic scenery system.
+/* Revision 1.8 1998/01/27 00:48:04 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.7 1998/01/26 15:55:25 curt
+ * Progressing on building dynamic scenery system.
+ *
* Revision 1.6 1998/01/24 00:03:30 curt
* Initial revision.
*
# (Log is kept at end of this file)
#---------------------------------------------------------------------------
+
include $(FG_ROOT_SRC)/commondefs
SUBSUBDIRS = Flight/LaRCsim Flight/Slew
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.39 1998/01/27 00:47:41 curt
+# Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+# system and commandline/config file processing code.
+#
# Revision 1.38 1998/01/22 22:03:22 curt
# Tweaks.
#
of the more sophisticated features of Flight Gear.
+Paul Bleisch <bleisch@chromatic.com>
+ Paul redid the "debug" system so that it would be much more
+ flexible, so it could be easily disabled for production system, and
+ so that messages for certain subsystems could be selectively
+ enabled.
+
+ Also contributed a first stab at a config file/command line parsing
+ system.
+
+
Gene Buckle <geneb@nwlink.com>
Gene has done a lot of work getting FG to compile with the MSVC++
compiler. Also, he has pushed, proded, and bugged me endlessly to
#---------------------------------------------------------------------------
FG_VERSION_MAJOR = 0
-FG_VERSION_MINOR = 26
+FG_VERSION_MINOR = 27
FG_VERSION = $(FG_VERSION_MAJOR).$(FG_VERSION_MINOR)
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#---------------------------------------------------------------------------
# runfg -- front end for setting up the FG_ROOT env variable and launching
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.2 1998/01/27 00:47:43 curt
+# Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+# system and commandline/config file processing code.
+#
# Revision 1.1 1997/10/28 18:47:27 curt
# Initial revision.
#
#include <Flight/flight.h>
#include <Aircraft/aircraft.h>
#include <Controls/controls.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#ifndef M_PI
/* $Log$
-/* Revision 1.9 1998/01/19 19:27:06 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.10 1998/01/27 00:47:53 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.9 1998/01/19 19:27:06 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.
int popq( void ) {
int ptr;
- if ( !emptyq() ) {
+ if ( emptyq() ) {
+ printf("PANIC: RUN QUEUE IS EMPTY!!!\n");
+ ptr = 0;
+ } else {
ptr = queue[queue_front];
/* printf("Popped position %d = %d\n", queue_front, ptr); */
queue_front = (queue_front + 1) % MAX_RUN_QUEUE;
- return(ptr);
- } else {
- printf("PANIC: RUN QUEUE IS EMPTY!!!\n");
- exit(0);
}
+
+ return(ptr);
}
/* $Log$
-/* Revision 1.7 1998/01/19 19:27:19 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.8 1998/01/27 00:48:05 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.7 1998/01/19 19:27:19 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.
#endif /* USE_FTIME */
#include <Time/fg_time.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Flight/flight.h>
#define DEGHR(x) ((x)/15.)
#define RADHR(x) DEGHR(x*RAD_TO_DEG)
+#include <Main/fg_debug.h>
struct fgTIME cur_time_params;
struct fgLIGHT cur_light_params;
/* Initialize the time dependent variables */
void fgTimeInit(struct fgTIME *t) {
- printf("Initializing Time\n");
+ fgPrintf( FG_EVENT, FG_INFO, "Initializing Time\n");
t->gst_diff = -9999.0;
t->warp = (0) * 3600;
x /= 3600.0;
gst = (1.0/SIDRATE)*hr + x;
- printf(" gst => %.4f\n", gst);
+ fgPrintf( FG_EVENT, FG_DEBUG, " gst => %.4f\n", gst);
return(gst);
}
start = mktime(&mt);
/* printf("start1 = %ld\n", start);
- printf("start2 = %s", ctime(&start));
- printf("start3 = %ld\n", start); */
+ fgPrintf( FG_EVENT, FG_DEBUG, "start2 = %s", ctime(&start));
+ fgPrintf( FG_EVENT, FG_DEBUG, "start3 = %ld\n", start); */
daylight = mt.tm_isdst;
if ( daylight > 0 ) {
daylight = 1;
} else if ( daylight < 0 ) {
- printf("OOOPS, big time problem in fg_time.c, no daylight savings info.\n");
+ fgPrintf( FG_EVENT, FG_WARN, "OOOPS, big time problem in fg_time.c, no daylight savings info.\n");
}
offset = -(timezone / 3600 - daylight);
void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
double gst_precise, gst_course;
- printf("Updating time\n");
+ fgPrintf( FG_EVENT, FG_BULK, "Updating time\n");
/* get current Unix calendar time (in seconds) */
t->warp += t->warp_delta;
t->cur_time = time(NULL) + t->warp;
- printf(" Current Unix calendar time = %ld warp = %ld delta = %ld\n",
- t->cur_time, t->warp, t->warp_delta);
+ fgPrintf( FG_EVENT, FG_BULK,
+ " Current Unix calendar time = %ld warp = %ld delta = %ld\n",
+ t->cur_time, t->warp, t->warp_delta);
/* get GMT break down for current time */
t->gmt = gmtime(&t->cur_time);
- printf(" Current GMT = %d/%d/%2d %d:%02d:%02d\n",
- t->gmt->tm_mon+1, t->gmt->tm_mday, t->gmt->tm_year,
- t->gmt->tm_hour, t->gmt->tm_min, t->gmt->tm_sec);
+ fgPrintf( FG_EVENT, FG_BULK,
+ " Current GMT = %d/%d/%2d %d:%02d:%02d\n",
+ t->gmt->tm_mon+1, t->gmt->tm_mday, t->gmt->tm_year,
+ t->gmt->tm_hour, t->gmt->tm_min, t->gmt->tm_sec);
/* calculate modified Julian date */
t->mjd = cal_mjd ((int)(t->gmt->tm_mon+1), (double)t->gmt->tm_mday,
/* convert "back" to Julian date + partial day (as a fraction of one) */
t->jd = t->mjd + MJD0;
- printf(" Current Julian Date = %.5f\n", t->jd);
+ fgPrintf( FG_EVENT, FG_BULK, " Current Julian Date = %.5f\n", t->jd);
/* printf(" Current Longitude = %.3f\n", FG_Longitude * RAD_TO_DEG); */
if ( t->gst_diff < -100.0 ) {
/* first time through do the expensive calculation & cheap
calculation to get the difference. */
- printf(" First time, doing precise gst\n");
- t->gst = gst_precise = sidereal_precise(t->mjd, 0.00);
- gst_course = sidereal_course(t->gmt, t->cur_time, 0.00);
- t->gst_diff = gst_precise - gst_course;
-
- t->lst =
- sidereal_course(t->gmt, t->cur_time, -(FG_Longitude * RAD_TO_DEG))
- + t->gst_diff;
+ fgPrintf( FG_EVENT, FG_INFO, " First time, doing precise gst\n");
+ t->gst = gst_precise = sidereal_precise(t->mjd, 0.00);
+ gst_course = sidereal_course(t->gmt, t->cur_time, 0.00);
+ t->gst_diff = gst_precise - gst_course;
+
+ t->lst =
+ sidereal_course(t->gmt, t->cur_time, -(FG_Longitude * RAD_TO_DEG))
+ + t->gst_diff;
} else {
/* course + difference should drift off very slowly */
t->gst =
/* $Log$
-/* Revision 1.30 1998/01/21 21:11:35 curt
-/* Misc. tweaks.
+/* Revision 1.31 1998/01/27 00:48:06 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.30 1998/01/21 21:11:35 curt
+ * Misc. tweaks.
+ *
* Revision 1.29 1998/01/19 19:27:20 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
#include <GL/glut.h>
#include <time.h>
-#include <Include/types.h>
+#include <Include/fg_types.h>
#include <Flight/flight.h>
/* $Log$
-/* Revision 1.14 1998/01/22 02:59:43 curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.15 1998/01/27 00:48:06 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.14 1998/01/22 02:59:43 curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
* Revision 1.13 1998/01/19 19:27:20 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
#include <Time/sunpos.h>
#include <Time/fg_time.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
#include <Main/views.h>
#include <Math/fg_geodesy.h>
#include <Math/mat3.h>
/* $Log$
-/* Revision 1.23 1998/01/19 19:27:21 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.24 1998/01/27 00:48:07 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.23 1998/01/19 19:27:21 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.
#include <time.h>
-#include <Include/types.h>
+#include <Include/fg_types.h>
/* update the cur_time_params structure with the current sun position */
void fgUpdateSunPos( void );
**************************************************************************/
+#include <stdio.h>
+
#include <Weather/weather.h>
#include <Aircraft/aircraft.h>
#include <Math/fg_random.h>
/* Update the weather parameters for the current position */
void fgWeatherUpdate( void ) {
+
+ /* temporarily remove the code of this do-nothing routine */
+
+#ifdef FG_WEATHER_UPDATE
struct fgFLIGHT *f;
struct fgWEATHER *w;
/* FG_U_gust = fg_random() * 1.0 - 0.5;
FG_V_gust = fg_random() * 1.0 - 0.5;
FG_W_gust = fg_random() * 1.0 - 0.5; */
+#endif FG_WEATHER_UPDATE
}
/* $Log$
-/* Revision 1.12 1998/01/19 19:27:22 curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.13 1998/01/27 00:48:08 curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
/*
+ * Revision 1.12 1998/01/19 19:27:22 curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
* 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.