MacOS/Metrowerks tweaks.
Fix for fgText default constructor.
More ssg fiddling.
Fixed an include problem with client/server tile build tools.
#include <Include/compiler.h>
#include <Debug/logstream.hxx>
+#include <Misc/fgpath.hxx>
#include <Misc/fgstream.hxx>
#include <Main/options.hxx>
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);
}
*/
// 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;
}
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);}
}
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 )
{
xglEnable( GL_FOG );
// ssg test
- cout << "trying to draw ssg scene" << endl;
xglMatrixMode(GL_PROJECTION);
xglLoadIdentity();
// 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;
sgMultMat4( sgLARC_TO_SSG, mat1, mat2 );
+ /*
cout << "LaRCsim to SSG:" << endl;
MAT3mat print;
int i;
}
}
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
// 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;
}
}
MAT3print( print, stdout);
+ */
// generate the current up, forward, and fwrd-view vectors