From: curt Date: Sat, 7 Feb 1998 15:29:31 +0000 (+0000) Subject: Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=50c0f6c9e628b9e1ff6bfecfa4ce04084beaccb7;p=flightgear.git Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss --- diff --git a/Aircraft/aircraft.c b/Aircraft/aircraft.c index 62673933e..5d478b832 100644 --- a/Aircraft/aircraft.c +++ b/Aircraft/aircraft.c @@ -32,16 +32,25 @@ /* This is a record containing all the info for the aircraft currently 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 */ -void fgAircraftOutputCurrent(struct fgAIRCRAFT *a) { - struct fgFLIGHT *f; - struct fgCONTROLS *c; +void fgAircraftOutputCurrent(fgAIRCRAFT *a) { + fgFLIGHT *f; + fgCONTROLS *c; - f = &a->flight; - c = &a->controls; + f = a->flight; + c = a->controls; fgPrintf( FG_FLIGHT, FG_DEBUG, "Pos = (%.2f,%.2f,%.2f) (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n", @@ -55,10 +64,14 @@ void fgAircraftOutputCurrent(struct fgAIRCRAFT *a) { /* $Log$ -/* Revision 1.15 1998/01/27 00:47:46 curt -/* Incorporated Paul Bleisch's new debug message -/* system and commandline/config file processing code. +/* Revision 1.16 1998/02/07 15:29:31 curt +/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss +/* /* + * Revision 1.15 1998/01/27 00:47:46 curt + * Incorporated Paul Bleisch's 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 * This should simplify things tremendously. diff --git a/Aircraft/aircraft.h b/Aircraft/aircraft.h index b0b8ff3c1..cbdc86b19 100644 --- a/Aircraft/aircraft.h +++ b/Aircraft/aircraft.h @@ -32,28 +32,36 @@ /* Define a structure containing all the parameters for an aircraft */ -struct fgAIRCRAFT { - struct fgFLIGHT flight; - struct fgCONTROLS controls; -}; +typedef struct{ + fgFLIGHT *flight; + fgCONTROLS *controls; +} fgAIRCRAFT ; /* current_aircraft contains all the parameters of the aircraft currently being operated. */ -extern struct fgAIRCRAFT current_aircraft; +extern fgAIRCRAFT current_aircraft; + + +/* Initialize an Aircraft structure */ +void fgAircraftInit( void ); /* Display various parameters to stdout */ -void fgAircraftOutputCurrent(struct fgAIRCRAFT *a); +void fgAircraftOutputCurrent(fgAIRCRAFT *a); #endif /* _AIRCRAFT_H */ /* $Log$ -/* Revision 1.9 1998/01/22 02:59:23 curt -/* Changed #ifdef FILE_H to #ifdef _FILE_H +/* Revision 1.10 1998/02/07 15:29:32 curt +/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss +/* /* + * 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 * Merged in make system changes from Bob Kuehne * This should simplify things tremendously. @@ -63,9 +71,13 @@ void fgAircraftOutputCurrent(struct fgAIRCRAFT *a); /* $Log$ -/* Revision 1.9 1998/01/22 02:59:23 curt -/* Changed #ifdef FILE_H to #ifdef _FILE_H +/* Revision 1.10 1998/02/07 15:29:32 curt +/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss +/* /* + * 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 * Merged in make system changes from Bob Kuehne * This should simplify things tremendously. diff --git a/Astro/moon.c b/Astro/moon.c index 4717c695b..11c63667c 100644 --- a/Astro/moon.c +++ b/Astro/moon.c @@ -58,11 +58,11 @@ struct CelestialCoord fgCalculateMoon(struct OrbElements params, xv, yv, v, r, xh, yh, zh, xg, yg, zg, xe, ye, ze, Ls, Lm, D, F, mpar, gclat, rho, HA, g; - struct fgAIRCRAFT *a; - struct fgFLIGHT *f; + fgAIRCRAFT *a; + fgFLIGHT *f; a = ¤t_aircraft; - f = &a->flight; + f = a->flight; /* calculate the angle between ecliptic and equatorial coordinate * system, in Radians */ @@ -226,9 +226,13 @@ void fgMoonRender( void ) { /* $Log$ -/* Revision 1.5 1998/02/02 20:53:21 curt -/* To version 0.29 +/* Revision 1.6 1998/02/07 15:29:32 curt +/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss +/* /* + * Revision 1.5 1998/02/02 20:53:21 curt + * To version 0.29 + * * Revision 1.4 1998/01/27 00:47:46 curt * Incorporated Paul Bleisch's new debug message * system and commandline/config file processing code. diff --git a/Astro/sky.c b/Astro/sky.c index 15cdf7759..0244236aa 100644 --- a/Astro/sky.c +++ b/Astro/sky.c @@ -248,13 +248,13 @@ void fgSkyInit( void ) { /* Draw the Sky */ void fgSkyRender( void ) { - struct fgFLIGHT *f; + fgFLIGHT *f; struct fgLIGHT *l; struct fgVIEW *v; float /* inner_color[4], middle_color[4], diff, */ east_dot, dot, angle; int i; - f = ¤t_aircraft.flight; + f = current_aircraft.flight; l = &cur_light_params; v = ¤t_view; @@ -353,10 +353,14 @@ void fgSkyRender( void ) { /* $Log$ -/* Revision 1.5 1998/01/27 00:47:48 curt -/* Incorporated Paul Bleisch's new debug message -/* system and commandline/config file processing code. +/* Revision 1.6 1998/02/07 15:29:32 curt +/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss +/* /* + * Revision 1.5 1998/01/27 00:47:48 curt + * Incorporated Paul Bleisch's 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. diff --git a/Cockpit/cockpit.c b/Cockpit/cockpit.c index 8a22819cb..8b4b21f76 100644 --- a/Cockpit/cockpit.c +++ b/Cockpit/cockpit.c @@ -22,7 +22,7 @@ * $Id$ * (Log is kept at end of this file) **************************************************************************/ - + #include @@ -41,41 +41,42 @@ #include
-// #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 struct fgCOCKPIT *aircraft_cockpit; +static fgCOCKPIT *aircraft_cockpit; -struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft ) +fgCOCKPIT *fgCockpitInit( fgAIRCRAFT *cur_aircraft ) { - struct fgCOCKPIT *cockpit; + fgCOCKPIT *cockpit; Hptr hud; - + 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 ) return( NULL ); - + cockpit->code = 1; /* It will be aircraft dependent */ cockpit->status = 0; - - /* If aircraft has HUD */ - hud = fgHUDInit( cur_aircraft, 3 ); + + // If aircraft has HUD + hud = fgHUDInit( cur_aircraft ); // Color no longer in parameter list if( hud == NULL ) return( NULL ); - + cockpit->hud = hud; - + aircraft_cockpit = cockpit; - + 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 ); } -struct fgCOCKPIT *fgCockpitAddHUD( struct fgCOCKPIT *cockpit, struct HUD *hud ) +fgCOCKPIT *fgCockpitAddHUD( fgCOCKPIT *cockpit, HUD *hud ) { cockpit->hud = hud; return(cockpit); @@ -94,12 +95,16 @@ void fgCockpitUpdate( void ) /* $Log$ -/* 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.10 1998/02/07 15:29:33 curt +/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss +/* /* + * 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 * Added MetroWorks patches from Carmen Volpe. * diff --git a/Cockpit/cockpit.h b/Cockpit/cockpit.h index 6de1d0ca1..237397b66 100644 --- a/Cockpit/cockpit.h +++ b/Cockpit/cockpit.h @@ -34,15 +34,15 @@ // And in the future (near future i hope). // #include -struct fgCOCKPIT { +typedef struct { int code; Hptr hud; // As above. // PANEL *panel; int status; -}; +}fgCOCKPIT, *pfgCockpit; -struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft ); +fgCOCKPIT *fgCockpitInit( fgAIRCRAFT *cur_aircraft ); void fgCockpitUpdate( void ); @@ -50,9 +50,13 @@ void fgCockpitUpdate( void ); /* $Log$ -/* Revision 1.5 1998/01/22 02:59:29 curt -/* Changed #ifdef FILE_H to #ifdef _FILE_H +/* Revision 1.6 1998/02/07 15:29:33 curt +/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss +/* /* + * 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 * Merged in make system changes from Bob Kuehne * This should simplify things tremendously. diff --git a/Cockpit/hud.c b/Cockpit/hud.c index dce3cb573..590fda67c 100644 --- a/Cockpit/hud.c +++ b/Cockpit/hud.c @@ -38,13 +38,14 @@ #include "hud.h" -#include #include +#include #include
#include #include #include #include +// #include /* not used any more :-) */ #include