]> git.mxchange.org Git - flightgear.git/commitdiff
Borland C++ tweaks.
authorcurt <curt>
Sun, 20 Jun 1999 03:54:57 +0000 (03:54 +0000)
committercurt <curt>
Sun, 20 Jun 1999 03:54:57 +0000 (03:54 +0000)
MacOS/Metrowerks tweaks.
Fix for fgText default constructor.
More ssg fiddling.
Fixed an include problem with client/server tile build tools.

src/Airports/simple.cxx
src/Cockpit/hud.hxx
src/Main/main.cxx
src/Main/views.cxx

index 1e5d9a6940f87eb6b76e4acf03e6c02c9414b7e4..f9411a198979d34005cc48ea2bb8dee7521699bd 100644 (file)
@@ -27,6 +27,7 @@
 #include <Include/compiler.h>
 
 #include <Debug/logstream.hxx>
+#include <Misc/fgpath.hxx>
 #include <Misc/fgstream.hxx>
 #include <Main/options.hxx>
 
@@ -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;
 }
 
index e262456424cce507ddbf7f7058b478cca6d0ed80..079139e29a06116b10af2c136b06caa9ca57aaf8 100644 (file)
@@ -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 )
     {
index 719c1442c35152d8ef192cfe4542cafc2fd308a5..d6f1ec88b555f5b1cf5d637303aa45b447591222 100644 (file)
@@ -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;
index 98c9b53cd52aa5e546d21187319573aa4c7946bc..b8cd9ce603ed37c593792afd78edbb9955d52417 100644 (file)
@@ -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