From: curt Date: Thu, 26 Jun 1997 22:14:53 +0000 (+0000) Subject: Beginning work on a scenery management system. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=812700addaa866db0ae201b083871e71e512e359;p=flightgear.git Beginning work on a scenery management system. --- diff --git a/Main/GLmain.c b/Main/GLmain.c index 02cbcb708..cbda0ae57 100644 --- a/Main/GLmain.c +++ b/Main/GLmain.c @@ -420,7 +420,12 @@ int main( int argc, char *argv[] ) { f = ¤t_aircraft.flight; - printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n"); + printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n"); + + + /********************************************************************** + * Initialize the Window/Graphics environment. + **********************************************************************/ #ifdef GLUT /* initialize GLUT */ @@ -450,6 +455,12 @@ int main( int argc, char *argv[] ) { /* setup view parameters, only makes GL calls */ fgInitVisuals(); + + /**************************************************************** + * The following section sets up the flight model EOM parameters and + * should really be read in from one or more files. + ****************************************************************/ + /* Globe Aiport, AZ */ FG_Runway_altitude = 3234.5; FG_Runway_latitude = 120070.41; @@ -464,8 +475,7 @@ int main( int argc, char *argv[] ) { printf("Initial position is: (%.4f, %.4f, %.2f)\n", FG_Latitude, FG_Longitude, FG_Altitude); - - /* Initial Velocity */ + /* Initial Velocity */ FG_V_north = 0.0 /* 7.287719E+00 */; FG_V_east = 0.0 /* 1.521770E+03 */; FG_V_down = 0.0 /* -1.265722E-05 */; @@ -499,6 +509,7 @@ int main( int argc, char *argv[] ) { /* fgSlewInit(-335340,162540, 15, 4.38); */ /* fgSlewInit(-398673.28,120625.64, 53, 4.38); */ + /* Initialize the flight model data structures base on above values */ fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ ); if ( use_signals ) { @@ -507,17 +518,25 @@ int main( int argc, char *argv[] ) { fgInitTimeDepCalcs(); } - /* build all objects */ - /* parse the scenery file, and build the OpenGL call list */ - /* this function will eventually move to the scenery management system */ - if ( strlen(argv[1]) ) { - parse_scenery(argv[1]); - } + /********************************************************************** + * The following section (and the functions elsewhere in this file) + * set up the scenery management system. This part is a big hack, + * and needs to be moved to it's own area. + **********************************************************************/ - /* initialize the scenery */ + /* Initialize the Scenery Management system */ fgSceneryInit(); + /* Tell the Scenery Management system where we are so it can load + * the correct scenery data */ + fgSceneryUpdate(FG_Latitude, FG_Longitude, FG_Altitude); + + + /********************************************************************** + * Initialize the Event Handlers. + **********************************************************************/ + #ifdef GLUT /* call fgReshape() on window resizes */ glutReshapeFunc( fgReshape ); @@ -559,9 +578,12 @@ int main( int argc, char *argv[] ) { /* $Log$ -/* Revision 1.23 1997/06/26 19:08:33 curt -/* Restructuring make, adding automatic "make dep" support. +/* Revision 1.24 1997/06/26 22:14:53 curt +/* Beginning work on a scenery management system. /* + * Revision 1.23 1997/06/26 19:08:33 curt + * Restructuring make, adding automatic "make dep" support. + * * Revision 1.22 1997/06/25 15:39:47 curt * Minor changes to compile with rsxnt/win32. * diff --git a/Main/Makefile b/Main/Makefile index a682d7a65..2abde6fc1 100644 --- a/Main/Makefile +++ b/Main/Makefile @@ -66,7 +66,7 @@ OFILES = $(CFILES:.c=.o) AFILES = ../Aircraft/libAircraft.a ../Controls/libControls.a \ ../Flight/libFlight.a ../Flight/LaRCsim/libLaRCsim.a \ ../Flight/Slew/libSlew.a ../mat3/libmat3.a \ - ../Scenery/ParseScn/libParseScn.a ../Scenery/libScenery.a \ + ../Scenery/ParseVRML/libParseVRML.a ../Scenery/libScenery.a \ ../Timer/libTimer.a @@ -107,6 +107,9 @@ mesh2GL.o: #--------------------------------------------------------------------------- # $Log$ +# Revision 1.17 1997/06/26 22:14:54 curt +# Beginning work on a scenery management system. +# # Revision 1.16 1997/06/26 19:08:33 curt # Restructuring make, adding automatic "make dep" support. # diff --git a/Scenery/Makefile b/Scenery/Makefile index 93cc63f2e..65625edf6 100644 --- a/Scenery/Makefile +++ b/Scenery/Makefile @@ -26,7 +26,7 @@ TARGET = libScenery.a -CFILES = common.c mesh.c +CFILES = common.c mesh.c scenery.c HFILES = OFILES = $(CFILES:.c=.o) @@ -66,9 +66,15 @@ common.o: mesh.o: $(CC) $(CFLAGS) -c mesh.c +scenery.o: + $(CC) $(CFLAGS) -c scenery.c + #--------------------------------------------------------------------------- # $Log$ +# Revision 1.11 1997/06/26 22:14:57 curt +# Beginning work on a scenery management system. +# # Revision 1.10 1997/06/26 19:08:34 curt # Restructuring make, adding automatic "make dep" support. # diff --git a/Scenery/scenery.h b/Scenery/scenery.h index a79c888cb..2acf6472f 100644 --- a/Scenery/scenery.h +++ b/Scenery/scenery.h @@ -1,5 +1,5 @@ /************************************************************************** - * scenery.h -- data structures and routines for processing terrain meshes + * scenery.h -- data structures and routines for managing scenery. * * Written by Curtis Olson, started May 1997. * @@ -28,17 +28,27 @@ #define SCENERY_H -/* parse a scenery file */ -int parse_scenery(char *file); +/* Initialize the Scenery Management system */ +void fgSceneryInit(); + +/* Tell the scenery manager where we are so it can load the proper data, and + * build the proper structures. */ +void fgSceneryUpdate(double lon, double lat, double elev); + +/* Render out the current scene */ +void fgSceneryRender(); #endif SCENERY_H /* $Log$ -/* Revision 1.4 1997/06/21 17:57:21 curt -/* directory shuffling ... +/* Revision 1.5 1997/06/26 22:14:57 curt +/* Beginning work on a scenery management system. /* + * Revision 1.4 1997/06/21 17:57:21 curt + * directory shuffling ... + * * Revision 1.2 1997/05/23 15:40:43 curt * Added GNU copyright headers. *