1
0
Fork 0

Root path info moved to fgOPTIONS.

This commit is contained in:
curt 1998-05-13 18:25:34 +00:00
parent 143a8d7c6b
commit 37df3de51d
6 changed files with 57 additions and 40 deletions

View file

@ -32,7 +32,7 @@
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Include/general.h> #include <Main/options.hxx>
#include <Time/fg_time.hxx> #include <Time/fg_time.hxx>
#include "orbits.hxx" #include "orbits.hxx"
@ -113,7 +113,7 @@ int fgReadOrbElements(struct OrbElements *dest, FILE *src)
int fgSolarSystemInit(fgTIME t) int fgSolarSystemInit(fgTIME t)
{ {
fgGENERAL *g; fgOPTIONS *o;
char path[80]; char path[80];
int i; int i;
FILE *data; FILE *data;
@ -122,9 +122,9 @@ int fgSolarSystemInit(fgTIME t)
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 */
g = &general; o = &current_options;
path[0] = '\0'; path[0] = '\0';
strcat(path, g->root_dir); strcat(path, o->fg_root);
strcat(path, "/Scenery/"); strcat(path, "/Scenery/");
strcat(path, "Planets.dat"); strcat(path, "Planets.dat");
@ -170,9 +170,12 @@ void fgSolarSystemUpdate(struct OrbElements *planet, fgTIME t)
/* $Log$ /* $Log$
/* Revision 1.4 1998/04/28 01:19:00 curt /* Revision 1.5 1998/05/13 18:25:34 curt
/* Type-ified fgTIME and fgVIEW /* Root path info moved to fgOPTIONS.
/* /*
* Revision 1.4 1998/04/28 01:19:00 curt
* Type-ified fgTIME and fgVIEW
*
* Revision 1.3 1998/04/25 22:06:25 curt * Revision 1.3 1998/04/25 22:06:25 curt
* Edited cvs log messages in source files ... bad bad bad! * Edited cvs log messages in source files ... bad bad bad!
* *

View file

@ -43,7 +43,7 @@
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.h>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Include/general.h> #include <Main/options.hxx>
#include <Main/views.hxx> #include <Main/views.hxx>
#include <Time/fg_time.hxx> #include <Time/fg_time.hxx>
@ -63,7 +63,7 @@
/* Initialize the Star Management Subsystem */ /* Initialize the Star Management Subsystem */
int fgStarsInit( void ) { int fgStarsInit( void ) {
FILE *fd; FILE *fd;
fgGENERAL *g; fgOPTIONS *o;
/* struct CelestialCoord pltPos; */ /* struct CelestialCoord pltPos; */
char path[1024]; char path[1024];
char line[256], name[256]; char line[256], name[256];
@ -75,11 +75,11 @@ int fgStarsInit( void ) {
fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n"); fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n");
g = &general; o = &current_options;
/* build the full path name to the stars data base file */ /* build the full path name to the stars data base file */
path[0] = '\0'; path[0] = '\0';
strcat(path, g->root_dir); strcat(path, o->fg_root);
strcat(path, "/Scenery/"); strcat(path, "/Scenery/");
strcat(path, "Stars.dat"); strcat(path, "Stars.dat");
@ -260,9 +260,12 @@ void fgStarsRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.5 1998/04/28 01:19:03 curt /* Revision 1.6 1998/05/13 18:25:35 curt
/* Type-ified fgTIME and fgVIEW /* Root path info moved to fgOPTIONS.
/* /*
* Revision 1.5 1998/04/28 01:19:03 curt
* Type-ified fgTIME and fgVIEW
*
* Revision 1.4 1998/04/26 05:10:02 curt * Revision 1.4 1998/04/26 05:10:02 curt
* "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd. * "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
* *

View file

@ -28,8 +28,8 @@
#include <string.h> #include <string.h>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/general.h>
#include <Include/fg_zlib.h> #include <Include/fg_zlib.h>
#include <Main/options.hxx>
#include "airports.hxx" #include "airports.hxx"
@ -41,17 +41,17 @@ fgAIRPORTS::fgAIRPORTS( void ) {
// load the data // load the data
int fgAIRPORTS::load( char *file ) { int fgAIRPORTS::load( char *file ) {
fgGENERAL *g; fgOPTIONS *o;
char path[256], fgpath[256], line[256]; char path[256], fgpath[256], line[256];
char id[5]; char id[5];
double lon, lat, elev; double lon, lat, elev;
fgFile f; fgFile f;
g = &general; o = &current_options;
// build the path name to the ambient lookup table // build the path name to the ambient lookup table
path[0] = '\0'; path[0] = '\0';
strcat(path, g->root_dir); strcat(path, o->fg_root);
strcat(path, "/Scenery/"); strcat(path, "/Scenery/");
strcat(path, "Airports"); strcat(path, "Airports");
strcpy(fgpath, path); strcpy(fgpath, path);
@ -111,6 +111,9 @@ fgAIRPORTS::~fgAIRPORTS( void ) {
// $Log$ // $Log$
// Revision 1.4 1998/05/13 18:26:25 curt
// Root path info moved to fgOPTIONS.
//
// Revision 1.3 1998/05/06 03:16:24 curt // Revision 1.3 1998/05/06 03:16:24 curt
// Added an averaged global frame rate counter. // Added an averaged global frame rate counter.
// Added an option to control tile radius. // Added an option to control tile radius.

View file

@ -40,7 +40,7 @@
#include <string.h> #include <string.h>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/general.h> #include <Main/options.hxx>
#include <Scenery/obj.hxx> #include <Scenery/obj.hxx>
#include <Scenery/scenery.hxx> #include <Scenery/scenery.hxx>
#include <Scenery/texload.h> #include <Scenery/texload.h>
@ -56,12 +56,12 @@ struct fgSCENERY scenery;
/* Initialize the Scenery Management system */ /* Initialize the Scenery Management system */
int fgSceneryInit( void ) { int fgSceneryInit( void ) {
fgGENERAL *g; fgOPTIONS *o;
char path[1024], fgpath[1024]; char path[1024], fgpath[1024];
GLubyte *texbuf; GLubyte *texbuf;
int width, height; int width, height;
g = &general; o = &current_options;
fgPrintf(FG_TERRAIN, FG_INFO, "Initializing scenery subsystem\n"); fgPrintf(FG_TERRAIN, FG_INFO, "Initializing scenery subsystem\n");
@ -70,7 +70,7 @@ int fgSceneryInit( void ) {
/* temp: load in a demo texture */ /* temp: load in a demo texture */
path[0] = '\0'; path[0] = '\0';
strcat(path, g->root_dir); strcat(path, o->fg_root);
strcat(path, "/Textures/"); strcat(path, "/Textures/");
strcat(path, "desert.rgb"); strcat(path, "desert.rgb");
@ -96,18 +96,18 @@ int fgSceneryInit( void ) {
/* 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) {
fgGENERAL *g; fgOPTIONS *o;
double max_radius; double max_radius;
char path[1024]; char path[1024];
g = &general; o = &current_options;
/* a hardcoded hack follows */ /* a hardcoded hack follows */
/* this routine should parse the file, and make calls back to the /* this routine should parse the file, and make calls back to the
* scenery management system to build the appropriate structures */ * scenery management system to build the appropriate structures */
path[0] = '\0'; path[0] = '\0';
strcat(path, g->root_dir); strcat(path, o->fg_root);
strcat(path, "/Scenery/"); strcat(path, "/Scenery/");
strcat(path, "mesa-e.obj"); strcat(path, "mesa-e.obj");
@ -123,10 +123,13 @@ void fgSceneryRender( void ) {
/* $Log$ /* $Log$
/* Revision 1.3 1998/05/07 23:15:20 curt /* Revision 1.4 1998/05/13 18:26:40 curt
/* Fixed a glTexImage2D() usage bug where width and height were mis-swapped. /* Root path info moved to fgOPTIONS.
/* Added support for --tile-radius=n option.
/* /*
* Revision 1.3 1998/05/07 23:15:20 curt
* Fixed a glTexImage2D() usage bug where width and height were mis-swapped.
* Added support for --tile-radius=n option.
*
* Revision 1.2 1998/05/02 01:52:16 curt * Revision 1.2 1998/05/02 01:52:16 curt
* Playing around with texture coordinates. * Playing around with texture coordinates.
* *

View file

@ -35,10 +35,9 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Include/general.h>
#include <Bucket/bucketutils.h> #include <Bucket/bucketutils.h>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Main/options.hxx>
#include <Main/views.hxx> #include <Main/views.hxx>
#include "obj.hxx" #include "obj.hxx"
@ -85,11 +84,11 @@ int fgTileCacheExists( struct 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 fgTileCacheEntryFillIn( int index, struct fgBUCKET *p ) { void fgTileCacheEntryFillIn( int index, struct fgBUCKET *p ) {
fgGENERAL *g; fgOPTIONS *o;
char base_path[256]; char base_path[256];
char file_name[256]; char file_name[256];
g = &general; o = &current_options;
/* Mark this cache entry as used */ /* Mark this cache entry as used */
tile_cache[index].used = 1; tile_cache[index].used = 1;
@ -102,7 +101,7 @@ void fgTileCacheEntryFillIn( int index, struct fgBUCKET *p ) {
/* Load the appropriate area and get the display list pointer */ /* Load the appropriate area and get the display list pointer */
fgBucketGenBasePath(p, base_path); fgBucketGenBasePath(p, base_path);
sprintf(file_name, "%s/Scenery/%s/%ld", g->root_dir, sprintf(file_name, "%s/Scenery/%s/%ld", o->fg_root,
base_path, fgBucketGenIndex(p)); base_path, fgBucketGenIndex(p));
tile_cache[index].display_list = tile_cache[index].display_list =
fgObjLoad(file_name, &tile_cache[index].local_ref, fgObjLoad(file_name, &tile_cache[index].local_ref,
@ -200,9 +199,12 @@ int fgTileCacheNextAvail( void ) {
/* $Log$ /* $Log$
/* Revision 1.6 1998/05/02 01:52:17 curt /* Revision 1.7 1998/05/13 18:26:41 curt
/* Playing around with texture coordinates. /* Root path info moved to fgOPTIONS.
/* /*
* Revision 1.6 1998/05/02 01:52:17 curt
* Playing around with texture coordinates.
*
* Revision 1.5 1998/04/30 12:35:31 curt * Revision 1.5 1998/04/30 12:35:31 curt
* Added a command line rendering option specify smooth/flat shading. * Added a command line rendering option specify smooth/flat shading.
* *

View file

@ -37,7 +37,7 @@
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Include/general.h> #include <Main/options.hxx>
#include <Main/views.hxx> #include <Main/views.hxx>
#include <Math/fg_geodesy.h> #include <Math/fg_geodesy.h>
#include <Math/interpolater.hxx> #include <Math/interpolater.hxx>
@ -58,17 +58,17 @@ static fgINTERPTABLE *sky_tbl;
// initialize lighting tables // initialize lighting tables
void fgLightInit( void ) { void fgLightInit( void ) {
fgGENERAL *g; fgOPTIONS *o;
char path[256]; char path[256];
fgPrintf( FG_EVENT, FG_INFO, fgPrintf( FG_EVENT, FG_INFO,
"Initializing Lighting interpolation tables.\n" ); "Initializing Lighting interpolation tables.\n" );
g = &general; o = &current_options;
// build the path name to the ambient lookup table // build the path name to the ambient lookup table
path[0] = '\0'; path[0] = '\0';
strcat(path, g->root_dir); strcat(path, o->fg_root);
strcat(path, "/Scenery/"); strcat(path, "/Scenery/");
strcat(path, "Ambient.table"); strcat(path, "Ambient.table");
// initialize ambient table // initialize ambient table
@ -76,7 +76,7 @@ void fgLightInit( void ) {
// build the path name to the diffuse lookup table // build the path name to the diffuse lookup table
path[0] = '\0'; path[0] = '\0';
strcat(path, g->root_dir); strcat(path, o->fg_root);
strcat(path, "/Scenery/"); strcat(path, "/Scenery/");
strcat(path, "Diffuse.table"); strcat(path, "Diffuse.table");
// initialize diffuse table // initialize diffuse table
@ -84,7 +84,7 @@ void fgLightInit( void ) {
// build the path name to the sky lookup table // build the path name to the sky lookup table
path[0] = '\0'; path[0] = '\0';
strcat(path, g->root_dir); strcat(path, o->fg_root);
strcat(path, "/Scenery/"); strcat(path, "/Scenery/");
strcat(path, "Sky.table"); strcat(path, "Sky.table");
// initialize sky table // initialize sky table
@ -158,6 +158,9 @@ void fgLightUpdate( void ) {
// $Log$ // $Log$
// Revision 1.7 1998/05/13 18:26:50 curt
// Root path info moved to fgOPTIONS.
//
// Revision 1.6 1998/05/11 18:18:51 curt // Revision 1.6 1998/05/11 18:18:51 curt
// Made fog color slightly bluish. // Made fog color slightly bluish.
// //