diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 1e5d9a694..f9411a198 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -27,6 +27,7 @@ #include #include +#include #include #include
@@ -46,13 +47,15 @@ int fgAIRPORTS::load( const string& file ) { fgAIRPORT a; // build the path name to the airport file - string path = current_options.get_fg_root() + "/Airports/" + file; + FGPath path( current_options.get_fg_root() ); + path.append( "Airports" ); + path.append( file ); airports.erase( airports.begin(), airports.end() ); - fg_gzifstream in( path ); - if ( !in ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path ); + fg_gzifstream in( path.str() ); + if ( !in.is_open() ) { + FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path.str() ); exit(-1); } @@ -65,14 +68,29 @@ int fgAIRPORTS::load( const string& file ) { */ // read in each line of the file + +#ifdef __MWERKS__ + in >> skipcomment; - while ( ! in.eof() ) - { + char c = 0; + while ( in.get(c) && c != '\0' ) { + in.putback(c); in >> a; airports.insert(a); in >> skipcomment; } +#else + + in >> skipcomment; + while ( ! in.eof() ) { + in >> a; + airports.insert(a); + in >> skipcomment; + } + +#endif + return 1; } diff --git a/src/Cockpit/hud.hxx b/src/Cockpit/hud.hxx index e26245642..079139e29 100644 --- a/src/Cockpit/hud.hxx +++ b/src/Cockpit/hud.hxx @@ -233,12 +233,9 @@ extern float HUD_matrix[16]; class fgText { private: - char msg[32]; float x, y; + char msg[32]; public: - fgText( char *c = NULL, float x = 0, float y =0 ) - : x(x), y(y) {strncpy(msg,c,32-1);} - fgText( float x = 0, float y = 0, char *c = NULL ) : x(x), y(y) {strncpy(msg,c,32-1);} @@ -434,7 +431,7 @@ class instr_item { // An Abstract Base Class (ABC) } void TextString( char *msg, float x, float y ) { - HUD_TextList.add(fgText(msg, x, y)); + HUD_TextList.add(fgText(x, y, msg)); } int getStringWidth ( char *str ) { diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 719c1442c..d6f1ec88b 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -395,7 +395,6 @@ static void fgRenderFrame( void ) { xglEnable( GL_FOG ); // ssg test - cout << "trying to draw ssg scene" << endl; xglMatrixMode(GL_PROJECTION); xglLoadIdentity(); @@ -1067,8 +1066,8 @@ int main( int argc, char **argv ) { // distribution) specifically from the ssg tux example // - ssgModelPath( "/h/curt/src/Libs/plib-1.0.12/examples/ssg/tux/data/" ); - ssgTexturePath( "/h/curt/src/Libs/plib-1.0.12/examples/ssg/tux/data/" ); + ssgModelPath( "/stage/pinky01/src/Libs/plib-1.0.12/examples/ssg/tux/data/" ); + ssgTexturePath( "/stage/pinky01/src/Libs/plib-1.0.12/examples/ssg/tux/data/" ); scene = new ssgRoot; penguin = new ssgTransform; diff --git a/src/Main/views.cxx b/src/Main/views.cxx index 98c9b53cd..b8cd9ce60 100644 --- a/src/Main/views.cxx +++ b/src/Main/views.cxx @@ -614,6 +614,7 @@ void FGView::UpdateViewMath( FGInterface *f ) { sgMultMat4( sgLARC_TO_SSG, mat1, mat2 ); + /* cout << "LaRCsim to SSG:" << endl; MAT3mat print; int i; @@ -624,6 +625,7 @@ void FGView::UpdateViewMath( FGInterface *f ) { } } MAT3print( print, stdout); + */ // code to calculate LOCAL matrix calculated from Phi, Theta, and // Psi (roll, pitch, yaw) in case we aren't running LaRCsim as our @@ -736,13 +738,14 @@ void FGView::UpdateViewMath( FGInterface *f ) { // Calculate the VIEW matrix MAT3mult(VIEW, LOCAL, UP); - cout << "VIEW matrix" << endl;; - MAT3print(VIEW, stdout); + // cout << "VIEW matrix" << endl;; + // MAT3print(VIEW, stdout); sgMat4 sgTMP; sgMultMat4( sgTMP, sgLOCAL, sgUP ); sgMultMat4( sgVIEW, sgLARC_TO_SSG, sgTMP ); + /* cout << "FG derived VIEW matrix using sg routines" << endl; MAT3mat print; int i; @@ -753,6 +756,7 @@ void FGView::UpdateViewMath( FGInterface *f ) { } } MAT3print( print, stdout); + */ // generate the current up, forward, and fwrd-view vectors