1
0
Fork 0

Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss

<chotchkiss@namg.us.anritsu.com>
This commit is contained in:
curt 1998-02-07 15:29:31 +00:00
parent 0bb3c2969a
commit 50c0f6c9e6
25 changed files with 1337 additions and 971 deletions

View file

@ -32,16 +32,25 @@
/* This is a record containing all the info for the aircraft currently /* This is a record containing all the info for the aircraft currently
being operated */ being operated */
struct fgAIRCRAFT current_aircraft; fgAIRCRAFT current_aircraft;
/* Initialize an Aircraft structure */
void fgAircraftInit( void ) {
fgPrintf( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure\n" );
current_aircraft.flight = &cur_flight_params;
current_aircraft.controls = &cur_control_params;
}
/* Display various parameters to stdout */ /* Display various parameters to stdout */
void fgAircraftOutputCurrent(struct fgAIRCRAFT *a) { void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
struct fgFLIGHT *f; fgFLIGHT *f;
struct fgCONTROLS *c; fgCONTROLS *c;
f = &a->flight; f = a->flight;
c = &a->controls; c = a->controls;
fgPrintf( FG_FLIGHT, FG_DEBUG, fgPrintf( FG_FLIGHT, FG_DEBUG,
"Pos = (%.2f,%.2f,%.2f) (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n", "Pos = (%.2f,%.2f,%.2f) (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n",
@ -55,10 +64,14 @@ void fgAircraftOutputCurrent(struct fgAIRCRAFT *a) {
/* $Log$ /* $Log$
/* Revision 1.15 1998/01/27 00:47:46 curt /* Revision 1.16 1998/02/07 15:29:31 curt
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* system and commandline/config file processing code. /* <chotchkiss@namg.us.anritsu.com>
/* /*
* 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 * Revision 1.14 1998/01/19 19:26:56 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously. * This should simplify things tremendously.

View file

@ -32,28 +32,36 @@
/* Define a structure containing all the parameters for an aircraft */ /* Define a structure containing all the parameters for an aircraft */
struct fgAIRCRAFT { typedef struct{
struct fgFLIGHT flight; fgFLIGHT *flight;
struct fgCONTROLS controls; fgCONTROLS *controls;
}; } fgAIRCRAFT ;
/* current_aircraft contains all the parameters of the aircraft /* current_aircraft contains all the parameters of the aircraft
currently being operated. */ currently being operated. */
extern struct fgAIRCRAFT current_aircraft; extern fgAIRCRAFT current_aircraft;
/* Initialize an Aircraft structure */
void fgAircraftInit( void );
/* Display various parameters to stdout */ /* Display various parameters to stdout */
void fgAircraftOutputCurrent(struct fgAIRCRAFT *a); void fgAircraftOutputCurrent(fgAIRCRAFT *a);
#endif /* _AIRCRAFT_H */ #endif /* _AIRCRAFT_H */
/* $Log$ /* $Log$
/* Revision 1.9 1998/01/22 02:59:23 curt /* Revision 1.10 1998/02/07 15:29:32 curt
/* Changed #ifdef FILE_H to #ifdef _FILE_H /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.9 1998/01/22 02:59:23 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H
*
* Revision 1.8 1998/01/19 19:26:57 curt * Revision 1.8 1998/01/19 19:26:57 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously. * This should simplify things tremendously.
@ -63,9 +71,13 @@ void fgAircraftOutputCurrent(struct fgAIRCRAFT *a);
/* $Log$ /* $Log$
/* Revision 1.9 1998/01/22 02:59:23 curt /* Revision 1.10 1998/02/07 15:29:32 curt
/* Changed #ifdef FILE_H to #ifdef _FILE_H /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.9 1998/01/22 02:59:23 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H
*
* Revision 1.8 1998/01/19 19:26:57 curt * Revision 1.8 1998/01/19 19:26:57 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously. * This should simplify things tremendously.

View file

@ -58,11 +58,11 @@ struct CelestialCoord fgCalculateMoon(struct OrbElements params,
xv, yv, v, r, xh, yh, zh, xg, yg, zg, xe, ye, ze, xv, yv, v, r, xh, yh, zh, xg, yg, zg, xe, ye, ze,
Ls, Lm, D, F, mpar, gclat, rho, HA, g; Ls, Lm, D, F, mpar, gclat, rho, HA, g;
struct fgAIRCRAFT *a; fgAIRCRAFT *a;
struct fgFLIGHT *f; fgFLIGHT *f;
a = &current_aircraft; a = &current_aircraft;
f = &a->flight; f = a->flight;
/* calculate the angle between ecliptic and equatorial coordinate /* calculate the angle between ecliptic and equatorial coordinate
* system, in Radians */ * system, in Radians */
@ -226,9 +226,13 @@ void fgMoonRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.5 1998/02/02 20:53:21 curt /* Revision 1.6 1998/02/07 15:29:32 curt
/* To version 0.29 /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.5 1998/02/02 20:53:21 curt
* To version 0.29
*
* Revision 1.4 1998/01/27 00:47:46 curt * Revision 1.4 1998/01/27 00:47:46 curt
* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
* system and commandline/config file processing code. * system and commandline/config file processing code.

View file

@ -248,13 +248,13 @@ void fgSkyInit( void ) {
/* Draw the Sky */ /* Draw the Sky */
void fgSkyRender( void ) { void fgSkyRender( void ) {
struct fgFLIGHT *f; fgFLIGHT *f;
struct fgLIGHT *l; struct fgLIGHT *l;
struct fgVIEW *v; struct fgVIEW *v;
float /* inner_color[4], middle_color[4], diff, */ east_dot, dot, angle; float /* inner_color[4], middle_color[4], diff, */ east_dot, dot, angle;
int i; int i;
f = &current_aircraft.flight; f = current_aircraft.flight;
l = &cur_light_params; l = &cur_light_params;
v = &current_view; v = &current_view;
@ -353,10 +353,14 @@ void fgSkyRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.5 1998/01/27 00:47:48 curt /* Revision 1.6 1998/02/07 15:29:32 curt
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* system and commandline/config file processing code. /* <chotchkiss@namg.us.anritsu.com>
/* /*
* 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 * 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 * Added a "skirt" to try to help hide gaps between scenery and sky. This will
* have to be revisited in the future. * have to be revisited in the future.

View file

@ -22,7 +22,7 @@
* $Id$ * $Id$
* (Log is kept at end of this file) * (Log is kept at end of this file)
**************************************************************************/ **************************************************************************/
#include <GL/glut.h> #include <GL/glut.h>
@ -41,41 +41,42 @@
#include <Main/fg_debug.h> #include <Main/fg_debug.h>
// #define DEBUG // This is a structure that contains all data related to
// cockpit/panel/hud system
/* This is a structure that contains all data related to cockpit/panel/hud system */ static fgCOCKPIT *aircraft_cockpit;
static struct fgCOCKPIT *aircraft_cockpit;
struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft ) fgCOCKPIT *fgCockpitInit( fgAIRCRAFT *cur_aircraft )
{ {
struct fgCOCKPIT *cockpit; fgCOCKPIT *cockpit;
Hptr hud; Hptr hud;
fgPrintf( FG_COCKPIT, FG_INFO, "Initializing cockpit subsystem\n"); fgPrintf( FG_COCKPIT, FG_INFO, "Initializing cockpit subsystem\n");
cockpit = (struct fgCOCKPIT *)calloc(sizeof(struct fgCOCKPIT),1); cockpit = (fgCOCKPIT *)calloc(sizeof(fgCOCKPIT),1);
if( cockpit == NULL ) if( cockpit == NULL )
return( NULL ); return( NULL );
cockpit->code = 1; /* It will be aircraft dependent */ cockpit->code = 1; /* It will be aircraft dependent */
cockpit->status = 0; cockpit->status = 0;
/* If aircraft has HUD */ // If aircraft has HUD
hud = fgHUDInit( cur_aircraft, 3 ); hud = fgHUDInit( cur_aircraft ); // Color no longer in parameter list
if( hud == NULL ) if( hud == NULL )
return( NULL ); return( NULL );
cockpit->hud = hud; cockpit->hud = hud;
aircraft_cockpit = cockpit; aircraft_cockpit = cockpit;
fgPrintf( FG_COCKPIT, FG_INFO, fgPrintf( FG_COCKPIT, FG_INFO,
" Code %d Status %d\n", cockpit->hud->code, cockpit->hud->status ); " Code %d Status %d\n",
cockpit->hud->code, cockpit->hud->status );
return( cockpit ); return( cockpit );
} }
struct fgCOCKPIT *fgCockpitAddHUD( struct fgCOCKPIT *cockpit, struct HUD *hud ) fgCOCKPIT *fgCockpitAddHUD( fgCOCKPIT *cockpit, HUD *hud )
{ {
cockpit->hud = hud; cockpit->hud = hud;
return(cockpit); return(cockpit);
@ -94,12 +95,16 @@ void fgCockpitUpdate( void )
/* $Log$ /* $Log$
/* Revision 1.9 1998/02/03 23:20:14 curt /* Revision 1.10 1998/02/07 15:29:33 curt
/* Lots of little tweaks to fix various consistency problems discovered by /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper /* <chotchkiss@namg.us.anritsu.com>
/* passed arguments along to the real printf(). Also incorporated HUD changes
/* by Michele America.
/* /*
* Revision 1.9 1998/02/03 23:20:14 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
* passed arguments along to the real printf(). Also incorporated HUD changes
* by Michele America.
*
* Revision 1.8 1998/01/31 00:43:03 curt * Revision 1.8 1998/01/31 00:43:03 curt
* Added MetroWorks patches from Carmen Volpe. * Added MetroWorks patches from Carmen Volpe.
* *

View file

@ -34,15 +34,15 @@
// And in the future (near future i hope). // And in the future (near future i hope).
// #include <Cockpit/panel.h> // #include <Cockpit/panel.h>
struct fgCOCKPIT { typedef struct {
int code; int code;
Hptr hud; Hptr hud;
// As above. // As above.
// PANEL *panel; // PANEL *panel;
int status; int status;
}; }fgCOCKPIT, *pfgCockpit;
struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft ); fgCOCKPIT *fgCockpitInit( fgAIRCRAFT *cur_aircraft );
void fgCockpitUpdate( void ); void fgCockpitUpdate( void );
@ -50,9 +50,13 @@ void fgCockpitUpdate( void );
/* $Log$ /* $Log$
/* Revision 1.5 1998/01/22 02:59:29 curt /* Revision 1.6 1998/02/07 15:29:33 curt
/* Changed #ifdef FILE_H to #ifdef _FILE_H /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.5 1998/01/22 02:59:29 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H
*
* Revision 1.4 1998/01/19 19:27:01 curt * Revision 1.4 1998/01/19 19:27:01 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously. * This should simplify things tremendously.

File diff suppressed because it is too large Load diff

View file

@ -35,43 +35,42 @@
/* Instrument types */ /* Instrument types */
#define ARTIFICIAL_HORIZON 1 #define ARTIFICIAL_HORIZON 1
#define SCALE 2 #define SCALE 2
#define LADDER 3 #define LADDER 3
#define LABEL 4 #define LABEL 4
#define CONTROL_SURFACES 5
/* Scale constants */ /* Scale constants */
#define HORIZONTAL 1 #define HORIZONTAL 1
#define TOP 2 #define TOP 2
#define BOTTOM 3 #define BOTTOM 3
#define VERTICAL 4 #define VERTICAL 4
#define LEFT 5 #define LEFT 5
#define RIGHT 6 #define RIGHT 6
#define LIMIT 7 #define LIMIT 7
#define NOLIMIT 8 #define NOLIMIT 8
/* Label constants */ /* Label constants */
#define SMALL 1 #define SMALL 1
#define LARGE 2 #define LARGE 2
#define BLINK 3 #define BLINK 3
#define NOBLINK 4 #define NOBLINK 4
#define LEFT_JUST 5 #define LEFT_JUST 5
#define CENTER_JUST 6 #define CENTER_JUST 6
#define RIGHT_JUST 7 #define RIGHT_JUST 7
/* Ladder constants */ /* Ladder constants */
#define NONE 1 #define NONE 1
#define UPPER_LEFT 2 #define UPPER_LEFT 2
#define UPPER_CENTER 3 #define UPPER_CENTER 3
#define UPPER_RIGHT 4 #define UPPER_RIGHT 4
#define CENTER_RIGHT 5 #define CENTER_RIGHT 5
#define LOWER_RIGHT 6 #define LOWER_RIGHT 6
#define LOWER_CENTER 7 #define LOWER_CENTER 7
#define LOWER_LEFT 8 #define LOWER_LEFT 8
#define CENTER_LEFT 9 #define CENTER_LEFT 9
#define SOLID_LINES 10 #define SOLID_LINES 10
#define DASHED_LINES 11 #define DASHED_LINES 11
#define DASHED_NEG_LINES 12 #define DASHED_NEG_LINES 12
/* Ladder orientaion */ /* Ladder orientaion */
// #define HUD_VERTICAL 1 // #define HUD_VERTICAL 1
@ -99,21 +98,37 @@
// #define HUD_INSTR_HORIZON 3 // #define HUD_INSTR_HORIZON 3
// #define HUD_INSTR_LABEL 4 // #define HUD_INSTR_LABEL 4
struct HUD_scale { // The following structs will become classes with a derivation from
int type; // an ABC instrument_pack. Eventually the instruments may well become
int scr_pos; // dll's. This would open the instrumentation issue to all commers.
int scr_min; //
int scr_max; // Methods Needed:
int div_min; // Constructor()
int div_max; // Initialization(); // For dynamic scenario settups?
int orientation; // Update(); // Follow the data changes.
int with_minimum; // Repaint(); // Respond to uncover/panel repaints.
int minimum_value; // Break(); // Show a frown.
int width_units; // Fix(); // Return to normal appearance and function.
double (*load_value)( void ); // Night_Day(); // Illumination changes appearance/bitmaps.
}; //
struct HUD_circular_scale { typedef struct {
int type;
int sub_type;
int scr_pos;
int scr_min;
int scr_max;
int div_min;
int div_max;
int orientation;
int with_minimum;
int minimum_value;
int maximum_value;
int width_units;
double (*load_value)( void );
}HUD_scale, *pHUDscale;
typedef struct {
int type; int type;
int scr_pos; int scr_pos;
int scr_min; int scr_min;
@ -124,9 +139,9 @@ struct HUD_circular_scale {
int label_position; int label_position;
int width_units; int width_units;
double (*load_value)( void ); double (*load_value)( void );
}; }HUD_circular_scale, *pHUD_circscale;
struct HUD_ladder { typedef struct {
int type; int type;
int x_pos; int x_pos;
int y_pos; int y_pos;
@ -138,9 +153,9 @@ struct HUD_ladder {
int width_units; int width_units;
double (*load_roll)( void ); double (*load_roll)( void );
double (*load_pitch)( void ); double (*load_pitch)( void );
}; }HUD_ladder, *pHUDladder;
struct HUD_circular_ladder { typedef struct {
int scr_min; int scr_min;
int scr_max; int scr_max;
int div_min; int div_min;
@ -149,31 +164,30 @@ struct HUD_circular_ladder {
int label_position; int label_position;
int width_units; int width_units;
double (*load_value)( void ); double (*load_value)( void );
}; } HUD_circular_ladder, *pHUDcircladder;
#define HORIZON_FIXED 1 #define HORIZON_FIXED 1
#define HORIZON_MOVING 2 #define HORIZON_MOVING 2
struct HUD_horizon { typedef struct{
int type; int type;
int x_pos; int x_pos;
int y_pos; int y_pos;
int scr_width; int scr_width;
int scr_hole; int scr_hole;
double (*load_value)( void ); double (*load_value)( void );
}; } HUD_horizon, *pHUDhorizon;
struct HUD_control_surfaces { typedef struct {
int type; int type;
int x_pos; int x_pos;
int y_pos; int y_pos;
double (*load_value)(); double (*load_value)();
}; } HUD_control_surfaces, *pHUDControlSurface;
#define LABEL_COUNTER 1 #define LABEL_COUNTER 1
#define LABEL_WARNING 2 #define LABEL_WARNING 2
struct HUD_label { typedef struct {
int type; int type;
int x_pos; int x_pos;
int y_pos; int y_pos;
@ -183,71 +197,133 @@ struct HUD_label {
char *pre_str; char *pre_str;
char *post_str; char *post_str;
char *format; char *format;
double (*load_value)( void ); double (*load_value)( void ); // pointer to routine to get the data
}; } HUD_label, *pHUDlabel;
union HUD_instr_data { // Removed union HUD_instr_data to evolve this to oop code.
struct HUD_scale scale;
struct HUD_circular_scale circ_scale;
struct HUD_ladder ladder;
struct HUD_circular_ladder circ_ladder;
struct HUD_horizon horizon;
struct HUD_label label;
struct HUD_control_surfaces control_surfaces;
};
typedef struct HUD_instr *HIptr; enum hudinstypes { HUDno_instr,
HUDscale,
HUDcirc_scale,
HUDladder,
HUDcirc_ladder,
HUDhorizon,
HUDlabel,
HUDcontrols
};
struct HUD_instr { typedef struct HUD_INSTR_STRUCT{
int type; int type;
int sub_type; int sub_type;
int orientation; int orientation;
union HUD_instr_data instr; void *instr; // For now we will cast this pointer accoring to the value
int color; // of the type member.
HIptr next; struct HUD_INSTR_STRUCT *next;
}; } HUD_instr, *HIptr;
struct HUD { typedef struct {
int code; int code;
// struct HUD_instr *instruments;
HIptr instruments; HIptr instruments;
int status; int status;
}; }HUD, *Hptr;
typedef struct HUD *Hptr; Hptr fgHUDInit ( fgAIRCRAFT *cur_aircraft );
Hptr fgHUDInit( struct fgAIRCRAFT cur_aircraft, int color ); Hptr fgHUDAddHorizon( Hptr hud,
Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, double (*load_value)( void ) ); int x_pos,
Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \ int y_pos,
int orientation, int with_min, int min_value, int width_units, double (*load_value)( void ) ); int length,
Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \ int hole_len,
char *pre_str, char *post_str, char *format, double (*load_value)( void ) ); 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, \ Hptr fgHUDAddScale ( Hptr hud, \
double (*load_roll)( void ), double (*load_pitch)( void ) ); int type, \
Hptr fgHUDAddControlSurfaces( Hptr hud, int x_pos, int y_pos, double (*get_heading)() ); int subtype, \
int scr_pos, \
int scr_min, \
/* struct HUD *fgHUDAddLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \ int scr_max, \
int orientation, int max_value, double *(load_value); int div_min, \
struct HUD *fgHUDAddCircularLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \ int div_max, \
int max_value, double *(load_value) ); int orientation, \
struct HUD *fgHUDAddNumDisp( Hptr hud, int x_pos, int y_pos, int size, int blink, \ int with_min, \
char *pre_str, char *post_str, double *(load_value) ); */ int min_value, \
void fgUpdateHUD( Hptr hud ); int width_units, \
void fgUpdateHUD2( struct HUD *hud ); 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)( 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)( void ), \
double (*load_pitch)( void ) );
Hptr fgHUDAddControlSurfaces( Hptr hud,
int x_pos,
int y_pos,
double (*load_value)(void) );
/*
Hptr fgHUDAddLadder ( Hptr hud,
int scr_min,
int scr_max,
int div_min,
int div_max, \
int orientation,
int max_value,
double *(load_value);
Hptr fgHUDAddCircularLadder( Hptr hud,
int scr_min,
int scr_max,
int div_min,
int div_max, \
int max_value,
double *(load_value) );
Hptr fgHUDAddNumDisp( Hptr hud,
int x_pos,
int y_pos,
int size,
int blink, \
char *pre_str,
char *post_str,
double *(load_value) );
*/
void fgUpdateHUD ( Hptr hud );
void fgUpdateHUD2( Hptr hud ); // Future use?
#endif /* _HUD_H */ #endif /* _HUD_H */
/* $Log$ /* $Log$
/* Revision 1.7 1998/02/03 23:20:15 curt /* Revision 1.8 1998/02/07 15:29:35 curt
/* Lots of little tweaks to fix various consistency problems discovered by /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper /* <chotchkiss@namg.us.anritsu.com>
/* passed arguments along to the real printf(). Also incorporated HUD changes
/* by Michele America.
/* /*
* Revision 1.7 1998/02/03 23:20:15 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
* passed arguments along to the real printf(). Also incorporated HUD changes
* by Michele America.
*
* Revision 1.6 1998/01/22 02:59:30 curt * Revision 1.6 1998/01/22 02:59:30 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H * Changed #ifdef FILE_H to #ifdef _FILE_H
* *

View file

@ -28,10 +28,13 @@
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.h>
fgCONTROLS cur_control_params;
void fgControlsInit( void ) { void fgControlsInit( void ) {
int i; int i;
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
FG_Elevator = 0.0; FG_Elevator = 0.0;
FG_Elev_Trim = 1.969572E-03; FG_Elev_Trim = 1.969572E-03;
@ -46,8 +49,8 @@ void fgControlsInit( void ) {
void fgElevMove(double amt) { void fgElevMove(double amt) {
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
FG_Elevator += amt; FG_Elevator += amt;
@ -56,8 +59,8 @@ void fgElevMove(double amt) {
} }
void fgElevSet(double pos) { void fgElevSet(double pos) {
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
FG_Elevator = pos; FG_Elevator = pos;
@ -66,8 +69,8 @@ void fgElevSet(double pos) {
} }
void fgElevTrimMove(double amt) { void fgElevTrimMove(double amt) {
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
FG_Elev_Trim += amt; FG_Elev_Trim += amt;
@ -76,8 +79,8 @@ void fgElevTrimMove(double amt) {
} }
void fgElevTrimSet(double pos) { void fgElevTrimSet(double pos) {
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
FG_Elev_Trim = pos; FG_Elev_Trim = pos;
@ -86,8 +89,8 @@ void fgElevTrimSet(double pos) {
} }
void fgAileronMove(double amt) { void fgAileronMove(double amt) {
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
FG_Aileron += amt; FG_Aileron += amt;
@ -96,8 +99,8 @@ void fgAileronMove(double amt) {
} }
void fgAileronSet(double pos) { void fgAileronSet(double pos) {
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
FG_Aileron = pos; FG_Aileron = pos;
@ -106,8 +109,8 @@ void fgAileronSet(double pos) {
} }
void fgRudderMove(double amt) { void fgRudderMove(double amt) {
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
FG_Rudder += amt; FG_Rudder += amt;
@ -116,8 +119,8 @@ void fgRudderMove(double amt) {
} }
void fgRudderSet(double pos) { void fgRudderSet(double pos) {
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
FG_Rudder = pos; FG_Rudder = pos;
@ -127,8 +130,8 @@ void fgRudderSet(double pos) {
void fgThrottleMove(int engine, double amt) { void fgThrottleMove(int engine, double amt) {
int i; int i;
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
if ( engine == FG_Throttle_All ) { if ( engine == FG_Throttle_All ) {
for ( i = 0; i < FG_MAX_ENGINES; i++ ) { for ( i = 0; i < FG_MAX_ENGINES; i++ ) {
@ -147,8 +150,8 @@ void fgThrottleMove(int engine, double amt) {
void fgThrottleSet(int engine, double pos) { void fgThrottleSet(int engine, double pos) {
int i; int i;
struct fgCONTROLS *c; fgCONTROLS *c;
c = &current_aircraft.controls; c = current_aircraft.controls;
if ( engine == FG_Throttle_All ) { if ( engine == FG_Throttle_All ) {
for ( i = 0; i < FG_MAX_ENGINES; i++ ) { for ( i = 0; i < FG_MAX_ENGINES; i++ ) {
@ -167,10 +170,14 @@ void fgThrottleSet(int engine, double pos) {
/* $Log$ /* $Log$
/* Revision 1.6 1998/01/19 19:27:02 curt /* Revision 1.7 1998/02/07 15:29:36 curt
/* Merged in make system changes from Bob Kuehne <rpk@sgi.com> /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* This should simplify things tremendously. /* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.6 1998/01/19 19:27:02 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:22 curt * Revision 1.5 1998/01/19 18:40:22 curt
* Tons of little changes to clean up the code and to remove fatal errors * Tons of little changes to clean up the code and to remove fatal errors
* when building with the c++ compiler. * when building with the c++ compiler.

View file

@ -33,13 +33,13 @@
/* Define a structure containing the control parameters */ /* Define a structure containing the control parameters */
struct fgCONTROLS { typedef struct {
double aileron; double aileron;
double elevator; double elevator;
double elevator_trim; double elevator_trim;
double rudder; double rudder;
double throttle[FG_MAX_ENGINES]; double throttle[FG_MAX_ENGINES];
}; } fgCONTROLS, *pfgControls;
#define FG_Elevator c->elevator #define FG_Elevator c->elevator
@ -62,6 +62,8 @@ struct fgCONTROLS {
*/ */
extern fgCONTROLS cur_control_params;
void fgControlsInit( void ); void fgControlsInit( void );
void fgElevMove(double amt); void fgElevMove(double amt);
@ -80,10 +82,14 @@ void fgThrottleSet(int engine, double pos);
/* $Log$ /* $Log$
/* Revision 1.10 1998/01/27 00:47:52 curt /* Revision 1.11 1998/02/07 15:29:36 curt
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* system and commandline/config file processing code. /* <chotchkiss@namg.us.anritsu.com>
/* /*
* 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 * Revision 1.9 1998/01/22 02:59:31 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H * Changed #ifdef FILE_H to #ifdef _FILE_H
* *

View file

@ -28,8 +28,12 @@
#include <Flight/LaRCsim/ls_interface.h> #include <Flight/LaRCsim/ls_interface.h>
#include <Main/fg_debug.h> #include <Main/fg_debug.h>
fgFLIGHT cur_flight_params;
/* Initialize the flight model parameters */ /* Initialize the flight model parameters */
int fgFlightModelInit(int model, struct fgFLIGHT *f, double dt) { int fgFlightModelInit(int model, fgFLIGHT *f, double dt) {
int result; int result;
fgPrintf(FG_FLIGHT,FG_INFO,"Initializing flight model\n"); fgPrintf(FG_FLIGHT,FG_INFO,"Initializing flight model\n");
@ -50,7 +54,7 @@ int fgFlightModelInit(int model, struct fgFLIGHT *f, double dt) {
/* Run multiloop iterations of the flight model */ /* Run multiloop iterations of the flight model */
int fgFlightModelUpdate(int model, struct fgFLIGHT *f, int multiloop) { int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop) {
int result; int result;
if ( model == FG_LARCSIM ) { if ( model == FG_LARCSIM ) {
@ -68,10 +72,14 @@ int fgFlightModelUpdate(int model, struct fgFLIGHT *f, int multiloop) {
/* $Log$ /* $Log$
/* Revision 1.9 1998/01/27 00:47:53 curt /* Revision 1.10 1998/02/07 15:29:37 curt
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* system and commandline/config file processing code. /* <chotchkiss@namg.us.anritsu.com>
/* /*
* 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 * Revision 1.8 1998/01/19 19:27:03 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously. * This should simplify things tremendously.

View file

@ -49,7 +49,7 @@
typedef double FG_VECTOR_3[3]; typedef double FG_VECTOR_3[3];
/* This is based heavily on LaRCsim/ls_generic.h */ /* This is based heavily on LaRCsim/ls_generic.h */
struct fgFLIGHT { typedef struct {
/*================== Mass properties and geometry values ==================*/ /*================== Mass properties and geometry values ==================*/
@ -382,25 +382,32 @@ struct fgFLIGHT {
#define FG_Y_pilot_rwy f->d_pilot_rwy_rwy_v[1] #define FG_Y_pilot_rwy f->d_pilot_rwy_rwy_v[1]
#define FG_H_pilot_rwy f->d_pilot_rwy_rwy_v[2] #define FG_H_pilot_rwy f->d_pilot_rwy_rwy_v[2]
}; } fgFLIGHT, *pfgFlight;
extern fgFLIGHT cur_flight_params;
/* General interface to the flight model routines */ /* General interface to the flight model routines */
/* Initialize the flight model parameters */ /* Initialize the flight model parameters */
int fgFlightModelInit(int model, struct fgFLIGHT *f, double dt); int fgFlightModelInit(int model, fgFLIGHT *f, double dt);
/* Run multiloop iterations of the flight model */ /* Run multiloop iterations of the flight model */
int fgFlightModelUpdate(int model, struct fgFLIGHT *f, int multiloop); int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop);
#endif /* _FLIGHT_H */ #endif /* _FLIGHT_H */
/* $Log$ /* $Log$
/* Revision 1.13 1998/01/24 00:04:59 curt /* Revision 1.14 1998/02/07 15:29:37 curt
/* misc. tweaks. /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.13 1998/01/24 00:04:59 curt
* misc. tweaks.
*
* Revision 1.12 1998/01/22 02:59:32 curt * Revision 1.12 1998/01/22 02:59:32 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H * Changed #ifdef FILE_H to #ifdef _FILE_H
* *

View file

@ -496,11 +496,11 @@ void ls_loop( SCALAR dt, int initialize ) {
int ls_cockpit( void ) { int ls_cockpit( void ) {
struct fgCONTROLS *c; fgCONTROLS *c;
sim_control_.paused = 0; sim_control_.paused = 0;
c = &current_aircraft.controls; c = current_aircraft.controls;
Lat_control = FG_Aileron; Lat_control = FG_Aileron;
Long_control = FG_Elevator; Long_control = FG_Elevator;
@ -562,7 +562,7 @@ int fgLaRCsimUpdate(int multiloop) {
/* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */ /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
int fgFlight_2_LaRCsim (struct fgFLIGHT *f) { int fgFlight_2_LaRCsim (fgFLIGHT *f) {
Mass = FG_Mass; Mass = FG_Mass;
I_xx = FG_I_xx; I_xx = FG_I_xx;
I_yy = FG_I_yy; I_yy = FG_I_yy;
@ -738,7 +738,7 @@ int fgFlight_2_LaRCsim (struct fgFLIGHT *f) {
/* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */ /* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */
int fgLaRCsim_2_Flight (struct fgFLIGHT *f) { int fgLaRCsim_2_Flight (fgFLIGHT *f) {
FG_Mass = Mass; FG_Mass = Mass;
FG_I_xx = I_xx; FG_I_xx = I_xx;
FG_I_yy = I_yy; FG_I_yy = I_yy;
@ -915,6 +915,10 @@ int fgLaRCsim_2_Flight (struct fgFLIGHT *f) {
/* Flight Gear Modification Log /* Flight Gear Modification Log
* *
* $Log$ * $Log$
* Revision 1.16 1998/02/07 15:29:38 curt
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com>
*
* Revision 1.15 1998/01/22 22:03:47 curt * Revision 1.15 1998/01/22 22:03:47 curt
* Removed #include <sys/stat.h> * Removed #include <sys/stat.h>
* *

View file

@ -39,10 +39,10 @@ int fgLaRCsimInit(double dt);
int fgLaRCsimUpdate(int multiloop); int fgLaRCsimUpdate(int multiloop);
/* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */ /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
int fgFlight_2_LaRCsim (struct fgFLIGHT *f); int fgFlight_2_LaRCsim (fgFLIGHT *f);
/* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */ /* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */
int fgLaRCsim_2_Flight (struct fgFLIGHT *f); int fgLaRCsim_2_Flight (fgFLIGHT *f);
void ls_loop( SCALAR dt, int initialize ); void ls_loop( SCALAR dt, int initialize );
@ -51,12 +51,16 @@ void ls_loop( SCALAR dt, int initialize );
/* $Log$ /* $Log$
/* Revision 1.6 1998/02/03 23:20:17 curt /* Revision 1.7 1998/02/07 15:29:39 curt
/* Lots of little tweaks to fix various consistency problems discovered by /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper /* <chotchkiss@namg.us.anritsu.com>
/* passed arguments along to the real printf(). Also incorporated HUD changes
/* by Michele America.
/* /*
* Revision 1.6 1998/02/03 23:20:17 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
* passed arguments along to the real printf(). Also incorporated HUD changes
* by Michele America.
*
* Revision 1.5 1998/01/19 19:27:05 curt * Revision 1.5 1998/01/19 19:27:05 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously. * This should simplify things tremendously.

View file

@ -49,12 +49,12 @@ extern int displayInstruments;
/* Handle keyboard events */ /* Handle keyboard events */
void GLUTkey(unsigned char k, int x, int y) { void GLUTkey(unsigned char k, int x, int y) {
struct fgCONTROLS *c; fgCONTROLS *c;
struct fgTIME *t; struct fgTIME *t;
struct fgVIEW *v; struct fgVIEW *v;
struct fgWEATHER *w; struct fgWEATHER *w;
c = &current_aircraft.controls; c = current_aircraft.controls;
t = &cur_time_params; t = &cur_time_params;
v = &current_view; v = &current_view;
w = &current_weather; w = &current_weather;
@ -165,10 +165,10 @@ void GLUTkey(unsigned char k, int x, int y) {
/* Handle "special" keyboard events */ /* Handle "special" keyboard events */
void GLUTspecialkey(int k, int x, int y) { void GLUTspecialkey(int k, int x, int y) {
struct fgCONTROLS *c; fgCONTROLS *c;
struct fgVIEW *v; struct fgVIEW *v;
c = &current_aircraft.controls; c = current_aircraft.controls;
v = &current_view; v = &current_view;
fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k); fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k);
@ -245,12 +245,16 @@ void GLUTspecialkey(int k, int x, int y) {
/* $Log$ /* $Log$
/* Revision 1.28 1998/02/03 23:20:23 curt /* Revision 1.29 1998/02/07 15:29:40 curt
/* Lots of little tweaks to fix various consistency problems discovered by /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper /* <chotchkiss@namg.us.anritsu.com>
/* passed arguments along to the real printf(). Also incorporated HUD changes
/* by Michele America.
/* /*
* Revision 1.28 1998/02/03 23:20:23 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
* passed arguments along to the real printf(). Also incorporated HUD changes
* by Michele America.
*
* Revision 1.27 1998/01/27 00:47:55 curt * Revision 1.27 1998/01/27 00:47:55 curt
* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
* system and commandline/config file processing code. * system and commandline/config file processing code.

View file

@ -123,12 +123,12 @@ static void fgInitVisuals( void ) {
**************************************************************************/ **************************************************************************/
static void fgUpdateViewParams( void ) { static void fgUpdateViewParams( void ) {
struct fgFLIGHT *f; fgFLIGHT *f;
struct fgLIGHT *l; struct fgLIGHT *l;
struct fgTIME *t; struct fgTIME *t;
struct fgVIEW *v; struct fgVIEW *v;
f = &current_aircraft.flight; f = current_aircraft.flight;
l = &cur_light_params; l = &cur_light_params;
t = &cur_time_params; t = &cur_time_params;
v = &current_view; v = &current_view;
@ -317,12 +317,12 @@ static void fgRenderFrame( void ) {
**************************************************************************/ **************************************************************************/
void fgUpdateTimeDepCalcs(int multi_loop) { void fgUpdateTimeDepCalcs(int multi_loop) {
struct fgFLIGHT *f; fgFLIGHT *f;
struct fgTIME *t; struct fgTIME *t;
struct fgVIEW *v; struct fgVIEW *v;
int i; int i;
f = &current_aircraft.flight; f = current_aircraft.flight;
t = &cur_time_params; t = &cur_time_params;
v = &current_view; v = &current_view;
@ -467,15 +467,15 @@ static void fgMainLoop( void ) {
double cur_elev; double cur_elev;
/* double joy_x, joy_y; */ /* double joy_x, joy_y; */
/* int joy_b1, joy_b2; */ /* int joy_b1, joy_b2; */
struct fgAIRCRAFT *a; fgAIRCRAFT *a;
struct fgFLIGHT *f; fgFLIGHT *f;
struct fgTIME *t; struct fgTIME *t;
fgPrintf( FG_ALL, FG_DEBUG, "Running Main Loop\n"); fgPrintf( FG_ALL, FG_DEBUG, "Running Main Loop\n");
fgPrintf( FG_ALL, FG_DEBUG, "======= ==== ====\n"); fgPrintf( FG_ALL, FG_DEBUG, "======= ==== ====\n");
a = &current_aircraft; a = &current_aircraft;
f = &a->flight; f = a->flight;
t = &cur_time_params; t = &cur_time_params;
/* update "time" */ /* update "time" */
@ -571,9 +571,9 @@ static void fgReshape( int width, int height ) {
**************************************************************************/ **************************************************************************/
int main( int argc, char *argv[] ) { int main( int argc, char *argv[] ) {
struct fgFLIGHT *f; fgFLIGHT *f;
f = &current_aircraft.flight; f = current_aircraft.flight;
printf("Flight Gear: Version %s\n\n", VERSION); printf("Flight Gear: Version %s\n\n", VERSION);
@ -647,12 +647,16 @@ int main( int argc, char *argv[] ) {
#endif #endif
/* $Log$ /* $Log$
/* Revision 1.56 1998/02/03 23:20:23 curt /* Revision 1.57 1998/02/07 15:29:40 curt
/* Lots of little tweaks to fix various consistency problems discovered by /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper /* <chotchkiss@namg.us.anritsu.com>
/* passed arguments along to the real printf(). Also incorporated HUD changes
/* by Michele America.
/* /*
* Revision 1.56 1998/02/03 23:20:23 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
* passed arguments along to the real printf(). Also incorporated HUD changes
* by Michele America.
*
* Revision 1.55 1998/02/02 20:53:58 curt * Revision 1.55 1998/02/02 20:53:58 curt
* Incorporated Durk's changes. * Incorporated Durk's changes.
* *

View file

@ -65,6 +65,7 @@ static struct {
{ "FG_GENERAL", 0x00000080 }, { "FG_GENERAL", 0x00000080 },
{ "FG_MATH", 0x00000100 }, { "FG_MATH", 0x00000100 },
{ "FG_EVENT", 0x00000200 }, { "FG_EVENT", 0x00000200 },
{ "FG_AIRCRAFT",0x00000400 },
/* Do not edit below here, last entry should be null */ /* Do not edit below here, last entry should be null */
{ "FG_ALL", 0xFFFFFFFF }, { "FG_ALL", 0xFFFFFFFF },

View file

@ -44,6 +44,7 @@ typedef enum {
FG_GENERAL = 0x00000080, FG_GENERAL = 0x00000080,
FG_MATH = 0x00000100, FG_MATH = 0x00000100,
FG_EVENT = 0x00000200, FG_EVENT = 0x00000200,
FG_AIRCRAFT= 0x00000400,
FG_ALL = 0xFFFFFFFF FG_ALL = 0xFFFFFFFF
} fgDebugClass; } fgDebugClass;

View file

@ -86,12 +86,11 @@ void fgInitGeneral( void ) {
void fgInitSubsystems( void ) { void fgInitSubsystems( void ) {
double cur_elev; double cur_elev;
struct fgFLIGHT *f; fgFLIGHT *f;
struct fgLIGHT *l; struct fgLIGHT *l;
struct fgTIME *t; struct fgTIME *t;
struct fgVIEW *v; struct fgVIEW *v;
f = &current_aircraft.flight;
l = &cur_light_params; l = &cur_light_params;
t = &cur_time_params; t = &cur_time_params;
v = &current_view; v = &current_view;
@ -104,6 +103,11 @@ void fgInitSubsystems( void ) {
* should really be read in from one or more files. * should really be read in from one or more files.
****************************************************************/ ****************************************************************/
/* Must happen before any of the flight model or control
* parameters are set */
fgAircraftInit();
f = current_aircraft.flight;
/* Globe Aiport, AZ */ /* Globe Aiport, AZ */
FG_Runway_longitude = -398391.28; FG_Runway_longitude = -398391.28;
FG_Runway_latitude = 120070.41; FG_Runway_latitude = 120070.41;
@ -251,7 +255,7 @@ void fgInitSubsystems( void ) {
FG_EVENT_READY, 120000 ); FG_EVENT_READY, 120000 );
/* Initialize the Cockpit subsystem */ /* Initialize the Cockpit subsystem */
if( fgCockpitInit( current_aircraft ) == NULL ) { if( fgCockpitInit( &current_aircraft ) == NULL ) {
fgPrintf( FG_GENERAL, FG_EXIT, "Error in Cockpit initialization!\n" ); fgPrintf( FG_GENERAL, FG_EXIT, "Error in Cockpit initialization!\n" );
} }
@ -324,12 +328,16 @@ void fgInitSubsystems( void ) {
/* $Log$ /* $Log$
/* Revision 1.39 1998/02/03 23:20:25 curt /* Revision 1.40 1998/02/07 15:29:44 curt
/* Lots of little tweaks to fix various consistency problems discovered by /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper /* <chotchkiss@namg.us.anritsu.com>
/* passed arguments along to the real printf(). Also incorporated HUD changes
/* by Michele America.
/* /*
* Revision 1.39 1998/02/03 23:20:25 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
* passed arguments along to the real printf(). Also incorporated HUD changes
* by Michele America.
*
* Revision 1.38 1998/02/02 20:53:58 curt * Revision 1.38 1998/02/02 20:53:58 curt
* Incorporated Durk's changes. * Incorporated Durk's changes.
* *

View file

@ -50,7 +50,7 @@ void fgViewInit(struct fgVIEW *v) {
/* Update the view parameters */ /* Update the view parameters */
void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) { void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
MAT3vec vec, forward, v0, minus_z; MAT3vec vec, forward, v0, minus_z;
MAT3mat R, TMP, UP, LOCAL, VIEW; MAT3mat R, TMP, UP, LOCAL, VIEW;
double ntmp; double ntmp;
@ -69,9 +69,9 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
v->view_pos.y = v->abs_view_pos.y - scenery.center.y; v->view_pos.y = v->abs_view_pos.y - scenery.center.y;
v->view_pos.z = v->abs_view_pos.z - scenery.center.z; v->view_pos.z = v->abs_view_pos.z - scenery.center.z;
printf( "View pos = %.4f, %.4f, %.4f\n", fgPrintf( FG_VIEW, FG_DEBUG, "Absolute view pos = %.4f, %.4f, %.4f\n",
v->abs_view_pos.x, v->abs_view_pos.y, v->abs_view_pos.z); v->abs_view_pos.x, v->abs_view_pos.y, v->abs_view_pos.z);
fgPrintf( FG_VIEW, FG_DEBUG, "View pos = %.4f, %.4f, %.4f\n", fgPrintf( FG_VIEW, FG_DEBUG, "Relative view pos = %.4f, %.4f, %.4f\n",
v->view_pos.x, v->view_pos.y, v->view_pos.z); v->view_pos.x, v->view_pos.y, v->view_pos.z);
/* make a vector to the current view position */ /* make a vector to the current view position */
@ -184,9 +184,13 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
/* $Log$ /* $Log$
/* Revision 1.12 1998/01/29 00:50:28 curt /* Revision 1.13 1998/02/07 15:29:45 curt
/* Added a view record field for absolute x, y, z position. /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.12 1998/01/29 00:50:28 curt
* Added a view record field for absolute x, y, z position.
*
* Revision 1.11 1998/01/27 00:47:58 curt * Revision 1.11 1998/01/27 00:47:58 curt
* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
* system and commandline/config file processing code. * system and commandline/config file processing code.

View file

@ -85,16 +85,20 @@ extern struct fgVIEW current_view;
void fgViewInit(struct fgVIEW *v); void fgViewInit(struct fgVIEW *v);
/* Update the view parameters */ /* Update the view parameters */
void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l); void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l);
#endif /* _VIEWS_H */ #endif /* _VIEWS_H */
/* $Log$ /* $Log$
/* Revision 1.9 1998/01/29 00:50:29 curt /* Revision 1.10 1998/02/07 15:29:45 curt
/* Added a view record field for absolute x, y, z position. /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.9 1998/01/29 00:50:29 curt
* Added a view record field for absolute x, y, z position.
*
* Revision 1.8 1998/01/27 00:47:58 curt * Revision 1.8 1998/01/27 00:47:58 curt
* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
* system and commandline/config file processing code. * system and commandline/config file processing code.

View file

@ -76,12 +76,12 @@ void fgTileMgrLoadTile( struct fgBUCKET *p, int *index) {
/* given the current lon/lat, fill in the array of local chunks. If /* 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. */ * the chunk isn't already in the cache, then read it from disk. */
void fgTileMgrUpdate( void ) { void fgTileMgrUpdate( void ) {
struct fgFLIGHT *f; fgFLIGHT *f;
struct fgBUCKET p1, p2; struct fgBUCKET p1, p2;
static struct fgBUCKET p_last = {-1000, 0, 0, 0}; static struct fgBUCKET p_last = {-1000, 0, 0, 0};
int i, j, dw, dh; int i, j, dw, dh;
f = &current_aircraft.flight; f = current_aircraft.flight;
fgBucketFind(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p1); fgBucketFind(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p1);
dw = FG_LOCAL_X / 2; dw = FG_LOCAL_X / 2;
@ -211,9 +211,13 @@ void fgTileMgrRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.12 1998/02/01 03:39:55 curt /* Revision 1.13 1998/02/07 15:29:46 curt
/* Minor tweaks. /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.12 1998/02/01 03:39:55 curt
* Minor tweaks.
*
* Revision 1.11 1998/01/31 00:43:27 curt * Revision 1.11 1998/01/31 00:43:27 curt
* Added MetroWorks patches from Carmen Volpe. * Added MetroWorks patches from Carmen Volpe.
* *

View file

@ -44,9 +44,9 @@
/* reset flight params to a specific position */ /* reset flight params to a specific position */
void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) { void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
struct fgFLIGHT *f; fgFLIGHT *f;
f = &current_aircraft.flight; f = current_aircraft.flight;
/* /*
f->pos_x = pos_x; f->pos_x = pos_x;
@ -72,11 +72,11 @@ void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
/* update position based on inputs, positions, velocities, etc. */ /* update position based on inputs, positions, velocities, etc. */
void fgSlewUpdate( void ) { void fgSlewUpdate( void ) {
struct fgFLIGHT *f; fgFLIGHT *f;
struct fgCONTROLS *c; fgCONTROLS *c;
f = &current_aircraft.flight; f = current_aircraft.flight;
c = &current_aircraft.controls; c = current_aircraft.controls;
/* f->Psi += ( c->aileron / 8 ); /* f->Psi += ( c->aileron / 8 );
if ( f->Psi > FG_2PI ) { if ( f->Psi > FG_2PI ) {
@ -93,10 +93,14 @@ void fgSlewUpdate( void ) {
/* $Log$ /* $Log$
/* Revision 1.10 1998/01/27 00:47:53 curt /* Revision 1.11 1998/02/07 15:29:39 curt
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* system and commandline/config file processing code. /* <chotchkiss@namg.us.anritsu.com>
/* /*
* 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 * Revision 1.9 1998/01/19 19:27:06 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously. * This should simplify things tremendously.

View file

@ -250,7 +250,7 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
/* Update the time dependent variables */ /* Update the time dependent variables */
void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) { void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t) {
double gst_precise, gst_course; double gst_precise, gst_course;
fgPrintf( FG_EVENT, FG_BULK, "Updating time\n"); fgPrintf( FG_EVENT, FG_BULK, "Updating time\n");
@ -311,9 +311,13 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
/* $Log$ /* $Log$
/* Revision 1.33 1998/02/02 20:54:04 curt /* Revision 1.34 1998/02/07 15:29:47 curt
/* Incorporated Durk's changes. /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* <chotchkiss@namg.us.anritsu.com>
/* /*
* Revision 1.33 1998/02/02 20:54:04 curt
* Incorporated Durk's changes.
*
* Revision 1.32 1998/02/01 03:39:56 curt * Revision 1.32 1998/02/01 03:39:56 curt
* Minor tweaks. * Minor tweaks.
* *

View file

@ -92,17 +92,21 @@ extern struct fgLIGHT cur_light_params;
void fgTimeInit(struct fgTIME *t); void fgTimeInit(struct fgTIME *t);
/* Update the time dependent variables */ /* Update the time dependent variables */
void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t); void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t);
#endif /* _FG_TIME_H */ #endif /* _FG_TIME_H */
/* $Log$ /* $Log$
/* Revision 1.15 1998/01/27 00:48:06 curt /* Revision 1.16 1998/02/07 15:29:47 curt
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
/* system and commandline/config file processing code. /* <chotchkiss@namg.us.anritsu.com>
/* /*
* 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 * Revision 1.14 1998/01/22 02:59:43 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H * Changed #ifdef FILE_H to #ifdef _FILE_H
* *