1
0
Fork 0

Changes to track Bernie's updates to fgstream.

This commit is contained in:
curt 1998-11-06 14:46:59 +00:00
parent 197b94fcf4
commit ad3ae51348
6 changed files with 53 additions and 36 deletions

View file

@ -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
//

View file

@ -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.
//

View file

@ -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.
//

View file

@ -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.

View file

@ -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.
//

View file

@ -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. :-(
//