Contributions from Bernie Bright <bbright@c031.aone.net.au>
- use strings for fg_root and airport_id and added methods to return them as strings, - inlined all access methods, - made the parsing functions private methods, - deleted some unused functions. - propogated some of these changes out a bit further.
This commit is contained in:
parent
fec4bef345
commit
283a23159a
13 changed files with 568 additions and 576 deletions
|
@ -40,35 +40,32 @@ fgAIRPORTS::fgAIRPORTS( void ) {
|
||||||
|
|
||||||
|
|
||||||
// load the data
|
// load the data
|
||||||
int fgAIRPORTS::load( char *file ) {
|
int fgAIRPORTS::load( const string& file ) {
|
||||||
fgAIRPORT a;
|
fgAIRPORT a;
|
||||||
char path[256], fgpath[256], line[256];
|
string path, fgpath, id;
|
||||||
char id[5];
|
char id_raw[256], line[256];
|
||||||
string id_str;
|
|
||||||
fgFile f;
|
fgFile f;
|
||||||
|
|
||||||
// build the path name to the airport file
|
// build the path name to the airport file
|
||||||
current_options.get_fg_root(path);
|
path = current_options.get_fg_root() + "/Airports/" + file;
|
||||||
strcat(path, "/Airports/");
|
fgpath = path + ".gz";
|
||||||
strcat(path, file);
|
|
||||||
strcpy(fgpath, path);
|
|
||||||
strcat(fgpath, ".gz");
|
|
||||||
|
|
||||||
// first try "path.gz"
|
// first try "path.gz"
|
||||||
if ( (f = fgopen(fgpath, "rb")) == NULL ) {
|
if ( (f = fgopen(fgpath.c_str(), "rb")) == NULL ) {
|
||||||
// next try "path"
|
// next try "path"
|
||||||
if ( (f = fgopen(path, "rb")) == NULL ) {
|
if ( (f = fgopen(path.c_str(), "rb")) == NULL ) {
|
||||||
fgPrintf(FG_GENERAL, FG_EXIT, "Cannot open file: %s\n", path);
|
fgPrintf( FG_GENERAL, FG_EXIT, "Cannot open file: %s\n",
|
||||||
|
path.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while ( fggets(f, line, 250) != NULL ) {
|
while ( fggets(f, line, 250) != NULL ) {
|
||||||
// printf("%s", line);
|
// printf("%s", line);
|
||||||
|
|
||||||
sscanf( line, "%s %lf %lf %lfl\n", id, &a.longitude, &a.latitude,
|
sscanf( line, "%s %lf %lf %lfl\n", id_raw, &a.longitude, &a.latitude,
|
||||||
&a.elevation );
|
&a.elevation );
|
||||||
id_str = id;
|
id = id_raw;
|
||||||
airports[id_str] = a;
|
airports[id] = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
fgclose(f);
|
fgclose(f);
|
||||||
|
@ -100,6 +97,15 @@ fgAIRPORTS::~fgAIRPORTS( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.3 1998/08/27 17:01:55 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
// Revision 1.2 1998/08/25 20:53:24 curt
|
// Revision 1.2 1998/08/25 20:53:24 curt
|
||||||
// Shuffled $FG_ROOT file layout.
|
// Shuffled $FG_ROOT file layout.
|
||||||
//
|
//
|
||||||
|
|
|
@ -59,7 +59,7 @@ public:
|
||||||
fgAIRPORTS( void );
|
fgAIRPORTS( void );
|
||||||
|
|
||||||
// load the data
|
// load the data
|
||||||
int load( char *file );
|
int load( const string& file );
|
||||||
|
|
||||||
// search for the specified id
|
// search for the specified id
|
||||||
fgAIRPORT search( char *id );
|
fgAIRPORT search( char *id );
|
||||||
|
@ -74,6 +74,15 @@ public:
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.2 1998/08/27 17:01:56 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
// Revision 1.1 1998/08/25 17:19:14 curt
|
// Revision 1.1 1998/08/25 17:19:14 curt
|
||||||
// Moved from ../Main/
|
// Moved from ../Main/
|
||||||
//
|
//
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
#include <Include/fg_constants.h>
|
#include <Include/fg_constants.h>
|
||||||
|
@ -114,27 +115,24 @@ int fgReadOrbElements(struct OrbElements *dest, gzFile src) {
|
||||||
|
|
||||||
int fgSolarSystemInit(fgTIME t)
|
int fgSolarSystemInit(fgTIME t)
|
||||||
{
|
{
|
||||||
char path[256], gzpath[256];
|
string path, gzpath;
|
||||||
int i, ret_val;
|
int i, ret_val;
|
||||||
|
|
||||||
fgPrintf( FG_ASTRO, FG_INFO, "Initializing solar system\n");
|
fgPrintf( FG_ASTRO, FG_INFO, "Initializing solar system\n");
|
||||||
|
|
||||||
/* build the full path name to the orbital elements database file */
|
/* build the full path name to the orbital elements database file */
|
||||||
current_options.get_fg_root(path);
|
path = current_options.get_fg_root() + "/Astro/planets";
|
||||||
strcat(path, "/Astro/");
|
gzpath = path + ".gz";
|
||||||
strcat(path, "planets");
|
|
||||||
|
|
||||||
if ( (data = fgopen(path, "rb")) == NULL ) {
|
if ( (data = fgopen(path.c_str(), "rb")) == NULL ) {
|
||||||
strcpy(gzpath, path);
|
if ( (data = fgopen(gzpath.c_str(), "rb")) == NULL ) {
|
||||||
strcat(gzpath, ".gz");
|
|
||||||
if ( (data = fgopen(gzpath, "rb")) == NULL ) {
|
|
||||||
fgPrintf( FG_ASTRO, FG_EXIT,
|
fgPrintf( FG_ASTRO, FG_EXIT,
|
||||||
"Cannot open data file: '%s'\n", path);
|
"Cannot open data file: '%s'\n", path.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* printf(" reading datafile %s\n", path); */
|
/* printf(" reading datafile %s\n", path); */
|
||||||
fgPrintf( FG_ASTRO, FG_INFO, " reading datafile %s\n", path);
|
fgPrintf( FG_ASTRO, FG_INFO, " reading datafile %s\n", path.c_str());
|
||||||
|
|
||||||
/* for all the objects... */
|
/* for all the objects... */
|
||||||
for (i = 0; i < 9; i ++) {
|
for (i = 0; i < 9; i ++) {
|
||||||
|
@ -170,9 +168,18 @@ void fgSolarSystemUpdate(struct OrbElements *planet, fgTIME t)
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.9 1998/08/25 20:53:28 curt
|
/* Revision 1.10 1998/08/27 17:02:00 curt
|
||||||
/* Shuffled $FG_ROOT file layout.
|
/* Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
/* - use strings for fg_root and airport_id and added methods to return
|
||||||
|
/* them as strings,
|
||||||
|
/* - inlined all access methods,
|
||||||
|
/* - made the parsing functions private methods,
|
||||||
|
/* - deleted some unused functions.
|
||||||
|
/* - propogated some of these changes out a bit further.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.9 1998/08/25 20:53:28 curt
|
||||||
|
* Shuffled $FG_ROOT file layout.
|
||||||
|
*
|
||||||
* Revision 1.8 1998/08/22 01:18:59 curt
|
* Revision 1.8 1998/08/22 01:18:59 curt
|
||||||
* Minor tweaks to avoid using unitialized memory.
|
* Minor tweaks to avoid using unitialized memory.
|
||||||
*
|
*
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
@ -67,7 +68,7 @@ int fgStarsInit( void ) {
|
||||||
fgPoint3d starlist[FG_MAX_STARS];
|
fgPoint3d starlist[FG_MAX_STARS];
|
||||||
fgFile fd;
|
fgFile fd;
|
||||||
/* struct CelestialCoord pltPos; */
|
/* struct CelestialCoord pltPos; */
|
||||||
char path[256], gzpath[256];
|
string path, gzpath;
|
||||||
char line[256], name[256];
|
char line[256], name[256];
|
||||||
char *front, *end;
|
char *front, *end;
|
||||||
double right_ascension, declination, magnitude;
|
double right_ascension, declination, magnitude;
|
||||||
|
@ -79,24 +80,21 @@ int fgStarsInit( void ) {
|
||||||
fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n");
|
fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n");
|
||||||
|
|
||||||
/* build the full path name to the stars data base file */
|
/* build the full path name to the stars data base file */
|
||||||
current_options.get_fg_root(path);
|
path = current_options.get_fg_root() + "/Astro/stars";
|
||||||
strcat(path, "/Astro/");
|
gzpath = path + ".gz";
|
||||||
strcat(path, "stars");
|
|
||||||
|
|
||||||
if ( FG_STAR_LEVELS < 4 ) {
|
if ( FG_STAR_LEVELS < 4 ) {
|
||||||
fgPrintf( FG_ASTRO, FG_EXIT, "Big whups in stars.cxx\n");
|
fgPrintf( FG_ASTRO, FG_EXIT, "Big whups in stars.cxx\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
fgPrintf( FG_ASTRO, FG_INFO, " Loading stars from %s\n", path);
|
fgPrintf( FG_ASTRO, FG_INFO, " Loading stars from %s\n", path.c_str() );
|
||||||
|
|
||||||
// load star data file
|
// load star data file
|
||||||
if ( (fd = fgopen(path, "rb")) == NULL ) {
|
if ( (fd = fgopen(path.c_str(), "rb")) == NULL ) {
|
||||||
strcpy(gzpath, path);
|
if ( (fd = fgopen(gzpath.c_str(), "rb")) == NULL ) {
|
||||||
strcat(gzpath, ".gz");
|
|
||||||
if ( (fd = fgopen(gzpath, "rb")) == NULL ) {
|
|
||||||
// Oops, lets not even try to continue. This is critical.
|
// Oops, lets not even try to continue. This is critical.
|
||||||
fgPrintf( FG_ASTRO, FG_EXIT,
|
fgPrintf( FG_ASTRO, FG_EXIT,
|
||||||
"Cannot open star file: '%s'\n", path);
|
"Cannot open star file: '%s'\n", path.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,9 +286,18 @@ void fgStarsRender( void ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.11 1998/08/25 20:53:29 curt
|
/* Revision 1.12 1998/08/27 17:02:01 curt
|
||||||
/* Shuffled $FG_ROOT file layout.
|
/* Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
/* - use strings for fg_root and airport_id and added methods to return
|
||||||
|
/* them as strings,
|
||||||
|
/* - inlined all access methods,
|
||||||
|
/* - made the parsing functions private methods,
|
||||||
|
/* - deleted some unused functions.
|
||||||
|
/* - propogated some of these changes out a bit further.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.11 1998/08/25 20:53:29 curt
|
||||||
|
* Shuffled $FG_ROOT file layout.
|
||||||
|
*
|
||||||
* Revision 1.10 1998/08/10 20:33:09 curt
|
* Revision 1.10 1998/08/10 20:33:09 curt
|
||||||
* Rewrote star loading and rendering to:
|
* Rewrote star loading and rendering to:
|
||||||
* 1. significantly improve load speed
|
* 1. significantly improve load speed
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <Aircraft/aircraft.h>
|
#include <Aircraft/aircraft.h>
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
|
@ -286,7 +287,7 @@ static IMAGE *ImageLoad(char *fileName)
|
||||||
|
|
||||||
|
|
||||||
void fgPanelInit ( void ) {
|
void fgPanelInit ( void ) {
|
||||||
char tpath[256];
|
string tpath;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
#ifdef GL_VERSION_1_1
|
#ifdef GL_VERSION_1_1
|
||||||
|
@ -307,13 +308,11 @@ void fgPanelInit ( void ) {
|
||||||
xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
/* load in the texture data */
|
/* load in the texture data */
|
||||||
current_options.get_fg_root(tpath);
|
tpath = current_options.get_fg_root() + "/Textures/panel1.rgb";
|
||||||
strcat(tpath, "/Textures/");
|
|
||||||
strcat(tpath, "panel1.rgb");
|
|
||||||
|
|
||||||
if ( (img = ImageLoad(tpath)) == NULL ){
|
if ( (img = ImageLoad((char *)tpath.c_str()) ) == NULL ){
|
||||||
fgPrintf( FG_COCKPIT, FG_EXIT,
|
fgPrintf( FG_COCKPIT, FG_EXIT,
|
||||||
"Error loading cockpit texture %s\n", tpath );
|
"Error loading cockpit texture %s\n", tpath.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( y = 0; y < 256; y++ ) {
|
for ( y = 0; y < 256; y++ ) {
|
||||||
|
@ -416,10 +415,19 @@ void fgPanelUpdate ( void ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.4 1998/07/24 21:37:00 curt
|
/* Revision 1.5 1998/08/27 17:02:03 curt
|
||||||
/* Ran dos2unix to get rid of extraneous ^M's. Tweaked parameter in
|
/* Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
/* ImageGetRawData() to match usage.
|
/* - use strings for fg_root and airport_id and added methods to return
|
||||||
|
/* them as strings,
|
||||||
|
/* - inlined all access methods,
|
||||||
|
/* - made the parsing functions private methods,
|
||||||
|
/* - deleted some unused functions.
|
||||||
|
/* - propogated some of these changes out a bit further.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.4 1998/07/24 21:37:00 curt
|
||||||
|
* Ran dos2unix to get rid of extraneous ^M's. Tweaked parameter in
|
||||||
|
* ImageGetRawData() to match usage.
|
||||||
|
*
|
||||||
* Revision 1.3 1998/07/13 21:00:52 curt
|
* Revision 1.3 1998/07/13 21:00:52 curt
|
||||||
* Integrated Charlies latest HUD updates.
|
* Integrated Charlies latest HUD updates.
|
||||||
* Wrote access functions for current fgOPTIONS.
|
* Wrote access functions for current fgOPTIONS.
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include <XGL/xgl.h>
|
#include <XGL/xgl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#ifdef HAVE_STDLIB_H
|
#ifdef HAVE_STDLIB_H
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
|
@ -454,6 +455,8 @@ void fgInitTimeDepCalcs( void ) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const double alt_adjust_ft = 3.758099;
|
||||||
|
static const double alt_adjust_m = alt_adjust_ft * FEET_TO_METER;
|
||||||
|
|
||||||
// What should we do when we have nothing else to do? Let's get ready
|
// What should we do when we have nothing else to do? Let's get ready
|
||||||
// for the next move and update the display?
|
// for the next move and update the display?
|
||||||
|
@ -485,15 +488,14 @@ static void fgMainLoop( void ) {
|
||||||
|
|
||||||
if ( scenery.cur_elev > -9990 ) {
|
if ( scenery.cur_elev > -9990 ) {
|
||||||
if ( FG_Altitude * FEET_TO_METER <
|
if ( FG_Altitude * FEET_TO_METER <
|
||||||
(scenery.cur_elev + 3.758099 * FEET_TO_METER - 3.0) ) {
|
(scenery.cur_elev + alt_adjust_m - 3.0) ) {
|
||||||
// now set aircraft altitude above ground
|
// now set aircraft altitude above ground
|
||||||
printf("Current Altitude = %.2f < %.2f forcing to %.2f\n",
|
printf("Current Altitude = %.2f < %.2f forcing to %.2f\n",
|
||||||
FG_Altitude * FEET_TO_METER,
|
FG_Altitude * FEET_TO_METER,
|
||||||
scenery.cur_elev + 3.758099 * FEET_TO_METER - 3.0,
|
scenery.cur_elev + alt_adjust_m - 3.0,
|
||||||
scenery.cur_elev + 3.758099 * FEET_TO_METER);
|
scenery.cur_elev + alt_adjust_m );
|
||||||
fgFlightModelSetAltitude( current_options.get_flight_model(), f,
|
fgFlightModelSetAltitude( current_options.get_flight_model(), f,
|
||||||
scenery.cur_elev +
|
scenery.cur_elev + alt_adjust_m );
|
||||||
3.758099 * FEET_TO_METER);
|
|
||||||
|
|
||||||
fgPrintf( FG_ALL, FG_BULK,
|
fgPrintf( FG_ALL, FG_BULK,
|
||||||
"<*> resetting altitude to %.0f meters\n",
|
"<*> resetting altitude to %.0f meters\n",
|
||||||
|
@ -597,8 +599,6 @@ static void fgMainLoop( void ) {
|
||||||
|
|
||||||
static void fgIdleFunction ( void ) {
|
static void fgIdleFunction ( void ) {
|
||||||
fgGENERAL *g;
|
fgGENERAL *g;
|
||||||
char path[256], mp3file[256], command[256], slfile[256];
|
|
||||||
static char *lockfile = "/tmp/mpg123.running";
|
|
||||||
|
|
||||||
g = &general;
|
g = &general;
|
||||||
|
|
||||||
|
@ -615,16 +615,14 @@ static void fgIdleFunction ( void ) {
|
||||||
// Start the intro music
|
// Start the intro music
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
if ( current_options.get_intro_music() ) {
|
if ( current_options.get_intro_music() ) {
|
||||||
current_options.get_fg_root(mp3file);
|
string lockfile = "/tmp/mpg123.running";
|
||||||
strcat(mp3file, "/Sounds/");
|
string mp3file = current_options.get_fg_root() +
|
||||||
strcat(mp3file, "intro.mp3");
|
"/Sounds/intro.mp3";
|
||||||
|
string command = "(touch " + lockfile + "; mpg123 " + mp3file +
|
||||||
sprintf(command,
|
"> /dev/null 2>&1; /bin/rm " + lockfile + ") &";
|
||||||
"(touch %s; mpg123 %s > /dev/null 2>&1; /bin/rm %s) &",
|
|
||||||
lockfile, mp3file, lockfile );
|
|
||||||
fgPrintf( FG_GENERAL, FG_INFO,
|
fgPrintf( FG_GENERAL, FG_INFO,
|
||||||
"Starting intro music: %s\n", mp3file);
|
"Starting intro music: %s\n", mp3file.c_str() );
|
||||||
system ( command );
|
system ( command.c_str() );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -672,11 +670,12 @@ static void fgIdleFunction ( void ) {
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
if ( current_options.get_intro_music() ) {
|
if ( current_options.get_intro_music() ) {
|
||||||
// Let's wait for mpg123 to finish
|
// Let's wait for mpg123 to finish
|
||||||
|
string lockfile = "/tmp/mpg123.running";
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
|
|
||||||
fgPrintf( FG_GENERAL, FG_INFO,
|
fgPrintf( FG_GENERAL, FG_INFO,
|
||||||
"Waiting for mpg123 player to finish ...\n" );
|
"Waiting for mpg123 player to finish ...\n" );
|
||||||
while ( stat(lockfile, &stat_buf) == 0 ) {
|
while ( stat(lockfile.c_str(), &stat_buf) == 0 ) {
|
||||||
// file exist, wait ...
|
// file exist, wait ...
|
||||||
sleep(1);
|
sleep(1);
|
||||||
fgPrintf( FG_GENERAL, FG_INFO, ".");
|
fgPrintf( FG_GENERAL, FG_INFO, ".");
|
||||||
|
@ -689,12 +688,9 @@ static void fgIdleFunction ( void ) {
|
||||||
audio_mixer = new smMixer;
|
audio_mixer = new smMixer;
|
||||||
audio_mixer -> setMasterVolume ( 80 ) ; /* 80% of max volume. */
|
audio_mixer -> setMasterVolume ( 80 ) ; /* 80% of max volume. */
|
||||||
audio_sched -> setSafetyMargin ( 1.0 ) ;
|
audio_sched -> setSafetyMargin ( 1.0 ) ;
|
||||||
current_options.get_fg_root(path);
|
string slfile = current_options.get_fg_root() + "/Sounds/wasp.wav";
|
||||||
strcat(path, "/Sounds/");
|
|
||||||
strcpy(slfile, path);
|
|
||||||
strcat(slfile, "wasp.wav");
|
|
||||||
|
|
||||||
s1 = new slSample ( slfile );
|
s1 = new slSample ( (char *)slfile.c_str() );
|
||||||
printf("Rate = %d Bps = %d Stereo = %d\n",
|
printf("Rate = %d Bps = %d Stereo = %d\n",
|
||||||
s1 -> getRate(), s1 -> getBps(), s1 -> getStereo());
|
s1 -> getRate(), s1 -> getBps(), s1 -> getStereo());
|
||||||
audio_sched -> loopSample ( s1 );
|
audio_sched -> loopSample ( s1 );
|
||||||
|
@ -805,8 +801,6 @@ int fgGlutInitEvents( void ) {
|
||||||
// Main ...
|
// Main ...
|
||||||
int main( int argc, char **argv ) {
|
int main( int argc, char **argv ) {
|
||||||
fgFLIGHT *f;
|
fgFLIGHT *f;
|
||||||
char config[256];
|
|
||||||
int result; // Used in command line argument.
|
|
||||||
|
|
||||||
f = current_aircraft.flight;
|
f = current_aircraft.flight;
|
||||||
|
|
||||||
|
@ -821,21 +815,22 @@ int main( int argc, char **argv ) {
|
||||||
|
|
||||||
// Attempt to locate and parse a config file
|
// Attempt to locate and parse a config file
|
||||||
// First check fg_root
|
// First check fg_root
|
||||||
current_options.get_fg_root(config);
|
string config = current_options.get_fg_root() + "/system.fgfsrc";
|
||||||
strcat(config, "/system.fgfsrc");
|
current_options.parse_config_file( config );
|
||||||
result = current_options.parse_config_file(config);
|
|
||||||
|
|
||||||
// Next check home directory
|
// Next check home directory
|
||||||
if ( getenv("HOME") != NULL ) {
|
char* envp = ::getenv( "HOME" );
|
||||||
strcpy(config, getenv("HOME"));
|
if ( envp != NULL ) {
|
||||||
strcat(config, "/.fgfsrc");
|
config = envp;
|
||||||
result = current_options.parse_config_file(config);
|
config += "/.fgfsrc";
|
||||||
|
current_options.parse_config_file( config );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse remaining command line options
|
// Parse remaining command line options
|
||||||
// These will override anything specified in a config file
|
// These will override anything specified in a config file
|
||||||
result = current_options.parse_command_line(argc, argv);
|
if ( current_options.parse_command_line(argc, argv) !=
|
||||||
if ( result != FG_OPTIONS_OK ) {
|
fgOPTIONS::FG_OPTIONS_OK )
|
||||||
|
{
|
||||||
// Something must have gone horribly wrong with the command
|
// Something must have gone horribly wrong with the command
|
||||||
// line parsing or maybe the user just requested help ... :-)
|
// line parsing or maybe the user just requested help ... :-)
|
||||||
current_options.usage();
|
current_options.usage();
|
||||||
|
@ -872,7 +867,16 @@ int main( int argc, char **argv ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
// Revision 1.46 1998/08/22 14:49:56 curt
|
// Revision 1.47 1998/08/27 17:02:04 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
|
// Revision 1.46 1998/08/22 14:49:56 curt
|
||||||
// Attempting to iron out seg faults and crashes.
|
// Attempting to iron out seg faults and crashes.
|
||||||
// Did some shuffling to fix a initialization order problem between view
|
// Did some shuffling to fix a initialization order problem between view
|
||||||
// position, scenery elevation.
|
// position, scenery elevation.
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <Include/fg_constants.h>
|
#include <Include/fg_constants.h>
|
||||||
#include <Include/general.h>
|
#include <Include/general.h>
|
||||||
|
@ -74,13 +75,13 @@ extern const char *default_root;
|
||||||
|
|
||||||
// Set initial position and orientation
|
// Set initial position and orientation
|
||||||
int fgInitPosition( void ) {
|
int fgInitPosition( void ) {
|
||||||
char id[5];
|
string id;
|
||||||
fgFLIGHT *f;
|
fgFLIGHT *f;
|
||||||
|
|
||||||
f = current_aircraft.flight;
|
f = current_aircraft.flight;
|
||||||
|
|
||||||
current_options.get_airport_id(id);
|
id = current_options.get_airport_id();
|
||||||
if ( strlen(id) ) {
|
if ( id.length() ) {
|
||||||
// set initial position from airport id
|
// set initial position from airport id
|
||||||
|
|
||||||
fgAIRPORTS airports;
|
fgAIRPORTS airports;
|
||||||
|
@ -88,15 +89,15 @@ int fgInitPosition( void ) {
|
||||||
|
|
||||||
fgPrintf( FG_GENERAL, FG_INFO,
|
fgPrintf( FG_GENERAL, FG_INFO,
|
||||||
"Attempting to set starting position from airport code %s.\n",
|
"Attempting to set starting position from airport code %s.\n",
|
||||||
id);
|
id.c_str() );
|
||||||
|
|
||||||
airports.load("apt_simple");
|
airports.load("apt_simple");
|
||||||
a = airports.search(id);
|
a = airports.search( (char *)id.c_str() );
|
||||||
if ( (fabs(a.longitude) < FG_EPSILON) &&
|
if ( (fabs(a.longitude) < FG_EPSILON) &&
|
||||||
(fabs(a.latitude) < FG_EPSILON) &&
|
(fabs(a.latitude) < FG_EPSILON) &&
|
||||||
(fabs(a.elevation) < FG_EPSILON) ) {
|
(fabs(a.elevation) < FG_EPSILON) ) {
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT,
|
fgPrintf( FG_GENERAL, FG_EXIT,
|
||||||
"Failed to find %s in database.\n", id);
|
"Failed to find %s in database.\n", id.c_str() );
|
||||||
} else {
|
} else {
|
||||||
FG_Longitude = ( a.longitude ) * DEG_TO_RAD;
|
FG_Longitude = ( a.longitude ) * DEG_TO_RAD;
|
||||||
FG_Latitude = ( a.latitude ) * DEG_TO_RAD;
|
FG_Latitude = ( a.latitude ) * DEG_TO_RAD;
|
||||||
|
@ -125,7 +126,7 @@ int fgInitPosition( void ) {
|
||||||
// General house keeping initializations
|
// General house keeping initializations
|
||||||
int fgInitGeneral( void ) {
|
int fgInitGeneral( void ) {
|
||||||
fgGENERAL *g;
|
fgGENERAL *g;
|
||||||
char root[256];
|
string root;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
g = &general;
|
g = &general;
|
||||||
|
@ -137,14 +138,14 @@ int fgInitGeneral( void ) {
|
||||||
g->glRenderer = (char *)glGetString ( GL_RENDERER );
|
g->glRenderer = (char *)glGetString ( GL_RENDERER );
|
||||||
g->glVersion = (char *)glGetString ( GL_VERSION );
|
g->glVersion = (char *)glGetString ( GL_VERSION );
|
||||||
|
|
||||||
current_options.get_fg_root(root);
|
root = current_options.get_fg_root();
|
||||||
if ( !strlen(root) ) {
|
if ( ! root.length() ) {
|
||||||
// No root path set? Then bail ...
|
// No root path set? Then bail ...
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT, "%s %s\n",
|
fgPrintf( FG_GENERAL, FG_EXIT, "%s %s\n",
|
||||||
"Cannot continue without environment variable FG_ROOT",
|
"Cannot continue without environment variable FG_ROOT",
|
||||||
"being defined.");
|
"being defined.");
|
||||||
}
|
}
|
||||||
fgPrintf( FG_GENERAL, FG_INFO, "FG_ROOT = %s\n\n", root);
|
fgPrintf( FG_GENERAL, FG_INFO, "FG_ROOT = %s\n\n", root.c_str() );
|
||||||
|
|
||||||
// prime the frame rate counter pump
|
// prime the frame rate counter pump
|
||||||
for ( i = 0; i < FG_FRAME_RATE_HISTORY; i++ ) {
|
for ( i = 0; i < FG_FRAME_RATE_HISTORY; i++ ) {
|
||||||
|
@ -388,6 +389,15 @@ int fgInitSubsystems( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.34 1998/08/27 17:02:06 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
// Revision 1.33 1998/08/25 20:53:32 curt
|
// Revision 1.33 1998/08/25 20:53:32 curt
|
||||||
// Shuffled $FG_ROOT file layout.
|
// Shuffled $FG_ROOT file layout.
|
||||||
//
|
//
|
||||||
|
|
576
Main/options.cxx
576
Main/options.cxx
|
@ -31,6 +31,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h> // atof(), atoi()
|
#include <stdlib.h> // atof(), atoi()
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
#include <Flight/flight.h>
|
#include <Flight/flight.h>
|
||||||
|
@ -39,187 +40,154 @@
|
||||||
|
|
||||||
#include "options.hxx"
|
#include "options.hxx"
|
||||||
|
|
||||||
|
inline double
|
||||||
|
atof( const string& str )
|
||||||
|
{
|
||||||
|
return ::atof( str.c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
|
inline int
|
||||||
|
atoi( const string& str )
|
||||||
|
{
|
||||||
|
return ::atoi( str.c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
// Defined the shared options class here
|
// Defined the shared options class here
|
||||||
fgOPTIONS current_options;
|
fgOPTIONS current_options;
|
||||||
|
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
fgOPTIONS::fgOPTIONS( void ) {
|
fgOPTIONS::fgOPTIONS() :
|
||||||
// set initial values/defaults
|
// starting longitude in degrees (west = -)
|
||||||
|
// starting latitude in degrees (south = -)
|
||||||
|
|
||||||
if ( getenv("FG_ROOT") != NULL ) {
|
// Default initial position is Globe, AZ (P13)
|
||||||
|
lon(-110.6642444),
|
||||||
|
lat( 33.3528917),
|
||||||
|
|
||||||
|
// North of the city of Globe
|
||||||
|
// lon(-110.7),
|
||||||
|
// lat( 33.4),
|
||||||
|
|
||||||
|
// North of the city of Globe
|
||||||
|
// lon(-110.742578),
|
||||||
|
// lat( 33.507122),
|
||||||
|
|
||||||
|
// Near where I used to live in Globe, AZ
|
||||||
|
// lon(-110.766000),
|
||||||
|
// lat( 33.377778),
|
||||||
|
|
||||||
|
// 10125 Jewell St. NE
|
||||||
|
// lon(-93.15),
|
||||||
|
// lat( 45.15),
|
||||||
|
|
||||||
|
// Near KHSP (Hot Springs, VA)
|
||||||
|
// lon(-79.8338964 + 0.01),
|
||||||
|
// lat( 37.9514564 + 0.008),
|
||||||
|
|
||||||
|
// (SEZ) SEDONA airport
|
||||||
|
// lon(-111.7884614 + 0.01),
|
||||||
|
// lat( 34.8486289 - 0.015),
|
||||||
|
|
||||||
|
// Somewhere near the Grand Canyon
|
||||||
|
// lon(-112.5),
|
||||||
|
// lat( 36.5),
|
||||||
|
|
||||||
|
// Jim Brennon's Kingmont Observatory
|
||||||
|
// lon(-121.1131667),
|
||||||
|
// lat( 38.8293917),
|
||||||
|
|
||||||
|
// Huaras, Peru (S09d 31.871' W077d 31.498')
|
||||||
|
// lon(-77.5249667),
|
||||||
|
// lat( -9.5311833),
|
||||||
|
|
||||||
|
// Eclipse Watching w73.5 n10 (approx) 18:00 UT
|
||||||
|
// lon(-73.5),
|
||||||
|
// lat( 10.0),
|
||||||
|
|
||||||
|
// Test Position
|
||||||
|
// lon( 8.5),
|
||||||
|
// lat(47.5),
|
||||||
|
|
||||||
|
// Timms Hill (WI)
|
||||||
|
// lon(-90.1953055556),
|
||||||
|
// lat( 45.4511388889),
|
||||||
|
|
||||||
|
// starting altitude in meters (this will be reset to ground level
|
||||||
|
// if it is lower than the terrain
|
||||||
|
altitude(-9999.0),
|
||||||
|
|
||||||
|
// Initial Orientation
|
||||||
|
heading(270.0), // heading (yaw) angle in degress (Psi)
|
||||||
|
roll(0.0), // roll angle in degrees (Phi)
|
||||||
|
pitch(0.424), // pitch angle in degrees (Theta)
|
||||||
|
|
||||||
|
// Miscellaneous
|
||||||
|
game_mode(0),
|
||||||
|
splash_screen(1),
|
||||||
|
intro_music(1),
|
||||||
|
mouse_pointer(0),
|
||||||
|
pause(0),
|
||||||
|
|
||||||
|
// Features
|
||||||
|
hud_status(1),
|
||||||
|
panel_status(0),
|
||||||
|
sound(1),
|
||||||
|
|
||||||
|
// Flight Model options
|
||||||
|
flight_model(FG_LARCSIM),
|
||||||
|
|
||||||
|
// Rendering options
|
||||||
|
fog(FG_FOG_NICEST), // nicest
|
||||||
|
fov(55.0),
|
||||||
|
fullscreen(0),
|
||||||
|
shading(1),
|
||||||
|
skyblend(1),
|
||||||
|
textures(1),
|
||||||
|
wireframe(0),
|
||||||
|
|
||||||
|
// Scenery options
|
||||||
|
tile_diameter(5),
|
||||||
|
|
||||||
|
// HUD options
|
||||||
|
tris_or_culled(0),
|
||||||
|
|
||||||
|
// Time options
|
||||||
|
time_offset(0)
|
||||||
|
{
|
||||||
|
// set initial values/defaults
|
||||||
|
char* envp = ::getenv( "FG_ROOT" );
|
||||||
|
|
||||||
|
if ( envp != NULL ) {
|
||||||
// fg_root could be anywhere, so default to environmental
|
// fg_root could be anywhere, so default to environmental
|
||||||
// variable $FG_ROOT if it is set.
|
// variable $FG_ROOT if it is set.
|
||||||
|
fg_root = envp;
|
||||||
strcpy(fg_root, getenv("FG_ROOT"));
|
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, default to a random compiled in location if
|
// Otherwise, default to a random compiled in location if
|
||||||
// $FG_ROOT is not set. This can still be overridden from the
|
// $FG_ROOT is not set. This can still be overridden from the
|
||||||
// command line or a config file.
|
// command line or a config file.
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
strcpy(fg_root, "\\FlightGear");
|
fg_root = "\\FlightGear";
|
||||||
#else
|
#else
|
||||||
strcpy(fg_root, "/usr/local/lib/FlightGear");
|
fg_root = "/usr/local/lib/FlightGear";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Starting posistion and orientation
|
airport_id = ""; // default airport id
|
||||||
strcpy(airport_id, ""); // default airport id
|
|
||||||
lon = 0.0; // starting longitude in degrees (west = -)
|
|
||||||
lat = 0.0; // starting latitude in degrees (south = -)
|
|
||||||
|
|
||||||
// If nothing else is specified, default initial position is
|
|
||||||
// Globe, AZ (P13)
|
|
||||||
lon = -110.6642444;
|
|
||||||
lat = 33.3528917;
|
|
||||||
|
|
||||||
// North of the city of Globe
|
|
||||||
// lon = -110.7;
|
|
||||||
// lat = 33.4;
|
|
||||||
|
|
||||||
// North of the city of Globe
|
|
||||||
// lon = -110.742578;
|
|
||||||
// lat = 33.507122;
|
|
||||||
|
|
||||||
// Near where I used to live in Globe, AZ
|
|
||||||
// lon = -110.766000;
|
|
||||||
// lat = 33.377778;
|
|
||||||
|
|
||||||
// 10125 Jewell St. NE
|
|
||||||
// lon = -93.15;
|
|
||||||
// lat = 45.15;
|
|
||||||
|
|
||||||
// Near KHSP (Hot Springs, VA)
|
|
||||||
// lon = -79.8338964 + 0.01;
|
|
||||||
// lat = 37.9514564 + 0.008;
|
|
||||||
|
|
||||||
// (SEZ) SEDONA airport
|
|
||||||
// lon = -111.7884614 + 0.01;
|
|
||||||
// lat = 34.8486289 - 0.015;
|
|
||||||
|
|
||||||
// Somewhere near the Grand Canyon
|
|
||||||
// lon = -112.5;
|
|
||||||
// lat = 36.5;
|
|
||||||
|
|
||||||
// Jim Brennon's Kingmont Observatory
|
|
||||||
// lon = -121.1131667;
|
|
||||||
// lat = 38.8293917;
|
|
||||||
|
|
||||||
// Huaras, Peru (S09d 31.871' W077d 31.498')
|
|
||||||
// lon = -77.5249667;
|
|
||||||
// lat = -9.5311833;
|
|
||||||
|
|
||||||
// Eclipse Watching w73.5 n10 (approx) 18:00 UT
|
|
||||||
// lon = -73.5;
|
|
||||||
// lat = 10.0;
|
|
||||||
|
|
||||||
// Test Position
|
|
||||||
// lon = 8.5;
|
|
||||||
// lat = 47.5;
|
|
||||||
|
|
||||||
// Timms Hill (WI)
|
|
||||||
// lon = -90.1953055556;
|
|
||||||
// lat = 45.4511388889;
|
|
||||||
|
|
||||||
altitude = -9999.0; // starting altitude in meters (this will be
|
|
||||||
// reset to ground level if it is lower
|
|
||||||
// than the terrain
|
|
||||||
|
|
||||||
// Initial Orientation
|
|
||||||
heading = 270.0; // heading (yaw) angle in degress (Psi)
|
|
||||||
roll = 0.0; // roll angle in degrees (Phi)
|
|
||||||
pitch = 0.424; // pitch angle in degrees (Theta)
|
|
||||||
|
|
||||||
// Miscellaneous
|
|
||||||
game_mode = 0;
|
|
||||||
splash_screen = 1;
|
|
||||||
intro_music = 1;
|
|
||||||
mouse_pointer = 0;
|
|
||||||
pause = 0;
|
|
||||||
|
|
||||||
// Features
|
|
||||||
hud_status = 1;
|
|
||||||
panel_status = 0;
|
|
||||||
sound = 1;
|
|
||||||
|
|
||||||
// Flight Model options
|
|
||||||
flight_model = FG_LARCSIM;
|
|
||||||
|
|
||||||
// Rendering options
|
|
||||||
fog = 2; // nicest
|
|
||||||
fov = 55.0;
|
|
||||||
fullscreen = 0;
|
|
||||||
shading = 1;
|
|
||||||
skyblend = 1;
|
|
||||||
textures = 1;
|
|
||||||
wireframe = 0;
|
|
||||||
|
|
||||||
// Scenery options
|
|
||||||
tile_diameter = 5;
|
|
||||||
|
|
||||||
// HUD options
|
|
||||||
tris_or_culled = 0;
|
|
||||||
|
|
||||||
// Time options
|
|
||||||
time_offset = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Parse an int out of a --foo-bar=n type option
|
double
|
||||||
static int parse_int(char *arg) {
|
fgOPTIONS::parse_time(const string& time_in) {
|
||||||
int result;
|
char *time_str, num[256];
|
||||||
|
|
||||||
// advance past the '='
|
|
||||||
while ( (arg[0] != '=') && (arg[0] != '\0') ) {
|
|
||||||
arg++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( arg[0] == '=' ) {
|
|
||||||
arg++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// printf("parse_int(): arg = %s\n", arg);
|
|
||||||
|
|
||||||
result = atoi(arg);
|
|
||||||
|
|
||||||
// printf("parse_int(): result = %d\n", result);
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Parse an int out of a --foo-bar=n type option
|
|
||||||
static double parse_double(char *arg) {
|
|
||||||
double result;
|
|
||||||
|
|
||||||
// advance past the '='
|
|
||||||
while ( (arg[0] != '=') && (arg[0] != '\0') ) {
|
|
||||||
arg++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( arg[0] == '=' ) {
|
|
||||||
arg++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// printf("parse_double(): arg = %s\n", arg);
|
|
||||||
|
|
||||||
result = atof(arg);
|
|
||||||
|
|
||||||
// printf("parse_double(): result = %.4f\n", result);
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static double parse_time(char *time_str) {
|
|
||||||
char num[256];
|
|
||||||
double hours, minutes, seconds;
|
double hours, minutes, seconds;
|
||||||
double result = 0.0;
|
double result = 0.0;
|
||||||
int sign = 1;
|
int sign = 1;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
time_str = (char *)time_in.c_str();
|
||||||
|
|
||||||
// printf("parse_time(): %s\n", time_str);
|
// printf("parse_time(): %s\n", time_str);
|
||||||
|
|
||||||
// check for sign
|
// check for sign
|
||||||
|
@ -290,19 +258,9 @@ static double parse_time(char *time_str) {
|
||||||
|
|
||||||
|
|
||||||
// parse degree in the form of [+/-]hhh:mm:ss
|
// parse degree in the form of [+/-]hhh:mm:ss
|
||||||
static double parse_degree(char *degree_str) {
|
double
|
||||||
double result;
|
fgOPTIONS::parse_degree( const string& degree_str) {
|
||||||
|
double result = parse_time( degree_str );
|
||||||
// advance past the '='
|
|
||||||
while ( (degree_str[0] != '=') && (degree_str[0] != '\0') ) {
|
|
||||||
degree_str++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( degree_str[0] == '=' ) {
|
|
||||||
degree_str++;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = parse_time(degree_str);
|
|
||||||
|
|
||||||
// printf("Degree = %.4f\n", result);
|
// printf("Degree = %.4f\n", result);
|
||||||
|
|
||||||
|
@ -311,18 +269,10 @@ static double parse_degree(char *degree_str) {
|
||||||
|
|
||||||
|
|
||||||
// parse time offset command line option
|
// parse time offset command line option
|
||||||
static int parse_time_offset(char *time_str) {
|
int
|
||||||
|
fgOPTIONS::parse_time_offset( const string& time_str) {
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
// advance past the '='
|
|
||||||
while ( (time_str[0] != '=') && (time_str[0] != '\0') ) {
|
|
||||||
time_str++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( time_str[0] == '=' ) {
|
|
||||||
time_str++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// printf("time offset = %s\n", time_str);
|
// printf("time offset = %s\n", time_str);
|
||||||
|
|
||||||
#ifdef HAVE_RINT
|
#ifdef HAVE_RINT
|
||||||
|
@ -339,13 +289,9 @@ static int parse_time_offset(char *time_str) {
|
||||||
|
|
||||||
// Parse --tile-diameter=n type option
|
// Parse --tile-diameter=n type option
|
||||||
|
|
||||||
#define FG_RADIUS_MIN 1
|
int
|
||||||
#define FG_RADIUS_MAX 4
|
fgOPTIONS::parse_tile_radius( const string& arg ) {
|
||||||
|
int radius = atoi( arg );
|
||||||
static int parse_tile_radius(char *arg) {
|
|
||||||
int radius;
|
|
||||||
|
|
||||||
radius = parse_int(arg);
|
|
||||||
|
|
||||||
if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
|
if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
|
||||||
if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
|
if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
|
||||||
|
@ -357,19 +303,17 @@ static int parse_tile_radius(char *arg) {
|
||||||
|
|
||||||
|
|
||||||
// Parse --flightmode=abcdefg type option
|
// Parse --flightmode=abcdefg type option
|
||||||
static int parse_flight_model(char *fm) {
|
int
|
||||||
fm += 15;
|
fgOPTIONS::parse_flight_model( const string& fm ) {
|
||||||
|
|
||||||
// printf("flight model = %s\n", fm);
|
// printf("flight model = %s\n", fm);
|
||||||
|
|
||||||
if ( strcmp(fm, "slew") == 0 ) {
|
if ( fm == "slew" ) {
|
||||||
return(FG_SLEW);
|
return(FG_SLEW);
|
||||||
} else if ( strcmp(fm, "larcsim") == 0 ) {
|
} else if ( (fm == "larcsim") || (fm == "LaRCsim") ) {
|
||||||
return(FG_LARCSIM);
|
|
||||||
} else if ( strcmp(fm, "LaRCsim") == 0 ) {
|
|
||||||
return(FG_LARCSIM);
|
return(FG_LARCSIM);
|
||||||
} else {
|
} else {
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT, "Unknown flight model = %s\n", fm);
|
fgPrintf( FG_GENERAL, FG_EXIT, "Unknown flight model = %s\n",
|
||||||
|
fm.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// we'll never get here, but it makes the compiler happy.
|
// we'll never get here, but it makes the compiler happy.
|
||||||
|
@ -378,10 +322,9 @@ static int parse_flight_model(char *fm) {
|
||||||
|
|
||||||
|
|
||||||
// Parse --fov=x.xx type option
|
// Parse --fov=x.xx type option
|
||||||
static double parse_fov(char *arg) {
|
double
|
||||||
double fov;
|
fgOPTIONS::parse_fov( const string& arg ) {
|
||||||
|
double fov = atof(arg);
|
||||||
fov = parse_double(arg);
|
|
||||||
|
|
||||||
if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
|
if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
|
||||||
if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
|
if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
|
||||||
|
@ -393,103 +336,101 @@ static double parse_fov(char *arg) {
|
||||||
|
|
||||||
|
|
||||||
// Parse a single option
|
// Parse a single option
|
||||||
int fgOPTIONS::parse_option( char *arg ) {
|
int fgOPTIONS::parse_option( const string& arg ) {
|
||||||
// General Options
|
// General Options
|
||||||
if ( (strcmp(arg, "--help") == 0) ||
|
if ( (arg == "--help") || (arg == "-h") ) {
|
||||||
(strcmp(arg, "-h") == 0) ) {
|
|
||||||
// help/usage request
|
// help/usage request
|
||||||
return(FG_OPTIONS_HELP);
|
return(FG_OPTIONS_HELP);
|
||||||
} else if ( strcmp(arg, "--disable-game-mode") == 0 ) {
|
} else if ( arg == "--disable-game-mode") {
|
||||||
game_mode = 0;
|
game_mode = false;
|
||||||
} else if ( strcmp(arg, "--enable-game-mode") == 0 ) {
|
} else if ( arg == "--enable-game-mode" ) {
|
||||||
game_mode = 1;
|
game_mode = true;
|
||||||
} else if ( strcmp(arg, "--disable-splash-screen") == 0 ) {
|
} else if ( arg == "--disable-splash-screen" ) {
|
||||||
splash_screen = 0;
|
splash_screen = false;
|
||||||
} else if ( strcmp(arg, "--enable-splash-screen") == 0 ) {
|
} else if ( arg == "--enable-splash-screen" ) {
|
||||||
splash_screen = 1;
|
splash_screen = true;
|
||||||
} else if ( strcmp(arg, "--disable-intro-music") == 0 ) {
|
} else if ( arg == "--disable-intro-music" ) {
|
||||||
intro_music = 0;
|
intro_music = false;
|
||||||
} else if ( strcmp(arg, "--enable-intro-music") == 0 ) {
|
} else if ( arg == "--enable-intro-music" ) {
|
||||||
intro_music = 1;
|
intro_music = true;
|
||||||
} else if ( strcmp(arg, "--disable-mouse-pointer") == 0 ) {
|
} else if ( arg == "--disable-mouse-pointer" ) {
|
||||||
mouse_pointer = 1;
|
mouse_pointer = 1;
|
||||||
} else if ( strcmp(arg, "--enable-mouse-pointer") == 0 ) {
|
} else if ( arg == "--enable-mouse-pointer" ) {
|
||||||
mouse_pointer = 2;
|
mouse_pointer = 2;
|
||||||
} else if ( strcmp(arg, "--disable-pause") == 0 ) {
|
} else if ( arg == "--disable-pause" ) {
|
||||||
pause = 0;
|
pause = false;
|
||||||
} else if ( strcmp(arg, "--enable-pause") == 0 ) {
|
} else if ( arg == "--enable-pause" ) {
|
||||||
pause = 1;
|
pause = true;
|
||||||
} else if ( strcmp(arg, "--disable-hud") == 0 ) {
|
} else if ( arg == "--disable-hud" ) {
|
||||||
hud_status = 0;
|
hud_status = false;
|
||||||
} else if ( strcmp(arg, "--enable-hud") == 0 ) {
|
} else if ( arg == "--enable-hud" ) {
|
||||||
hud_status = 1;
|
hud_status = true;
|
||||||
} else if ( strcmp(arg, "--disable-panel") == 0 ) {
|
} else if ( arg == "--disable-panel" ) {
|
||||||
panel_status = 0;
|
panel_status = false;
|
||||||
} else if ( strcmp(arg, "--enable-panel") == 0 ) {
|
} else if ( arg == "--enable-panel" ) {
|
||||||
panel_status = 1;
|
panel_status = true;
|
||||||
} else if ( strcmp(arg, "--disable-sound") == 0 ) {
|
} else if ( arg == "--disable-sound" ) {
|
||||||
sound = 0;
|
sound = false;
|
||||||
} else if ( strcmp(arg, "--enable-sound") == 0 ) {
|
} else if ( arg == "--enable-sound" ) {
|
||||||
sound = 1;
|
sound = true;
|
||||||
} else if ( strncmp(arg, "--airport-id=", 13) == 0 ) {
|
} else if ( arg.find( "--airport-id=") != string::npos ) {
|
||||||
arg += 13;
|
airport_id = arg.substr( 13 );
|
||||||
strncpy(airport_id, arg, 4);
|
} else if ( arg.find( "--lon=" ) != string::npos ) {
|
||||||
} else if ( strncmp(arg, "--lon=", 6) == 0 ) {
|
lon = parse_degree( arg.substr(6) );
|
||||||
lon = parse_degree(arg);
|
} else if ( arg.find( "--lat=" ) != string::npos ) {
|
||||||
} else if ( strncmp(arg, "--lat=", 6) == 0 ) {
|
lat = parse_degree( arg.substr(6) );
|
||||||
lat = parse_degree(arg);
|
} else if ( arg.find( "--altitude=" ) != string::npos ) {
|
||||||
} else if ( strncmp(arg, "--altitude=", 11) == 0 ) {
|
altitude = atof( arg.substr(11) );
|
||||||
altitude = parse_double(arg);
|
} else if ( arg.find( "--heading=" ) != string::npos ) {
|
||||||
} else if ( strncmp(arg, "--heading=", 6) == 0 ) {
|
heading = atof( arg.substr(10) );
|
||||||
heading = parse_double(arg);
|
} else if ( arg.find( "--roll=" ) != string::npos ) {
|
||||||
} else if ( strncmp(arg, "--roll=", 7) == 0 ) {
|
roll = atof( arg.substr(7) );
|
||||||
roll = parse_double(arg);
|
} else if ( arg.find( "--pitch=" ) != string::npos ) {
|
||||||
} else if ( strncmp(arg, "--pitch=", 8) == 0 ) {
|
pitch = atof( arg.substr(8) );
|
||||||
pitch = parse_double(arg);
|
} else if ( arg.find( "--fg-root=" ) != string::npos ) {
|
||||||
} else if ( strncmp(arg, "--fg-root=", 10) == 0 ) {
|
fg_root = arg.substr( 10 );
|
||||||
arg += 10;
|
} else if ( arg.find( "--flight-model=" ) != string::npos ) {
|
||||||
strcpy(fg_root, arg);
|
flight_model = parse_flight_model( arg.substr(15) );
|
||||||
} else if ( strncmp(arg, "--flight-model=", 15) == 0 ) {
|
} else if ( arg == "--fog-disable" ) {
|
||||||
flight_model = parse_flight_model(arg);
|
fog = FG_FOG_DISABLED;
|
||||||
} else if ( strcmp(arg, "--fog-disable") == 0 ) {
|
} else if ( arg == "--fog-fastest" ) {
|
||||||
fog = 0;
|
fog = FG_FOG_FASTEST;
|
||||||
} else if ( strcmp(arg, "--fog-fastest") == 0 ) {
|
} else if ( arg == "--fog-nicest" ) {
|
||||||
fog = 1;
|
fog = FG_FOG_NICEST;
|
||||||
} else if ( strcmp(arg, "--fog-nicest") == 0 ) {
|
} else if ( arg.find( "--fov=" ) != string::npos ) {
|
||||||
fog = 2;
|
fov = parse_fov( arg.substr(6) );
|
||||||
} else if ( strncmp(arg, "--fov=", 6) == 0 ) {
|
} else if ( arg == "--disable-fullscreen" ) {
|
||||||
fov = parse_fov(arg);
|
fullscreen = false;
|
||||||
} else if ( strcmp(arg, "--disable-fullscreen") == 0 ) {
|
} else if ( arg== "--enable-fullscreen") {
|
||||||
fullscreen = 0;
|
fullscreen = true;
|
||||||
} else if ( strcmp(arg, "--enable-fullscreen") == 0 ) {
|
} else if ( arg == "--shading-flat") {
|
||||||
fullscreen = 1;
|
|
||||||
} else if ( strcmp(arg, "--shading-flat") == 0 ) {
|
|
||||||
shading = 0;
|
shading = 0;
|
||||||
} else if ( strcmp(arg, "--shading-smooth") == 0 ) {
|
} else if ( arg == "--shading-smooth") {
|
||||||
shading = 1;
|
shading = 1;
|
||||||
} else if ( strcmp(arg, "--disable-skyblend") == 0 ) {
|
} else if ( arg == "--disable-skyblend") {
|
||||||
skyblend = 0;
|
skyblend = false;
|
||||||
} else if ( strcmp(arg, "--enable-skyblend") == 0 ) {
|
} else if ( arg== "--enable-skyblend" ) {
|
||||||
skyblend = 1;
|
skyblend = true;
|
||||||
} else if ( strcmp(arg, "--disable-textures") == 0 ) {
|
} else if ( arg == "--disable-textures" ) {
|
||||||
textures = 0;
|
textures = false;
|
||||||
} else if ( strcmp(arg, "--enable-textures") == 0 ) {
|
} else if ( arg == "--enable-textures" ) {
|
||||||
textures = 1;
|
textures = true;
|
||||||
} else if ( strcmp(arg, "--disable-wireframe") == 0 ) {
|
} else if ( arg == "--disable-wireframe" ) {
|
||||||
wireframe = 0;
|
wireframe = false;
|
||||||
} else if ( strcmp(arg, "--enable-wireframe") == 0 ) {
|
} else if ( arg == "--enable-wireframe" ) {
|
||||||
wireframe = 1;
|
wireframe = true;
|
||||||
} else if ( strncmp(arg, "--tile-radius=", 14) == 0 ) {
|
} else if ( arg.find( "--tile-radius=" ) != string::npos ) {
|
||||||
tile_radius = parse_tile_radius(arg);
|
tile_radius = parse_tile_radius( arg.substr(14) );
|
||||||
tile_diameter = tile_radius * 2 + 1;
|
tile_diameter = tile_radius * 2 + 1;
|
||||||
} else if ( strncmp(arg, "--time-offset=", 14) == 0 ) {
|
} else if ( arg.find( "--time-offset=" ) != string::npos ) {
|
||||||
time_offset = parse_time_offset(arg);
|
time_offset = parse_time_offset( (arg.substr(14)) );
|
||||||
} else if ( strcmp(arg, "--hud-tris") == 0 ) {
|
} else if ( arg == "--hud-tris" ) {
|
||||||
tris_or_culled = 0;
|
tris_or_culled = 0;
|
||||||
} else if ( strcmp(arg, "--hud-culled") == 0 ) {
|
} else if ( arg == "--hud-culled" ) {
|
||||||
tris_or_culled = 1;
|
tris_or_culled = 1;
|
||||||
} else {
|
} else {
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT, "Unknown option '%s'\n", arg);
|
fgPrintf( FG_GENERAL, FG_EXIT, "Unknown option '%s'\n",
|
||||||
|
arg.c_str() );
|
||||||
return(FG_OPTIONS_ERROR);
|
return(FG_OPTIONS_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,24 +460,23 @@ int fgOPTIONS::parse_command_line( int argc, char **argv ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Parse the command line options
|
// Parse config file options
|
||||||
int fgOPTIONS::parse_config_file( char *path ) {
|
int fgOPTIONS::parse_config_file( const string& path ) {
|
||||||
char fgpath[256], line[256];
|
char line[256];
|
||||||
fgFile f;
|
fgFile f;
|
||||||
int len, result;
|
int len;
|
||||||
|
string fgpath = path + ".gz";
|
||||||
strcpy(fgpath, path);
|
|
||||||
strcat(fgpath, ".gz");
|
|
||||||
|
|
||||||
// first try "path.gz"
|
// first try "path.gz"
|
||||||
if ( (f = fgopen(fgpath, "rb")) == NULL ) {
|
if ( (f = fgopen(fgpath.c_str(), "rb")) == NULL ) {
|
||||||
// next try "path"
|
// next try "path"
|
||||||
if ( (f = fgopen(path, "rb")) == NULL ) {
|
if ( (f = fgopen(path.c_str(), "rb")) == NULL ) {
|
||||||
return(FG_OPTIONS_ERROR);
|
return(FG_OPTIONS_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fgPrintf(FG_GENERAL, FG_INFO, "Processing config file: %s\n", path);
|
fgPrintf( FG_GENERAL, FG_INFO, "Processing config file: %s\n",
|
||||||
|
path.c_str() );
|
||||||
|
|
||||||
while ( fggets(f, line, 250) != NULL ) {
|
while ( fggets(f, line, 250) != NULL ) {
|
||||||
// strip trailing newline if it exists
|
// strip trailing newline if it exists
|
||||||
|
@ -551,15 +491,15 @@ int fgOPTIONS::parse_config_file( char *path ) {
|
||||||
line[len-1] = '\0';
|
line[len-1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
result = parse_option(line);
|
if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
|
||||||
if ( result == FG_OPTIONS_ERROR ) {
|
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT,
|
fgPrintf( FG_GENERAL, FG_EXIT,
|
||||||
"Config file parse error: %s '%s'\n", path, line );
|
"Config file parse error: %s '%s'\n",
|
||||||
|
path.c_str(), line );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fgclose(f);
|
fgclose(f);
|
||||||
return(FG_OPTIONS_OK);
|
return FG_OPTIONS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -633,47 +573,21 @@ void fgOPTIONS::usage ( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// Query functions
|
|
||||||
void fgOPTIONS::get_fg_root(char *root) { strcpy(root, fg_root); }
|
|
||||||
void fgOPTIONS::get_airport_id(char *id) { strcpy(id, airport_id); }
|
|
||||||
double fgOPTIONS::get_lon( void ) { return(lon); }
|
|
||||||
double fgOPTIONS::get_lat( void ) { return(lat); }
|
|
||||||
double fgOPTIONS::get_altitude( void ) { return(altitude); }
|
|
||||||
double fgOPTIONS::get_heading( void ) { return(heading); }
|
|
||||||
double fgOPTIONS::get_roll( void ) { return(roll); }
|
|
||||||
double fgOPTIONS::get_pitch( void ) { return(pitch); }
|
|
||||||
int fgOPTIONS::get_game_mode( void ) { return(game_mode); }
|
|
||||||
int fgOPTIONS::get_splash_screen( void ) { return(splash_screen); }
|
|
||||||
int fgOPTIONS::get_intro_music( void ) { return(intro_music); }
|
|
||||||
int fgOPTIONS::get_mouse_pointer( void ) { return(mouse_pointer); }
|
|
||||||
int fgOPTIONS::get_pause( void ) { return(pause); }
|
|
||||||
int fgOPTIONS::get_hud_status( void ) { return(hud_status); }
|
|
||||||
int fgOPTIONS::get_panel_status( void ) { return(panel_status); }
|
|
||||||
int fgOPTIONS::get_sound( void ) { return(sound); }
|
|
||||||
int fgOPTIONS::get_flight_model( void ) { return(flight_model); }
|
|
||||||
int fgOPTIONS::get_fog( void ) { return(fog); }
|
|
||||||
double fgOPTIONS::get_fov( void ) { return(fov); }
|
|
||||||
int fgOPTIONS::get_fullscreen( void ) { return(fullscreen); }
|
|
||||||
int fgOPTIONS::get_shading( void ) { return(shading); }
|
|
||||||
int fgOPTIONS::get_skyblend( void ) { return(skyblend); }
|
|
||||||
int fgOPTIONS::get_textures( void ) { return(textures); }
|
|
||||||
int fgOPTIONS::get_wireframe( void ) { return(wireframe); }
|
|
||||||
int fgOPTIONS::get_tile_radius( void ) { return(tile_radius); }
|
|
||||||
int fgOPTIONS::get_tile_diameter( void ) { return(tile_diameter); }
|
|
||||||
int fgOPTIONS::get_time_offset( void ) { return(time_offset); }
|
|
||||||
|
|
||||||
|
|
||||||
// Update functions
|
|
||||||
void fgOPTIONS::set_hud_status( int status ) { hud_status = status; }
|
|
||||||
void fgOPTIONS::set_fov( double amount ) { fov = amount; }
|
|
||||||
#endif
|
|
||||||
// Destructor
|
// Destructor
|
||||||
fgOPTIONS::~fgOPTIONS( void ) {
|
fgOPTIONS::~fgOPTIONS( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.23 1998/08/27 17:02:07 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
// Revision 1.22 1998/08/24 20:11:13 curt
|
// Revision 1.22 1998/08/24 20:11:13 curt
|
||||||
// Added i/I to toggle full vs. minimal HUD.
|
// Added i/I to toggle full vs. minimal HUD.
|
||||||
// Added a --hud-tris vs --hud-culled option.
|
// Added a --hud-tris vs --hud-culled option.
|
||||||
|
|
185
Main/options.hxx
185
Main/options.hxx
|
@ -31,22 +31,35 @@
|
||||||
# error This library requires C++
|
# error This library requires C++
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#define FG_OPTIONS_OK 0
|
#include <string.h>
|
||||||
#define FG_OPTIONS_HELP 1
|
|
||||||
#define FG_OPTIONS_ERROR 2
|
|
||||||
|
|
||||||
|
|
||||||
class fgOPTIONS {
|
class fgOPTIONS {
|
||||||
|
public:
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
FG_OPTIONS_OK = 0,
|
||||||
|
FG_OPTIONS_HELP = 1,
|
||||||
|
FG_OPTIONS_ERROR = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
enum fgFogKind
|
||||||
|
{
|
||||||
|
FG_FOG_DISABLED = 0,
|
||||||
|
FG_FOG_FASTEST = 1,
|
||||||
|
FG_FOG_NICEST = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
const int FG_RADIUS_MIN = 1;
|
||||||
|
const int FG_RADIUS_MAX = 4;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
// The flight gear "root" directory
|
// The flight gear "root" directory
|
||||||
char fg_root[256];
|
string fg_root;
|
||||||
|
|
||||||
// Starting position and orientation
|
// Starting position and orientation
|
||||||
|
string airport_id; // ID of initial starting airport
|
||||||
// ID of initial starting airport, only need 5 bytes but I guess
|
|
||||||
// 16 is good for memory alignment.
|
|
||||||
char airport_id[16];
|
|
||||||
double lon; // starting longitude in degrees (west = -)
|
double lon; // starting longitude in degrees (west = -)
|
||||||
double lat; // starting latitude in degrees (south = -)
|
double lat; // starting latitude in degrees (south = -)
|
||||||
double altitude; // starting altitude in meters
|
double altitude; // starting altitude in meters
|
||||||
|
@ -55,28 +68,28 @@ class fgOPTIONS {
|
||||||
double pitch; // pitch angle in degrees (Theta)
|
double pitch; // pitch angle in degrees (Theta)
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
int game_mode; // Game mode enabled/disabled
|
bool game_mode; // Game mode enabled/disabled
|
||||||
int splash_screen; // show splash screen
|
bool splash_screen; // show splash screen
|
||||||
int intro_music; // play introductory music
|
bool intro_music; // play introductory music
|
||||||
int mouse_pointer; // show mouse pointer
|
int mouse_pointer; // show mouse pointer
|
||||||
int pause; // pause intially enabled/disabled
|
bool pause; // pause intially enabled/disabled
|
||||||
|
|
||||||
// Features
|
// Features
|
||||||
int hud_status; // HUD on/off
|
bool hud_status; // HUD on/off
|
||||||
int panel_status; // Panel on/off
|
bool panel_status; // Panel on/off
|
||||||
int sound; // play sound effects
|
bool sound; // play sound effects
|
||||||
|
|
||||||
// Flight Model options
|
// Flight Model options
|
||||||
int flight_model; // Flight Model: FG_SLEW, FG_LARCSIM, etc.
|
int flight_model; // Flight Model: FG_SLEW, FG_LARCSIM, etc.
|
||||||
|
|
||||||
// Rendering options
|
// Rendering options
|
||||||
int fog; // Fog enabled/disabled
|
fgFogKind fog; // Fog nicest/fastest/disabled
|
||||||
double fov; // Field of View
|
double fov; // Field of View
|
||||||
int fullscreen; // Full screen mode enabled/disabled
|
bool fullscreen; // Full screen mode enabled/disabled
|
||||||
int shading; // shading method, 0 = Flat, 1 = Smooth
|
int shading; // shading method, 0 = Flat, 1 = Smooth
|
||||||
int skyblend; // Blend sky to haze (using polygons) or just clear
|
bool skyblend; // Blend sky to haze (using polygons) or just clear
|
||||||
int textures; // Textures enabled/disabled
|
bool textures; // Textures enabled/disabled
|
||||||
int wireframe; // Wireframe mode enabled/disabled
|
bool wireframe; // Wireframe mode enabled/disabled
|
||||||
|
|
||||||
// Scenery options
|
// Scenery options
|
||||||
int tile_radius; // Square radius of rendered tiles (around center
|
int tile_radius; // Square radius of rendered tiles (around center
|
||||||
|
@ -94,93 +107,64 @@ class fgOPTIONS {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructor
|
fgOPTIONS();
|
||||||
fgOPTIONS( void );
|
~fgOPTIONS();
|
||||||
|
|
||||||
// Parse a single option
|
// Parse a single option
|
||||||
int parse_option( char *arg );
|
int parse_option( const string& arg );
|
||||||
|
|
||||||
// Parse the command line options
|
// Parse the command line options
|
||||||
int parse_command_line( int argc, char **argv );
|
int parse_command_line( int argc, char **argv );
|
||||||
|
|
||||||
// Parse the command line options
|
// Parse the command line options
|
||||||
int parse_config_file( char *path );
|
int parse_config_file( const string& path );
|
||||||
|
|
||||||
// Print usage message
|
// Print usage message
|
||||||
void usage ( void );
|
void usage ( void );
|
||||||
|
|
||||||
// Query functions
|
// Query functions
|
||||||
void get_fg_root(char *root) { strcpy(root, fg_root); }
|
string get_fg_root() const { return fg_root; }
|
||||||
void get_airport_id(char *id) { strcpy(id, airport_id); }
|
string get_airport_id() const { return airport_id; }
|
||||||
double get_lon( void ) { return(lon); }
|
double get_lon() const { return lon; }
|
||||||
double get_lat( void ) { return(lat); }
|
double get_lat() const { return lat; }
|
||||||
double get_altitude( void ) { return(altitude); }
|
double get_altitude() const { return altitude; }
|
||||||
double get_heading( void ) { return(heading); }
|
double get_heading() const { return heading; }
|
||||||
double get_roll( void ) { return(roll); }
|
double get_roll() const { return roll; }
|
||||||
double get_pitch( void ) { return(pitch); }
|
double get_pitch() const { return pitch; }
|
||||||
int get_game_mode( void ) { return(game_mode); }
|
bool get_game_mode() const { return game_mode; }
|
||||||
int get_splash_screen( void ) { return(splash_screen); }
|
bool get_splash_screen() const { return splash_screen; }
|
||||||
int get_intro_music( void ) { return(intro_music); }
|
bool get_intro_music() const { return intro_music; }
|
||||||
int get_mouse_pointer( void ) { return(mouse_pointer); }
|
int get_mouse_pointer() const { return mouse_pointer; }
|
||||||
int get_pause( void ) { return(pause); }
|
bool get_pause() const { return pause; }
|
||||||
int get_hud_status( void ) { return(hud_status); }
|
bool get_hud_status() const { return hud_status; }
|
||||||
int get_panel_status( void ) { return(panel_status); }
|
bool get_panel_status() const { return panel_status; }
|
||||||
int get_sound( void ) { return(sound); }
|
bool get_sound() const { return sound; }
|
||||||
int get_flight_model( void ) { return(flight_model); }
|
int get_flight_model() const { return flight_model; }
|
||||||
int get_fog( void ) { return(fog); }
|
bool fog_enabled() const { return fog != FG_FOG_DISABLED; }
|
||||||
double get_fov( void ) { return(fov); }
|
fgFogKind get_fog() const { return fog; }
|
||||||
int get_fullscreen( void ) { return(fullscreen); }
|
double get_fov() const { return fov; }
|
||||||
int get_shading( void ) { return(shading); }
|
bool get_fullscreen() const { return fullscreen; }
|
||||||
int get_skyblend( void ) { return(skyblend); }
|
int get_shading() const { return shading; }
|
||||||
int get_textures( void ) { return(textures); }
|
bool get_skyblend() const { return skyblend; }
|
||||||
int get_wireframe( void ) { return(wireframe); }
|
bool get_textures() const { return textures; }
|
||||||
int get_tile_radius( void ) { return(tile_radius); }
|
bool get_wireframe() const { return wireframe; }
|
||||||
int get_tile_diameter( void ) { return(tile_diameter); }
|
int get_tile_radius() const { return tile_radius; }
|
||||||
int get_time_offset( void ) { return(time_offset); }
|
int get_tile_diameter() const { return tile_diameter; }
|
||||||
int get_tris_or_culled( void ) { return(tris_or_culled); }
|
int get_time_offset() const { return time_offset; }
|
||||||
|
int get_tris_or_culled() const { return tris_or_culled; }
|
||||||
|
|
||||||
// Update functions
|
// Update functions
|
||||||
void set_hud_status( int status ) { hud_status = status; }
|
void set_hud_status( bool status ) { hud_status = status; }
|
||||||
void set_fov( double amount ) { fov = amount; }
|
void set_fov( double amount ) { fov = amount; }
|
||||||
|
|
||||||
#if 0
|
private:
|
||||||
void get_fg_root(char *root);
|
|
||||||
void get_airport_id(char *id);
|
|
||||||
double get_lon( void );
|
|
||||||
double get_lat( void );
|
|
||||||
double get_altitude( void );
|
|
||||||
double get_heading( void );
|
|
||||||
double get_roll( void );
|
|
||||||
double get_pitch( void );
|
|
||||||
int get_game_mode( void );
|
|
||||||
int get_splash_screen( void );
|
|
||||||
int get_intro_music( void );
|
|
||||||
int get_mouse_pointer( void );
|
|
||||||
int get_pause( void );
|
|
||||||
int get_hud_status( void );
|
|
||||||
int get_panel_status( void );
|
|
||||||
int get_sound( void );
|
|
||||||
int get_flight_model( void );
|
|
||||||
int get_fog( void );
|
|
||||||
double get_fov( void );
|
|
||||||
int get_fullscreen( void );
|
|
||||||
int get_shading( void );
|
|
||||||
int get_skyblend( void );
|
|
||||||
int get_textures( void );
|
|
||||||
int get_wireframe( void );
|
|
||||||
int get_tile_radius( void );
|
|
||||||
int get_tile_diameter( void );
|
|
||||||
int get_time_offset( void );
|
|
||||||
int get_tris_or_culled( void ) { return(tris_or_culled); }
|
|
||||||
|
|
||||||
// Update functions
|
|
||||||
void set_hud_status( int status );
|
|
||||||
void set_fov( double amount );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
~fgOPTIONS( void );
|
|
||||||
|
|
||||||
|
double parse_time( const string& time_str );
|
||||||
|
double parse_degree( const string& degree_str );
|
||||||
|
int parse_time_offset( const string& time_str );
|
||||||
|
int parse_tile_radius( const string& arg );
|
||||||
|
int parse_flight_model( const string& fm );
|
||||||
|
double parse_fov( const string& arg );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -191,6 +175,15 @@ extern fgOPTIONS current_options;
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.16 1998/08/27 17:02:08 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
// Revision 1.15 1998/08/24 20:11:15 curt
|
// Revision 1.15 1998/08/24 20:11:15 curt
|
||||||
// Added i/I to toggle full vs. minimal HUD.
|
// Added i/I to toggle full vs. minimal HUD.
|
||||||
// Added a --hud-tris vs --hud-culled option.
|
// Added a --hud-tris vs --hud-culled option.
|
||||||
|
|
|
@ -50,7 +50,7 @@ static GLubyte *splash_texbuf;
|
||||||
|
|
||||||
// Initialize the splash screen
|
// Initialize the splash screen
|
||||||
void fgSplashInit ( void ) {
|
void fgSplashInit ( void ) {
|
||||||
char tpath[256], fg_tpath[256];
|
string tpath, fg_tpath;
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
fgPrintf( FG_GENERAL, FG_INFO, "Initializing splash screen\n");
|
fgPrintf( FG_GENERAL, FG_INFO, "Initializing splash screen\n");
|
||||||
|
@ -70,18 +70,19 @@ void fgSplashInit ( void ) {
|
||||||
xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
|
||||||
// load in the texture data
|
// load in the texture data
|
||||||
current_options.get_fg_root(tpath);
|
tpath = current_options.get_fg_root() + "/Textures/Splash2.rgb";
|
||||||
strcat(tpath, "/Textures/");
|
|
||||||
strcat(tpath, "Splash2.rgb");
|
|
||||||
|
|
||||||
if ( (splash_texbuf = read_rgb_texture(tpath, &width, &height)) == NULL ) {
|
if ( (splash_texbuf =
|
||||||
|
read_rgb_texture(tpath.c_str(), &width, &height)) == NULL )
|
||||||
|
{
|
||||||
// Try compressed
|
// Try compressed
|
||||||
strcpy(fg_tpath, tpath);
|
fg_tpath = tpath + ".gz";
|
||||||
strcat(fg_tpath, ".gz");
|
if ( (splash_texbuf =
|
||||||
if ( (splash_texbuf = read_rgb_texture(fg_tpath, &width, &height))
|
read_rgb_texture(fg_tpath.c_str(), &width, &height)) == NULL )
|
||||||
== NULL ) {
|
{
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT,
|
fgPrintf( FG_GENERAL, FG_EXIT,
|
||||||
"Error in loading splash screen texture %s\n", tpath );
|
"Error in loading splash screen texture %s\n",
|
||||||
|
tpath.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,6 +144,15 @@ void fgSplashUpdate ( double progress ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.4 1998/08/27 17:02:08 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
// Revision 1.3 1998/08/25 16:59:10 curt
|
// Revision 1.3 1998/08/25 16:59:10 curt
|
||||||
// Directory reshuffling.
|
// Directory reshuffling.
|
||||||
//
|
//
|
||||||
|
|
|
@ -75,7 +75,7 @@ fgMATERIAL_MGR::fgMATERIAL_MGR ( void ) {
|
||||||
int fgMATERIAL_MGR::load_lib ( void ) {
|
int fgMATERIAL_MGR::load_lib ( void ) {
|
||||||
fgMATERIAL m;
|
fgMATERIAL m;
|
||||||
char material_name[256];
|
char material_name[256];
|
||||||
char mpath[256], fg_mpath[256], tpath[256], fg_tpath[256];
|
string mpath, fg_mpath, tpath, fg_tpath;
|
||||||
char line[256], *line_ptr, value[256];
|
char line[256], *line_ptr, value[256];
|
||||||
GLubyte *texbuf;
|
GLubyte *texbuf;
|
||||||
fgFile f;
|
fgFile f;
|
||||||
|
@ -83,17 +83,15 @@ int fgMATERIAL_MGR::load_lib ( void ) {
|
||||||
int alpha;
|
int alpha;
|
||||||
|
|
||||||
// build the path name to the material db
|
// build the path name to the material db
|
||||||
current_options.get_fg_root(mpath);
|
mpath = current_options.get_fg_root() + "/materials";
|
||||||
strcat(mpath, "/");
|
fg_mpath = mpath + ".gz";
|
||||||
strcat(mpath, "materials");
|
|
||||||
strcpy(fg_mpath, mpath);
|
|
||||||
strcat(fg_mpath, ".gz");
|
|
||||||
|
|
||||||
// first try "path.gz"
|
// first try "path.gz"
|
||||||
if ( (f = fgopen(fg_mpath, "rb")) == NULL ) {
|
if ( (f = fgopen(fg_mpath.c_str(), "rb")) == NULL ) {
|
||||||
// next try "path"
|
// next try "path"
|
||||||
if ( (f = fgopen(mpath, "rb")) == NULL ) {
|
if ( (f = fgopen(mpath.c_str(), "rb")) == NULL ) {
|
||||||
fgPrintf(FG_GENERAL, FG_EXIT, "Cannot open file: %s\n", mpath);
|
fgPrintf( FG_GENERAL, FG_EXIT, "Cannot open file: %s\n",
|
||||||
|
mpath.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,24 +177,26 @@ int fgMATERIAL_MGR::load_lib ( void ) {
|
||||||
GL_LINEAR_MIPMAP_LINEAR ) ;
|
GL_LINEAR_MIPMAP_LINEAR ) ;
|
||||||
|
|
||||||
/* load in the texture data */
|
/* load in the texture data */
|
||||||
current_options.get_fg_root(tpath);
|
tpath = current_options.get_fg_root() + "/Textures/" +
|
||||||
strcat(tpath, "/Textures/");
|
m.texture_name + ".rgb";
|
||||||
strcat(tpath, m.texture_name);
|
fg_tpath = tpath + ".gz";
|
||||||
strcat(tpath, ".rgb");
|
|
||||||
|
|
||||||
if ( alpha == 0 ) {
|
if ( alpha == 0 ) {
|
||||||
// load rgb texture
|
// load rgb texture
|
||||||
|
|
||||||
// Try uncompressed
|
// Try uncompressed
|
||||||
if ( (texbuf = read_rgb_texture(tpath, &width, &height))
|
if ( (texbuf =
|
||||||
== NULL ) {
|
read_rgb_texture(tpath.c_str(), &width, &height)) ==
|
||||||
|
NULL )
|
||||||
|
{
|
||||||
// Try compressed
|
// Try compressed
|
||||||
strcpy(fg_tpath, tpath);
|
if ( (texbuf =
|
||||||
strcat(fg_tpath, ".gz");
|
read_rgb_texture(fg_tpath.c_str(), &width, &height))
|
||||||
if ( (texbuf = read_rgb_texture(fg_tpath, &width, &height))
|
== NULL )
|
||||||
== NULL ) {
|
{
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT,
|
fgPrintf( FG_GENERAL, FG_EXIT,
|
||||||
"Error in loading texture %s\n", tpath );
|
"Error in loading texture %s\n",
|
||||||
|
tpath.c_str() );
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,15 +210,18 @@ int fgMATERIAL_MGR::load_lib ( void ) {
|
||||||
// load rgba (alpha) texture
|
// load rgba (alpha) texture
|
||||||
|
|
||||||
// Try uncompressed
|
// Try uncompressed
|
||||||
if ( (texbuf = read_alpha_texture(tpath, &width, &height))
|
if ( (texbuf =
|
||||||
== NULL ) {
|
read_alpha_texture(tpath.c_str(), &width, &height))
|
||||||
|
== NULL )
|
||||||
|
{
|
||||||
// Try compressed
|
// Try compressed
|
||||||
strcpy(fg_tpath, tpath);
|
if ((texbuf =
|
||||||
strcat(fg_tpath, ".gz");
|
read_alpha_texture(fg_tpath.c_str(), &width, &height))
|
||||||
if ((texbuf = read_alpha_texture(fg_tpath, &width, &height))
|
== NULL )
|
||||||
== NULL ) {
|
{
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT,
|
fgPrintf( FG_GENERAL, FG_EXIT,
|
||||||
"Error in loading texture %s\n", tpath );
|
"Error in loading texture %s\n",
|
||||||
|
tpath.c_str() );
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,6 +306,15 @@ fgMATERIAL_MGR::~fgMATERIAL_MGR ( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.3 1998/08/27 17:02:09 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
// Revision 1.2 1998/08/25 20:53:33 curt
|
// Revision 1.2 1998/08/25 20:53:33 curt
|
||||||
// Shuffled $FG_ROOT file layout.
|
// Shuffled $FG_ROOT file layout.
|
||||||
//
|
//
|
||||||
|
|
|
@ -88,7 +88,7 @@ int fgTILECACHE::Exists( fgBUCKET *p ) {
|
||||||
|
|
||||||
// Fill in a tile cache entry with real data for the specified bucket
|
// Fill in a tile cache entry with real data for the specified bucket
|
||||||
void fgTILECACHE::EntryFillIn( int index, fgBUCKET *p ) {
|
void fgTILECACHE::EntryFillIn( int index, fgBUCKET *p ) {
|
||||||
char root[256];
|
string root;
|
||||||
char base_path[256];
|
char base_path[256];
|
||||||
char file_name[256];
|
char file_name[256];
|
||||||
|
|
||||||
|
@ -103,8 +103,8 @@ void fgTILECACHE::EntryFillIn( int index, fgBUCKET *p ) {
|
||||||
|
|
||||||
// Load the appropriate data file and built tile fragment list
|
// Load the appropriate data file and built tile fragment list
|
||||||
fgBucketGenBasePath(p, base_path);
|
fgBucketGenBasePath(p, base_path);
|
||||||
current_options.get_fg_root(root);
|
root = current_options.get_fg_root();
|
||||||
sprintf(file_name, "%s/Scenery/%s/%ld", root,
|
sprintf(file_name, "%s/Scenery/%s/%ld", root.c_str(),
|
||||||
base_path, fgBucketGenIndex(p));
|
base_path, fgBucketGenIndex(p));
|
||||||
fgObjLoad(file_name, &tile_cache[index]);
|
fgObjLoad(file_name, &tile_cache[index]);
|
||||||
/*
|
/*
|
||||||
|
@ -212,6 +212,15 @@ fgTILECACHE::~fgTILECACHE( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.15 1998/08/27 17:02:10 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
// Revision 1.14 1998/08/25 16:52:43 curt
|
// Revision 1.14 1998/08/25 16:52:43 curt
|
||||||
// material.cxx material.hxx obj.cxx obj.hxx texload.c texload.h moved to
|
// material.cxx material.hxx obj.cxx obj.hxx texload.c texload.h moved to
|
||||||
// ../Objects
|
// ../Objects
|
||||||
|
|
|
@ -60,31 +60,25 @@ fgLIGHT::fgLIGHT( void ) {
|
||||||
|
|
||||||
// initialize lighting tables
|
// initialize lighting tables
|
||||||
void fgLIGHT::Init( void ) {
|
void fgLIGHT::Init( void ) {
|
||||||
char path[256];
|
string path, ambient, diffuse, sky;
|
||||||
|
|
||||||
fgPrintf( FG_EVENT, FG_INFO,
|
fgPrintf( FG_EVENT, FG_INFO,
|
||||||
"Initializing Lighting interpolation tables.\n" );
|
"Initializing Lighting interpolation tables.\n" );
|
||||||
|
|
||||||
// build the path name to the ambient lookup table
|
// build the path name to the ambient lookup table
|
||||||
current_options.get_fg_root(path);
|
path = current_options.get_fg_root();
|
||||||
strcat(path, "/Lighting/");
|
ambient = path + "/Lighting/ambient";
|
||||||
strcat(path, "ambient");
|
diffuse = path + "/Lighting/diffuse";
|
||||||
// initialize ambient table
|
sky = path + "/Lighting/sky";
|
||||||
ambient_tbl = new fgINTERPTABLE(path);
|
|
||||||
|
// initialize ambient table
|
||||||
|
ambient_tbl = new fgINTERPTABLE((char *)ambient.c_str());
|
||||||
|
|
||||||
// build the path name to the diffuse lookup table
|
|
||||||
current_options.get_fg_root(path);
|
|
||||||
strcat(path, "/Lighting/");
|
|
||||||
strcat(path, "diffuse");
|
|
||||||
// initialize diffuse table
|
// initialize diffuse table
|
||||||
diffuse_tbl = new fgINTERPTABLE(path);
|
diffuse_tbl = new fgINTERPTABLE((char *)diffuse.c_str());
|
||||||
|
|
||||||
// build the path name to the sky lookup table
|
|
||||||
current_options.get_fg_root(path);
|
|
||||||
strcat(path, "/Lighting/");
|
|
||||||
strcat(path, "sky");
|
|
||||||
// initialize sky table
|
// initialize sky table
|
||||||
sky_tbl = new fgINTERPTABLE(path);
|
sky_tbl = new fgINTERPTABLE((char *)sky.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -227,6 +221,15 @@ void fgLightUpdate ( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.16 1998/08/27 17:02:11 curt
|
||||||
|
// Contributions from Bernie Bright <bbright@c031.aone.net.au>
|
||||||
|
// - use strings for fg_root and airport_id and added methods to return
|
||||||
|
// them as strings,
|
||||||
|
// - inlined all access methods,
|
||||||
|
// - made the parsing functions private methods,
|
||||||
|
// - deleted some unused functions.
|
||||||
|
// - propogated some of these changes out a bit further.
|
||||||
|
//
|
||||||
// Revision 1.15 1998/08/25 20:53:33 curt
|
// Revision 1.15 1998/08/25 20:53:33 curt
|
||||||
// Shuffled $FG_ROOT file layout.
|
// Shuffled $FG_ROOT file layout.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Reference in a new issue