1
0
Fork 0

Changed naming scheme of basic shared structures.

This commit is contained in:
curt 1997-08-27 03:29:38 +00:00
parent 90e39d537f
commit 89a9811607
27 changed files with 219 additions and 131 deletions

View file

@ -32,8 +32,8 @@
/* Display various parameters to stdout */ /* Display various parameters to stdout */
void aircraft_debug(int type) { void aircraft_debug(int type) {
struct flight_params *f; struct FLIGHT *f;
struct control_params *c; struct CONTROLS *c;
f = &current_aircraft.flight; f = &current_aircraft.flight;
c = &current_aircraft.controls; c = &current_aircraft.controls;
@ -48,9 +48,12 @@ void aircraft_debug(int type) {
/* $Log$ /* $Log$
/* Revision 1.9 1997/07/19 22:39:08 curt /* Revision 1.10 1997/08/27 03:29:56 curt
/* Moved PI to ../constants.h /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.9 1997/07/19 22:39:08 curt
* Moved PI to ../constants.h
*
* Revision 1.8 1997/06/25 15:39:45 curt * Revision 1.8 1997/06/25 15:39:45 curt
* Minor changes to compile with rsxnt/win32. * Minor changes to compile with rsxnt/win32.
* *

View file

@ -32,15 +32,15 @@
/* Define a structure containing all the parameters for an aircraft */ /* Define a structure containing all the parameters for an aircraft */
struct aircraft_params { struct AIRCRAFT {
struct flight_params flight; struct FLIGHT flight;
struct control_params controls; struct CONTROLS controls;
}; };
/* 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 aircraft_params current_aircraft; extern struct AIRCRAFT current_aircraft;
/* Display various parameters to stdout */ /* Display various parameters to stdout */
@ -51,9 +51,12 @@ void aircraft_debug(int type);
/* $Log$ /* $Log$
/* Revision 1.4 1997/07/23 21:52:17 curt /* Revision 1.5 1997/08/27 03:29:58 curt
/* Put comments around the text after an #endif for increased portability. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.4 1997/07/23 21:52:17 curt
* Put comments around the text after an #endif for increased portability.
*
* Revision 1.3 1997/06/21 17:12:42 curt * Revision 1.3 1997/06/21 17:12:42 curt
* Capitalized subdirectory names. * Capitalized subdirectory names.
* *

View file

@ -30,7 +30,7 @@
void fgControlsInit() { void fgControlsInit() {
int i; int i;
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
FG_Elevator = 0.0; FG_Elevator = 0.0;
@ -46,7 +46,7 @@ void fgControlsInit() {
void fgElevMove(double amt) { void fgElevMove(double amt) {
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
FG_Elevator += amt; FG_Elevator += amt;
@ -56,7 +56,7 @@ void fgElevMove(double amt) {
} }
void fgElevSet(double pos) { void fgElevSet(double pos) {
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
FG_Elevator = pos; FG_Elevator = pos;
@ -66,7 +66,7 @@ void fgElevSet(double pos) {
} }
void fgElevTrimMove(double amt) { void fgElevTrimMove(double amt) {
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
FG_Elev_Trim += amt; FG_Elev_Trim += amt;
@ -76,7 +76,7 @@ void fgElevTrimMove(double amt) {
} }
void fgElevTrimSet(double pos) { void fgElevTrimSet(double pos) {
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
FG_Elev_Trim = pos; FG_Elev_Trim = pos;
@ -86,7 +86,7 @@ void fgElevTrimSet(double pos) {
} }
void fgAileronMove(double amt) { void fgAileronMove(double amt) {
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
FG_Aileron += amt; FG_Aileron += amt;
@ -96,7 +96,7 @@ void fgAileronMove(double amt) {
} }
void fgAileronSet(double pos) { void fgAileronSet(double pos) {
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
FG_Aileron = pos; FG_Aileron = pos;
@ -106,7 +106,7 @@ void fgAileronSet(double pos) {
} }
void fgRudderMove(double amt) { void fgRudderMove(double amt) {
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
FG_Rudder += amt; FG_Rudder += amt;
@ -116,7 +116,7 @@ void fgRudderMove(double amt) {
} }
void fgRudderSet(double pos) { void fgRudderSet(double pos) {
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
FG_Rudder = pos; FG_Rudder = pos;
@ -127,7 +127,7 @@ void fgRudderSet(double pos) {
void fgThrottleMove(int engine, double amt) { void fgThrottleMove(int engine, double amt) {
int i; int i;
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
if ( engine == FG_Throttle_All ) { if ( engine == FG_Throttle_All ) {
@ -147,7 +147,7 @@ void fgThrottleMove(int engine, double amt) {
void fgThrottleSet(int engine, double pos) { void fgThrottleSet(int engine, double pos) {
int i; int i;
struct control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
if ( engine == FG_Throttle_All ) { if ( engine == FG_Throttle_All ) {
@ -167,9 +167,12 @@ void fgThrottleSet(int engine, double pos) {
/* $Log$ /* $Log$
/* Revision 1.2 1997/06/21 17:12:48 curt /* Revision 1.3 1997/08/27 03:30:01 curt
/* Capitalized subdirectory names. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.2 1997/06/21 17:12:48 curt
* Capitalized subdirectory names.
*
* Revision 1.1 1997/05/31 19:24:04 curt * Revision 1.1 1997/05/31 19:24:04 curt
* Initial revision. * Initial revision.
* *

View file

@ -33,7 +33,7 @@
/* Define a structure containing the control parameters */ /* Define a structure containing the control parameters */
struct control_params { struct CONTROLS {
double aileron; double aileron;
double elevator; double elevator;
double elevator_trim; double elevator_trim;
@ -81,9 +81,12 @@ void fgThrottleSet(int engine, double pos);
/* $Log$ /* $Log$
/* Revision 1.4 1997/07/23 21:52:18 curt /* Revision 1.5 1997/08/27 03:30:02 curt
/* Put comments around the text after an #endif for increased portability. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.4 1997/07/23 21:52:18 curt
* Put comments around the text after an #endif for increased portability.
*
* Revision 1.3 1997/05/31 19:16:27 curt * Revision 1.3 1997/05/31 19:16:27 curt
* Elevator trim added. * Elevator trim added.
* *

View file

@ -28,7 +28,7 @@
/* Initialize the flight model parameters */ /* Initialize the flight model parameters */
int fgFlightModelInit(int model, struct flight_params *f, double dt) { int fgFlightModelInit(int model, struct FLIGHT *f, double dt) {
int result; int result;
if ( model == FG_LARCSIM ) { if ( model == FG_LARCSIM ) {
@ -45,7 +45,7 @@ int fgFlightModelInit(int model, struct flight_params *f, double dt) {
/* Run multiloop iterations of the flight model */ /* Run multiloop iterations of the flight model */
int fgFlightModelUpdate(int model, struct flight_params *f, int multiloop) { int fgFlightModelUpdate(int model, struct FLIGHT *f, int multiloop) {
int result; int result;
if ( model == FG_LARCSIM ) { if ( model == FG_LARCSIM ) {
@ -61,9 +61,12 @@ int fgFlightModelUpdate(int model, struct flight_params *f, int multiloop) {
/* $Log$ /* $Log$
/* Revision 1.2 1997/05/29 22:39:57 curt /* Revision 1.3 1997/08/27 03:30:04 curt
/* Working on incorporating the LaRCsim flight model. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.2 1997/05/29 22:39:57 curt
* Working on incorporating the LaRCsim flight model.
*
* Revision 1.1 1997/05/29 02:35:04 curt * Revision 1.1 1997/05/29 02:35:04 curt
* Initial revision. * Initial revision.
* *

View file

@ -61,7 +61,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 flight_params { struct FLIGHT {
/*================== Mass properties and geometry values ==================*/ /*================== Mass properties and geometry values ==================*/
@ -400,19 +400,22 @@ struct 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 flight_params *f, double dt); int fgFlightModelInit(int model, struct FLIGHT *f, double dt);
/* Run multiloop iterations of the flight model */ /* Run multiloop iterations of the flight model */
int fgFlightModelUpdate(int model, struct flight_params *f, int multiloop); int fgFlightModelUpdate(int model, struct FLIGHT *f, int multiloop);
#endif /* FLIGHT_H */ #endif /* FLIGHT_H */
/* $Log$ /* $Log$
/* Revision 1.7 1997/07/23 21:52:19 curt /* Revision 1.8 1997/08/27 03:30:06 curt
/* Put comments around the text after an #endif for increased portability. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.7 1997/07/23 21:52:19 curt
* Put comments around the text after an #endif for increased portability.
*
* Revision 1.6 1997/06/21 17:52:22 curt * Revision 1.6 1997/06/21 17:52:22 curt
* Continue directory shuffling ... everything should be compilable/runnable * Continue directory shuffling ... everything should be compilable/runnable
* again. * again.

View file

@ -495,7 +495,7 @@ int initialize;
int ls_cockpit() { int ls_cockpit() {
struct control_params *c; struct CONTROLS *c;
sim_control_.paused = 0; sim_control_.paused = 0;
@ -559,8 +559,8 @@ int fgLaRCsimUpdate(int multiloop) {
} }
/* Convert from the FG flight_params struct to the LaRCsim generic_ struct */ /* Convert from the FG FLIGHT struct to the LaRCsim generic_ struct */
int fgFlight_2_LaRCsim (struct flight_params *f) { int fgFlight_2_LaRCsim (struct FLIGHT *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;
@ -733,8 +733,8 @@ int fgFlight_2_LaRCsim (struct flight_params *f) {
} }
/* Convert from the LaRCsim generic_ struct to the FG flight_params struct */ /* Convert from the LaRCsim generic_ struct to the FG FLIGHT struct */
int fgLaRCsim_2_Flight (struct flight_params *f) { int fgLaRCsim_2_Flight (struct FLIGHT *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;
@ -909,6 +909,9 @@ int fgLaRCsim_2_Flight (struct flight_params *f) {
/* Flight Gear Modification Log /* Flight Gear Modification Log
* *
* $Log$ * $Log$
* Revision 1.9 1997/08/27 03:30:08 curt
* Changed naming scheme of basic shared structures.
*
* Revision 1.8 1997/06/21 17:12:50 curt * Revision 1.8 1997/06/21 17:12:50 curt
* Capitalized subdirectory names. * Capitalized subdirectory names.
* *

View file

@ -45,8 +45,8 @@ extern int show_hud; /* HUD state */
/* 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 control_params *c; struct CONTROLS *c;
struct weather_params *w; struct WEATHER *w;
c = &current_aircraft.controls; c = &current_aircraft.controls;
w = &current_weather; w = &current_weather;
@ -142,7 +142,7 @@ 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 control_params *c; struct CONTROLS *c;
c = &current_aircraft.controls; c = &current_aircraft.controls;
@ -220,9 +220,12 @@ void GLUTspecialkey(int k, int x, int y) {
/* $Log$ /* $Log$
/* Revision 1.19 1997/08/25 20:27:21 curt /* Revision 1.20 1997/08/27 03:30:13 curt
/* Merged in initial HUD and Joystick code. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.19 1997/08/25 20:27:21 curt
* Merged in initial HUD and Joystick code.
*
* Revision 1.18 1997/08/22 21:34:38 curt * Revision 1.18 1997/08/22 21:34:38 curt
* Doing a bit of reorganizing and house cleaning. * Doing a bit of reorganizing and house cleaning.
* *

View file

@ -56,13 +56,13 @@
/* 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 aircraft_params current_aircraft; struct AIRCRAFT current_aircraft;
/* This is a record containing global housekeeping information */ /* This is a record containing global housekeeping information */
struct general_params general; struct GENERAL general;
/* This is a record containing current weather info */ /* This is a record containing current weather info */
struct weather_params current_weather; struct WEATHER current_weather;
/* view parameters */ /* view parameters */
static GLfloat win_ratio = 1.0; static GLfloat win_ratio = 1.0;
@ -103,7 +103,7 @@ int show_hud;
**************************************************************************/ **************************************************************************/
static void fgInitVisuals() { static void fgInitVisuals() {
struct weather_params *w; struct WEATHER *w;
w = &current_weather; w = &current_weather;
@ -140,8 +140,8 @@ static void fgInitVisuals() {
static void fgUpdateViewParams() { static void fgUpdateViewParams() {
struct fgCartesianPoint view_pos /*, alt_up */; struct fgCartesianPoint view_pos /*, alt_up */;
struct flight_params *f; struct FLIGHT *f;
struct time_params *t; struct fgTIME *t;
MAT3mat R, TMP, UP, LOCAL, VIEW; MAT3mat R, TMP, UP, LOCAL, VIEW;
MAT3vec vec, view_up, forward, view_forward, local_up, nup, nsun; MAT3vec vec, view_up, forward, view_forward, local_up, nup, nsun;
double sun_angle, temp, ambient, diffuse, sky; double sun_angle, temp, ambient, diffuse, sky;
@ -330,8 +330,8 @@ static void fgUpdateVisuals( void ) {
**************************************************************************/ **************************************************************************/
void fgUpdateTimeDepCalcs(int multi_loop) { void fgUpdateTimeDepCalcs(int multi_loop) {
struct flight_params *f; struct FLIGHT *f;
struct time_params *t; struct fgTIME *t;
int i; int i;
f = &current_aircraft.flight; f = &current_aircraft.flight;
@ -487,7 +487,7 @@ 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 flight_params *f; struct FLIGHT *f;
f = &current_aircraft.flight; f = &current_aircraft.flight;
@ -570,7 +570,7 @@ static void fgReshape( int width, int height ) {
**************************************************************************/ **************************************************************************/
int main( int argc, char *argv[] ) { int main( int argc, char *argv[] ) {
struct flight_params *f; struct FLIGHT *f;
f = &current_aircraft.flight; f = &current_aircraft.flight;
@ -646,9 +646,12 @@ int main( int argc, char *argv[] ) {
/* $Log$ /* $Log$
/* Revision 1.10 1997/08/25 20:27:22 curt /* Revision 1.11 1997/08/27 03:30:16 curt
/* Merged in initial HUD and Joystick code. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.10 1997/08/25 20:27:22 curt
* Merged in initial HUD and Joystick code.
*
* Revision 1.9 1997/08/22 21:34:39 curt * Revision 1.9 1997/08/22 21:34:39 curt
* Doing a bit of reorganizing and house cleaning. * Doing a bit of reorganizing and house cleaning.
* *

View file

@ -1,18 +1,21 @@
GLUTkey.o: GLUTkey.c GLUTkey.h ../Aircraft/aircraft.h \ GLUTkey.o: GLUTkey.c GLUTkey.h ../constants.h ../Aircraft/aircraft.h \
../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \ ../Aircraft/../Flight/flight.h ../Aircraft/../Flight/Slew/slew.h \
../Aircraft/../Flight/LaRCsim/ls_interface.h \ ../Aircraft/../Flight/LaRCsim/ls_interface.h \
../Aircraft/../Flight/LaRCsim/../flight.h \ ../Aircraft/../Flight/LaRCsim/../flight.h \
../Aircraft/../Controls/controls.h \ ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../constants.h ../Aircraft/../Controls/../limits.h ../Weather/weather.h
GLUTmain.o: GLUTmain.c fg_init.h ../constants.h ../general.h \ GLUTmain.o: GLUTmain.c fg_init.h ../constants.h ../general.h \
../Aircraft/aircraft.h ../Aircraft/../Flight/flight.h \ ../Aircraft/aircraft.h ../Aircraft/../Flight/flight.h \
../Aircraft/../Flight/Slew/slew.h \ ../Aircraft/../Flight/Slew/slew.h \
../Aircraft/../Flight/LaRCsim/ls_interface.h \ ../Aircraft/../Flight/LaRCsim/ls_interface.h \
../Aircraft/../Flight/LaRCsim/../flight.h \ ../Aircraft/../Flight/LaRCsim/../flight.h \
../Aircraft/../Controls/controls.h \ ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Scenery/mesh.h \ ../Aircraft/../Controls/../limits.h ../Cockpit/cockpit.h \
../Scenery/scenery.h ../Scenery/../types.h ../Math/fg_geodesy.h \ ../Cockpit/hud.h ../Cockpit/../Aircraft/aircraft.h \
../Math/mat3.h ../Math/polar.h ../Math/../types.h ../Time/fg_time.h \ ../Cockpit/../Flight/flight.h ../Cockpit/../Controls/controls.h \
../Joystick/joystick.h ../Math/fg_geodesy.h ../Math/mat3.h \
../Math/polar.h ../Math/../types.h ../Scenery/mesh.h \
../Scenery/scenery.h ../Scenery/../types.h ../Time/fg_time.h \
../Time/../types.h ../Time/fg_timer.h ../Time/sunpos.h \ ../Time/../types.h ../Time/fg_timer.h ../Time/sunpos.h \
../Weather/weather.h ../Weather/weather.h
fg_init.o: fg_init.c fg_init.h ../constants.h ../general.h \ fg_init.o: fg_init.c fg_init.h ../constants.h ../general.h \
@ -21,4 +24,9 @@ fg_init.o: fg_init.c fg_init.h ../constants.h ../general.h \
../Aircraft/../Flight/LaRCsim/ls_interface.h \ ../Aircraft/../Flight/LaRCsim/ls_interface.h \
../Aircraft/../Flight/LaRCsim/../flight.h \ ../Aircraft/../Flight/LaRCsim/../flight.h \
../Aircraft/../Controls/controls.h \ ../Aircraft/../Controls/controls.h \
../Aircraft/../Controls/../limits.h ../Math/fg_random.h ../Aircraft/../Controls/../limits.h ../Cockpit/cockpit.h \
../Cockpit/hud.h ../Cockpit/../Aircraft/aircraft.h \
../Cockpit/../Flight/flight.h ../Cockpit/../Controls/controls.h \
../Joystick/joystick.h ../Math/fg_random.h ../Scenery/mesh.h \
../Scenery/scenery.h ../Scenery/../types.h ../Time/sunpos.h \
../Weather/weather.h

View file

@ -38,6 +38,7 @@
#include "../Math/fg_random.h" #include "../Math/fg_random.h"
#include "../Scenery/mesh.h" #include "../Scenery/mesh.h"
#include "../Scenery/scenery.h" #include "../Scenery/scenery.h"
#include "../Scenery/stars.h"
#include "../Time/sunpos.h" #include "../Time/sunpos.h"
#include "../Weather/weather.h" #include "../Weather/weather.h"
@ -48,7 +49,7 @@ extern int show_hud; /* HUD state */
/* General house keeping initializations */ /* General house keeping initializations */
void fgInitGeneral( void ) { void fgInitGeneral( void ) {
struct general_params *g; struct GENERAL *g;
g = &general; g = &general;
@ -72,7 +73,7 @@ void fgInitGeneral( void ) {
void fgInitSubsystems( void ) { void fgInitSubsystems( void ) {
double cur_elev; double cur_elev;
struct flight_params *f; struct FLIGHT *f;
f = &current_aircraft.flight; f = &current_aircraft.flight;
@ -145,6 +146,9 @@ void fgInitSubsystems( void ) {
/* Initialize the Cockpit subsystem */ /* Initialize the Cockpit subsystem */
fgCockpitInit( current_aircraft ); fgCockpitInit( current_aircraft );
/* Initialize the Stars subsystem */
fgStarsInit();
/* Initialize the Scenery Management subsystem */ /* Initialize the Scenery Management subsystem */
fgSceneryInit(); fgSceneryInit();
@ -184,9 +188,12 @@ void fgInitSubsystems( void ) {
/* $Log$ /* $Log$
/* Revision 1.2 1997/08/25 20:27:23 curt /* Revision 1.3 1997/08/27 03:30:19 curt
/* Merged in initial HUD and Joystick code. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.2 1997/08/25 20:27:23 curt
* Merged in initial HUD and Joystick code.
*
* Revision 1.1 1997/08/23 01:46:20 curt * Revision 1.1 1997/08/23 01:46:20 curt
* Initial revision. * Initial revision.
* *

View file

@ -26,7 +26,8 @@
TARGET = libScenery.a TARGET = libScenery.a
CFILES = chunkmgr.c common.c mesh.c scenery.c scanner.c parser.c geometry.c CFILES = chunkmgr.c common.c mesh.c scenery.c scanner.c parser.c geometry.c \
stars.c
OFILES = $(CFILES:.c=.o) OFILES = $(CFILES:.c=.o)
@ -94,6 +95,9 @@ geometry.o:
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# $Log$ # $Log$
# Revision 1.19 1997/08/27 03:30:23 curt
# Changed naming scheme of basic shared structures.
#
# Revision 1.18 1997/08/02 19:10:12 curt # Revision 1.18 1997/08/02 19:10:12 curt
# Incorporated mesh2GL.c into mesh.c # Incorporated mesh2GL.c into mesh.c
# #

View file

@ -7,4 +7,4 @@ mesh.o: mesh.c ../constants.h ../types.h ../Math/fg_geodesy.h \
parser.o: parser.c parsevrml.h geometry.h common.h mesh.h scenery.h \ parser.o: parser.c parsevrml.h geometry.h common.h mesh.h scenery.h \
../types.h ../types.h
scanner.o: scanner.c parser.h scanner.o: scanner.c parser.h
scenery.o: scenery.c scenery.h ../types.h parsevrml.h scenery.o: scenery.c ../general.h scenery.h ../types.h parsevrml.h

View file

@ -33,7 +33,7 @@
static vrmlGeometryType; static vrmlGeometryType;
struct mesh eg; struct MESH eg;
/* Begin a new vrml geometry statement */ /* Begin a new vrml geometry statement */
@ -119,9 +119,12 @@ int vrmlFreeGeometry() {
/* $Log$ /* $Log$
/* Revision 1.3 1997/07/08 18:20:13 curt /* Revision 1.4 1997/08/27 03:30:26 curt
/* Working on establishing a hard ground. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.3 1997/07/08 18:20:13 curt
* Working on establishing a hard ground.
*
* Revision 1.2 1997/07/07 20:59:51 curt * Revision 1.2 1997/07/07 20:59:51 curt
* Working on scenery transformations to enable us to fly fluidly over the * Working on scenery transformations to enable us to fly fluidly over the
* poles with no discontinuity/distortion in scenery. * poles with no discontinuity/distortion in scenery.

View file

@ -52,10 +52,10 @@
/* Temporary hack until we get the scenery management system running */ /* Temporary hack until we get the scenery management system running */
extern GLint mesh_hack; extern GLint mesh_hack;
extern struct mesh eg; extern struct MESH eg;
/* initialize the non-array mesh values */ /* initialize the non-array mesh values */
void mesh_init(struct mesh *m) { void mesh_init(struct MESH *m) {
m->originx = 0.0; m->originx = 0.0;
m->originy = 0.0; m->originy = 0.0;
@ -72,10 +72,10 @@ void mesh_init(struct mesh *m) {
/* return a pointer to a new mesh structure (no data array allocated yet) */ /* return a pointer to a new mesh structure (no data array allocated yet) */
struct mesh *(new_mesh)() { struct MESH *(new_mesh)() {
struct mesh *mesh_ptr; struct MESH *mesh_ptr;
mesh_ptr = (struct mesh *)malloc(sizeof(struct mesh)); mesh_ptr = (struct MESH *)malloc(sizeof(struct MESH));
if ( mesh_ptr == 0 ) { if ( mesh_ptr == 0 ) {
printf("Virtual memory exceeded\n"); printf("Virtual memory exceeded\n");
@ -107,7 +107,7 @@ float *(new_mesh_data)(int nrows, int ncols) {
/* set the option name in the mesh data structure */ /* set the option name in the mesh data structure */
void mesh_set_option_name(struct mesh *m, char *name) { void mesh_set_option_name(struct MESH *m, char *name) {
if ( strlen(name) < MAX_IDENT_LEN ) { if ( strlen(name) < MAX_IDENT_LEN ) {
strcpy(m->option_name, name); strcpy(m->option_name, name);
} else { } else {
@ -123,7 +123,7 @@ void mesh_set_option_name(struct mesh *m, char *name) {
/* set an option value in the mesh data structure */ /* set an option value in the mesh data structure */
void mesh_set_option_value(struct mesh *m, char *value) { void mesh_set_option_value(struct MESH *m, char *value) {
/* printf("Setting %s to %s\n", m->option_name, value); */ /* printf("Setting %s to %s\n", m->option_name, value); */
if ( m->do_data ) { if ( m->do_data ) {
@ -160,7 +160,7 @@ void mesh_set_option_value(struct mesh *m, char *value) {
/* do whatever needs to be done with the mesh now that it's been /* do whatever needs to be done with the mesh now that it's been
loaded, such as generating the OpenGL call list. */ loaded, such as generating the OpenGL call list. */
void mesh_do_it(struct mesh *m) { void mesh_do_it(struct MESH *m) {
mesh_hack = mesh_to_OpenGL(m); mesh_hack = mesh_to_OpenGL(m);
} }
@ -271,7 +271,7 @@ double mesh_altitude(double lon, double lat) {
/* walk through mesh and make opengl calls */ /* walk through mesh and make opengl calls */
GLint mesh_to_OpenGL(struct mesh *m) { GLint mesh_to_OpenGL(struct MESH *m) {
GLint mesh; GLint mesh;
/* static GLfloat color[4] = { 0.5, 0.4, 0.25, 1.0 }; */ /* dark desert */ /* static GLfloat color[4] = { 0.5, 0.4, 0.25, 1.0 }; */ /* dark desert */
static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 }; static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 };
@ -395,9 +395,12 @@ GLint mesh_to_OpenGL(struct mesh *m) {
/* $Log$ /* $Log$
/* Revision 1.20 1997/08/19 23:55:08 curt /* Revision 1.21 1997/08/27 03:30:27 curt
/* Worked on better simulating real lighting. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.20 1997/08/19 23:55:08 curt
* Worked on better simulating real lighting.
*
* Revision 1.19 1997/08/06 00:24:28 curt * Revision 1.19 1997/08/06 00:24:28 curt
* Working on correct real time sun lighting. * Working on correct real time sun lighting.
* *

View file

@ -31,7 +31,7 @@
#include <GL/glut.h> #include <GL/glut.h>
struct mesh { struct MESH {
/* start coordinates (in arc seconds) */ /* start coordinates (in arc seconds) */
double originx, originy; double originx, originy;
@ -52,39 +52,42 @@ struct mesh {
/* return a pointer to a new mesh structure (no data array allocated yet) */ /* return a pointer to a new mesh structure (no data array allocated yet) */
struct mesh *(new_mesh)(); struct MESH *(new_mesh)();
/* initialize the non-array mesh values */ /* initialize the non-array mesh values */
void mesh_init(struct mesh *m); void mesh_init(struct MESH *m);
/* return a pointer to a dynamically allocated array */ /* return a pointer to a dynamically allocated array */
float *(new_mesh_data)(int nrows, int ncols); float *(new_mesh_data)(int nrows, int ncols);
/* set the option name in the mesh data structure */ /* set the option name in the mesh data structure */
void mesh_set_option_name(struct mesh *m, char *name); void mesh_set_option_name(struct MESH *m, char *name);
/* set an option value in the mesh data structure */ /* set an option value in the mesh data structure */
void mesh_set_option_value(struct mesh *m, char *value); void mesh_set_option_value(struct MESH *m, char *value);
/* do whatever needs to be done with the mesh now that it's been /* do whatever needs to be done with the mesh now that it's been
* loaded, such as generating the OpenGL call list. */ * loaded, such as generating the OpenGL call list. */
void mesh_do_it(struct mesh *m); void mesh_do_it(struct MESH *m);
/* return the current altitude based on mesh data. We should rewrite /* return the current altitude based on mesh data. We should rewrite
* this to interpolate exact values, but for now this is good enough */ * this to interpolate exact values, but for now this is good enough */
double mesh_altitude(double lon, double lat); double mesh_altitude(double lon, double lat);
/* walk through mesh and make opengl calls */ /* walk through mesh and make opengl calls */
GLint mesh_to_OpenGL(struct mesh *m); GLint mesh_to_OpenGL(struct MESH *m);
#endif /* MESH_H */ #endif /* MESH_H */
/* $Log$ /* $Log$
/* Revision 1.6 1997/08/02 19:10:15 curt /* Revision 1.7 1997/08/27 03:30:29 curt
/* Incorporated mesh2GL.c into mesh.c /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.6 1997/08/02 19:10:15 curt
* Incorporated mesh2GL.c into mesh.c
*
* Revision 1.5 1997/07/23 21:52:25 curt * Revision 1.5 1997/07/23 21:52:25 curt
* Put comments around the text after an #endif for increased portability. * Put comments around the text after an #endif for increased portability.
* *

View file

@ -170,7 +170,7 @@ int main(int argc, char **argv) {
yydebug = 1; yydebug = 1;
#endif #endif
printf("input file = %s\n", argv[1]); printf(" input file = %s\n", argv[1]);
push_input_stream(argv[1]); push_input_stream(argv[1]);
yyparse(); yyparse();
@ -183,7 +183,7 @@ int main(int argc, char **argv) {
int fgParseVRML(char *file) { int fgParseVRML(char *file) {
int result; int result;
printf("input file = %s\n", file); printf(" input file = %s\n", file);
push_input_stream(file); push_input_stream(file);
result = yyparse(); result = yyparse();

View file

@ -29,6 +29,7 @@
#endif #endif
#include <GL/glut.h> #include <GL/glut.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include "../general.h" #include "../general.h"
@ -42,7 +43,7 @@ GLint mesh_hack;
/* Shared structure to hold current scenery parameters */ /* Shared structure to hold current scenery parameters */
struct scenery_params scenery; struct SCENERY scenery;
/* Initialize the Scenery Management system */ /* Initialize the Scenery Management system */
@ -55,7 +56,7 @@ void fgSceneryInit() {
/* Tell the scenery manager where we are so it can load the proper data, and /* Tell the scenery manager where we are so it can load the proper data, and
* build the proper structures. */ * build the proper structures. */
void fgSceneryUpdate(double lon, double lat, double elev) { void fgSceneryUpdate(double lon, double lat, double elev) {
struct general_params *g; struct GENERAL *g;
char path[1024]; char path[1024];
g = &general; g = &general;
@ -68,6 +69,9 @@ void fgSceneryUpdate(double lon, double lat, double elev) {
strcat(path, g->root_dir); strcat(path, g->root_dir);
strcat(path, "/Scenery/"); strcat(path, "/Scenery/");
strcat(path, "mesa-e.wrl"); strcat(path, "mesa-e.wrl");
printf("Loading Scenery: %s\n", path);
fgParseVRML(path); fgParseVRML(path);
} }
@ -81,9 +85,12 @@ void fgSceneryRender() {
/* $Log$ /* $Log$
/* Revision 1.14 1997/08/25 20:27:24 curt /* Revision 1.15 1997/08/27 03:30:32 curt
/* Merged in initial HUD and Joystick code. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.14 1997/08/25 20:27:24 curt
* Merged in initial HUD and Joystick code.
*
* Revision 1.13 1997/08/22 21:34:41 curt * Revision 1.13 1997/08/22 21:34:41 curt
* Doing a bit of reorganizing and house cleaning. * Doing a bit of reorganizing and house cleaning.
* *

View file

@ -32,7 +32,7 @@
/* Define a structure containing global scenery parameters */ /* Define a structure containing global scenery parameters */
struct scenery_params { struct SCENERY {
/* number of terrain data points to skip */ /* number of terrain data points to skip */
int terrain_skip; int terrain_skip;
@ -40,7 +40,7 @@ struct scenery_params {
struct fgCartesianPoint center; struct fgCartesianPoint center;
}; };
extern struct scenery_params scenery; extern struct SCENERY scenery;
/* Initialize the Scenery Management system */ /* Initialize the Scenery Management system */
@ -60,9 +60,12 @@ void fgSceneryRender();
/* $Log$ /* $Log$
/* Revision 1.8 1997/08/06 00:24:30 curt /* Revision 1.9 1997/08/27 03:30:33 curt
/* Working on correct real time sun lighting. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.8 1997/08/06 00:24:30 curt
* Working on correct real time sun lighting.
*
* Revision 1.7 1997/07/23 21:52:27 curt * Revision 1.7 1997/07/23 21:52:27 curt
* Put comments around the text after an #endif for increased portability. * Put comments around the text after an #endif for increased portability.
* *

View file

@ -31,19 +31,22 @@
/* the general house keeping structure definition */ /* the general house keeping structure definition */
struct general_params { struct GENERAL {
/* The flight gear "root" directory */ /* The flight gear "root" directory */
char *root_dir; char *root_dir;
}; };
/* general contains all the general house keeping parameters. */ /* general contains all the general house keeping parameters. */
extern struct general_params general; extern struct GENERAL general;
#endif /* GENERAL_H */ #endif /* GENERAL_H */
/* $Log$ /* $Log$
/* Revision 1.1 1997/08/23 11:37:12 curt /* Revision 1.2 1997/08/27 03:29:38 curt
/* Initial revision. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.1 1997/08/23 11:37:12 curt
* Initial revision.
*
*/ */

View file

@ -44,7 +44,7 @@
/* 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 flight_params *f; struct FLIGHT *f;
f = &current_aircraft.flight; f = &current_aircraft.flight;
@ -70,8 +70,8 @@ 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 fgSlewUpdate() {
struct flight_params *f; struct FLIGHT *f;
struct control_params *c; struct CONTROLS *c;
f = &current_aircraft.flight; f = &current_aircraft.flight;
c = &current_aircraft.controls; c = &current_aircraft.controls;
@ -91,9 +91,12 @@ void fgSlewUpdate() {
/* $Log$ /* $Log$
/* Revision 1.5 1997/07/19 22:35:06 curt /* Revision 1.6 1997/08/27 03:30:11 curt
/* Moved fiddled with PI to avoid compiler warnings. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.5 1997/07/19 22:35:06 curt
* Moved fiddled with PI to avoid compiler warnings.
*
* Revision 1.4 1997/06/21 17:12:51 curt * Revision 1.4 1997/06/21 17:12:51 curt
* Capitalized subdirectory names. * Capitalized subdirectory names.
* *

View file

@ -1,5 +1,4 @@
fg_time.o: fg_time.c fg_time.h ../types.h fg_time.o: fg_time.c fg_time.h ../types.h
fg_timer.o: fg_timer.c fg_timer.h fg_timer.o: fg_timer.c fg_timer.h
sptest.o: sptest.c sunpos.h ../constants.h
sunpos.o: sunpos.c sunpos.h fg_time.h ../types.h ../constants.h \ sunpos.o: sunpos.c sunpos.h fg_time.h ../types.h ../constants.h \
../Math/fg_geodesy.h ../Math/polar.h ../Math/../types.h ../Math/fg_geodesy.h ../Math/polar.h ../Math/../types.h

View file

@ -27,11 +27,14 @@
#include "fg_time.h" #include "fg_time.h"
struct time_params cur_time_params; struct fgTIME cur_time_params;
/* $Log$ /* $Log$
/* Revision 1.1 1997/08/13 21:55:59 curt /* Revision 1.2 1997/08/27 03:30:35 curt
/* Initial revision. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.1 1997/08/13 21:55:59 curt
* Initial revision.
*
*/ */

View file

@ -32,21 +32,24 @@
/* Define a structure containing global time parameters */ /* Define a structure containing global time parameters */
struct time_params { struct fgTIME {
/* the point on the earth's surface above which the sun is directly /* the point on the earth's surface above which the sun is directly
* overhead */ * overhead */
struct fgCartesianPoint fg_sunpos; /* in cartesian coordiantes */ struct fgCartesianPoint fg_sunpos; /* in cartesian coordiantes */
double sun_lon, sun_gc_lat; /* in geocentric coordinates */ double sun_lon, sun_gc_lat; /* in geocentric coordinates */
}; };
extern struct time_params cur_time_params; extern struct fgTIME cur_time_params;
#endif /* FG_TIME_H */ #endif /* FG_TIME_H */
/* $Log$ /* $Log$
/* Revision 1.1 1997/08/13 21:56:00 curt /* Revision 1.2 1997/08/27 03:30:36 curt
/* Initial revision. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.1 1997/08/13 21:56:00 curt
* Initial revision.
*
*/ */

View file

@ -259,7 +259,7 @@ void fgSunPosition(time_t ssue, double *lon, double *lat) {
/* update the cur_time_params structure with the current sun position */ /* update the cur_time_params structure with the current sun position */
void fgUpdateSunPos() { void fgUpdateSunPos() {
struct time_params *t; struct fgTIME *t;
double sun_gd_lat, sl_radius; double sun_gd_lat, sl_radius;
static int time_warp = 0; static int time_warp = 0;
@ -272,13 +272,19 @@ void fgUpdateSunPos() {
fgGeodToGeoc(sun_gd_lat, 0.0, &sl_radius, &t->sun_gc_lat); fgGeodToGeoc(sun_gd_lat, 0.0, &sl_radius, &t->sun_gc_lat);
t->fg_sunpos = fgPolarToCart(t->sun_lon, t->sun_gc_lat, sl_radius); t->fg_sunpos = fgPolarToCart(t->sun_lon, t->sun_gc_lat, sl_radius);
/* printf("Geodetic lat = %.5f Geocentric lat = %.5f\n", sun_gd_lat,
t->sun_gc_lat); */
} }
/* $Log$ /* $Log$
/* Revision 1.5 1997/08/22 21:34:41 curt /* Revision 1.6 1997/08/27 03:30:37 curt
/* Doing a bit of reorganizing and house cleaning. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.5 1997/08/22 21:34:41 curt
* Doing a bit of reorganizing and house cleaning.
*
* Revision 1.4 1997/08/19 23:55:09 curt * Revision 1.4 1997/08/19 23:55:09 curt
* Worked on better simulating real lighting. * Worked on better simulating real lighting.
* *

View file

@ -31,7 +31,7 @@
/* Initialize the weather modeling subsystem */ /* Initialize the weather modeling subsystem */
void fgWeatherInit(void) { void fgWeatherInit(void) {
struct weather_params *w; struct WEATHER *w;
w = &current_weather; w = &current_weather;
@ -44,8 +44,8 @@ void fgWeatherInit(void) {
/* Update the weather parameters for the current position */ /* Update the weather parameters for the current position */
void fgWeatherUpdate(double lon, double lat, double alt) { void fgWeatherUpdate(double lon, double lat, double alt) {
struct flight_params *f; struct FLIGHT *f;
struct weather_params *w; struct WEATHER *w;
f = &current_aircraft.flight; f = &current_aircraft.flight;
w = &current_weather; w = &current_weather;
@ -58,9 +58,12 @@ void fgWeatherUpdate(double lon, double lat, double alt) {
/* $Log$ /* $Log$
/* Revision 1.5 1997/08/22 21:34:42 curt /* Revision 1.6 1997/08/27 03:30:38 curt
/* Doing a bit of reorganizing and house cleaning. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.5 1997/08/22 21:34:42 curt
* Doing a bit of reorganizing and house cleaning.
*
* Revision 1.4 1997/08/02 16:23:55 curt * Revision 1.4 1997/08/02 16:23:55 curt
* Misc. tweaks. * Misc. tweaks.
* *

View file

@ -29,11 +29,11 @@
/* holds the current weather values */ /* holds the current weather values */
struct weather_params { struct WEATHER {
float visibility; float visibility;
}; };
extern struct weather_params current_weather; extern struct WEATHER current_weather;
/* Initialize the weather modeling subsystem */ /* Initialize the weather modeling subsystem */
@ -47,9 +47,12 @@ void fgWeatherUpdate(double lon, double lat, double alt);
/* $Log$ /* $Log$
/* Revision 1.3 1997/08/22 21:34:43 curt /* Revision 1.4 1997/08/27 03:30:39 curt
/* Doing a bit of reorganizing and house cleaning. /* Changed naming scheme of basic shared structures.
/* /*
* Revision 1.3 1997/08/22 21:34:43 curt
* Doing a bit of reorganizing and house cleaning.
*
* Revision 1.2 1997/07/23 21:52:30 curt * Revision 1.2 1997/07/23 21:52:30 curt
* Put comments around the text after an #endif for increased portability. * Put comments around the text after an #endif for increased portability.
* *