From ad3ae513488acc0364815218dbfd22dc13bf9eab Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 6 Nov 1998 14:46:59 +0000 Subject: [PATCH] Changes to track Bernie's updates to fgstream. --- Airports/genapt.cxx | 14 ++++++++------ Airports/simple.cxx | 9 ++++++--- Astro/stars.cxx | 9 ++++++--- Main/options.cxx | 9 ++++++--- Objects/material.cxx | 9 ++++++--- Objects/obj.cxx | 39 +++++++++++++++++++++------------------ 6 files changed, 53 insertions(+), 36 deletions(-) diff --git a/Airports/genapt.cxx b/Airports/genapt.cxx index 4b078d8a3..dd604a93f 100644 --- a/Airports/genapt.cxx +++ b/Airports/genapt.cxx @@ -219,10 +219,10 @@ fgAptGenerate(const string& path, fgTILE *tile) apt_id = ""; // read in each line of the file - in.eat_comments(); + in >> skipcomment; while ( ! in.eof() ) { - in.stream() >> token; + in >> token; if ( token == "a" ) { // airport info record (start of airport) @@ -234,7 +234,7 @@ fgAptGenerate(const string& path, fgTILE *tile) } cout << "Reading airport record\n"; - in.stream() >> apt_id; + in >> apt_id; apt_name = ""; i = 1; avex = avey = avez = 0.0; @@ -250,7 +250,7 @@ fgAptGenerate(const string& path, fgTILE *tile) // out of the base terrain. The points are given in // counter clockwise order and are specified in lon/lat // degrees. - in.stream() >> p; + in >> p; avex += tile->nodes[i][0]; avey += tile->nodes[i][1]; avez += tile->nodes[i][2]; @@ -262,8 +262,7 @@ fgAptGenerate(const string& path, fgTILE *tile) while ( in.get(c) && c != '\n' ); } - // airports.insert(a); - in.eat_comments(); + in >> skipcomment; } if ( apt_id != "" ) { @@ -282,6 +281,9 @@ fgAptGenerate(const string& path, fgTILE *tile) // $Log$ +// Revision 1.8 1998/11/06 14:46:59 curt +// Changes to track Bernie's updates to fgstream. +// // Revision 1.7 1998/10/20 18:26:06 curt // Updates to point3d.hxx // diff --git a/Airports/simple.cxx b/Airports/simple.cxx index 55578be67..978b45cd3 100644 --- a/Airports/simple.cxx +++ b/Airports/simple.cxx @@ -65,12 +65,12 @@ int fgAIRPORTS::load( const string& file ) { */ // read in each line of the file - in.eat_comments(); + in >> skipcomment; while ( ! in.eof() ) { - in.stream() >> a; + in >> a; airports.insert(a); - in.eat_comments(); + in >> skipcomment; } return 1; @@ -109,6 +109,9 @@ fgAIRPORTS::~fgAIRPORTS( void ) { // $Log$ +// Revision 1.8 1998/11/06 14:47:01 curt +// Changes to track Bernie's updates to fgstream. +// // Revision 1.7 1998/09/08 21:38:41 curt // Changes by Bernie Bright. // diff --git a/Astro/stars.cxx b/Astro/stars.cxx index 453b33aad..5fd7dd424 100644 --- a/Astro/stars.cxx +++ b/Astro/stars.cxx @@ -94,10 +94,10 @@ int fgStarsInit( void ) { // read in each line of the file while ( ! in.eof() && starcount < FG_MAX_STARS ) { - in.eat_comments(); + in >> skipcomment; string name; - getline( in.stream(), name, ',' ); - in.stream() >> starlist[starcount]; + getline( in, name, ',' ); + in >> starlist[starcount]; ++starcount; } @@ -252,6 +252,9 @@ void fgStarsRender( void ) { // $Log$ +// Revision 1.20 1998/11/06 14:47:02 curt +// Changes to track Bernie's updates to fgstream. +// // Revision 1.19 1998/10/16 23:27:21 curt // C++-ifying. // diff --git a/Main/options.cxx b/Main/options.cxx index 029525363..51bb598b2 100644 --- a/Main/options.cxx +++ b/Main/options.cxx @@ -477,18 +477,18 @@ int fgOPTIONS::parse_config_file( const string& path ) { fgPrintf( FG_GENERAL, FG_INFO, "Processing config file: %s\n", path.c_str() ); - in.eat_comments(); + in >> skipcomment; while ( !in.eof() ) { string line; - getline( in.stream(), line ); + getline( in, line ); if ( parse_option( line ) == FG_OPTIONS_ERROR ) { fgPrintf( FG_GENERAL, FG_EXIT, "Config file parse error: %s '%s'\n", path.c_str(), line.c_str() ); } - in.eat_comments(); + in >> skipcomment; } return FG_OPTIONS_OK; @@ -573,6 +573,9 @@ fgOPTIONS::~fgOPTIONS( void ) { // $Log$ +// Revision 1.28 1998/11/06 14:47:03 curt +// Changes to track Bernie's updates to fgstream. +// // Revision 1.27 1998/11/02 23:04:04 curt // HUD units now display in feet by default with meters being a command line // option. diff --git a/Objects/material.cxx b/Objects/material.cxx index d5210dc00..a2b66f90f 100644 --- a/Objects/material.cxx +++ b/Objects/material.cxx @@ -286,18 +286,18 @@ fgMATERIAL_MGR::load_lib ( void ) // printf("%s", line); // strip leading white space and comments - in.eat_comments(); + in >> skipcomment; // set to zero to prevent its value accidently being '{' // after a failed >> operation. char token = 0; - in.stream() >> material_name >> token; + in >> material_name >> token; if ( token == '{' ) { printf( " Loading material %s\n", material_name.c_str() ); fgMATERIAL m; - in.stream() >> m; + in >> m; if ( current_options.get_textures() ) { m.load_texture(); @@ -357,6 +357,9 @@ fgMATERIAL_MGR::render_fragments() // $Log$ +// Revision 1.9 1998/11/06 14:47:05 curt +// Changes to track Bernie's updates to fgstream. +// // Revision 1.8 1998/10/12 23:49:17 curt // Changes from NHV to make the code more dynamic with fewer hard coded limits. // diff --git a/Objects/obj.cxx b/Objects/obj.cxx index 35973ac05..6c1f43337 100644 --- a/Objects/obj.cxx +++ b/Objects/obj.cxx @@ -167,35 +167,35 @@ int fgObjLoad( const string& path, fgTILE *t) { stopwatch.start(); // ignore initial comments and blank lines. (priming the pump) - in.eat_comments(); + in >> skipcomment; while ( ! in.eof() ) { string token; - in.stream() >> token; + in >> token; // printf("token = %s\n", token.c_str() ); if ( token == "gbs" ) { // reference point (center offset) - in.stream() >> t->center >> t->bounding_radius; + in >> t->center >> t->bounding_radius; center = t->center; } else if ( token == "bs" ) { // reference point (center offset) - in.stream() >> fragment.center; - in.stream() >> fragment.bounding_radius; + in >> fragment.center; + in >> fragment.bounding_radius; } else if ( token == "vn" ) { // vertex normal if ( vncount < MAX_NODES ) { - in.stream() >> normals[vncount][0] - >> normals[vncount][1] - >> normals[vncount][2]; + in >> normals[vncount][0] + >> normals[vncount][1] + >> normals[vncount][2]; vncount++; } else { fgPrintf( FG_TERRAIN, FG_EXIT, @@ -206,9 +206,9 @@ int fgObjLoad( const string& path, fgTILE *t) { { // node (vertex) if ( t->ncount < MAX_NODES ) { - in.stream() >> t->nodes[t->ncount][0] - >> t->nodes[t->ncount][1] - >> t->nodes[t->ncount][2]; + in >> t->nodes[t->ncount][0] + >> t->nodes[t->ncount][1] + >> t->nodes[t->ncount][2]; t->ncount++; } else { fgPrintf( FG_TERRAIN, FG_EXIT, @@ -249,7 +249,7 @@ int fgObjLoad( const string& path, fgTILE *t) { // scan the material line string material; - in.stream() >> material; + in >> material; fragment.tile_ptr = t; // find this material in the properties list @@ -273,7 +273,7 @@ int fgObjLoad( const string& path, fgTILE *t) { n1 = n2 = n3 = n4 = 0; // fgPrintf( FG_TERRAIN, FG_DEBUG, " new tri strip = %s", line); - in.stream() >> n1 >> n2 >> n3; + in >> n1 >> n2 >> n3; fragment.add_face(n1, n2, n3); // fgPrintf( FG_TERRAIN, FG_DEBUG, "(t) = "); @@ -351,7 +351,7 @@ int fgObjLoad( const string& path, fgTILE *t) { if ( isdigit(c) ) { in.putback(c); - in.stream() >> n4; + in >> n4; break; } } @@ -389,7 +389,7 @@ int fgObjLoad( const string& path, fgTILE *t) { } // fgPrintf( FG_TERRAIN, FG_DEBUG, "new triangle = %s", line);*/ - in.stream() >> n1 >> n2 >> n3; + in >> n1 >> n2 >> n3; fragment.add_face(n1, n2, n3); // xglNormal3d(normals[n1][0], normals[n1][1], normals[n1][2]); @@ -419,7 +419,7 @@ int fgObjLoad( const string& path, fgTILE *t) { // fgPrintf( FG_TERRAIN, FG_DEBUG, "continued tri strip = %s ", // line); - in.stream() >> n1; + in >> n1; // There can be one or two values char c; @@ -431,7 +431,7 @@ int fgObjLoad( const string& path, fgTILE *t) { if ( isdigit(c) ) { in.putback(c); - in.stream() >> n2; + in >> n2; break; } } @@ -511,7 +511,7 @@ int fgObjLoad( const string& path, fgTILE *t) { // eat comments and blank lines before start of while loop so // if we are done with useful input it is noticed before hand. - in.eat_comments(); + in >> skipcomment; } if ( in_fragment ) { @@ -553,6 +553,9 @@ int fgObjLoad( const string& path, fgTILE *t) { // $Log$ +// Revision 1.9 1998/11/06 14:47:06 curt +// Changes to track Bernie's updates to fgstream. +// // Revision 1.8 1998/10/20 18:33:55 curt // Tweaked texture coordinates, but we still have some problems. :-( //