1
0
Fork 0

Borland C++ tweaks.

MacOS/Metrowerks tweaks.
Fix for fgText default constructor.
More ssg fiddling.
Fixed an include problem with client/server tile build tools.
This commit is contained in:
curt 1999-06-20 03:54:57 +00:00
parent bfe5df5f24
commit 3895c604ce
4 changed files with 34 additions and 16 deletions

View file

@ -27,6 +27,7 @@
#include <Include/compiler.h> #include <Include/compiler.h>
#include <Debug/logstream.hxx> #include <Debug/logstream.hxx>
#include <Misc/fgpath.hxx>
#include <Misc/fgstream.hxx> #include <Misc/fgstream.hxx>
#include <Main/options.hxx> #include <Main/options.hxx>
@ -46,13 +47,15 @@ int fgAIRPORTS::load( const string& file ) {
fgAIRPORT a; fgAIRPORT a;
// build the path name to the airport file // 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() ); airports.erase( airports.begin(), airports.end() );
fg_gzifstream in( path ); fg_gzifstream in( path.str() );
if ( !in ) { if ( !in.is_open() ) {
FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path ); FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path.str() );
exit(-1); exit(-1);
} }
@ -65,14 +68,29 @@ int fgAIRPORTS::load( const string& file ) {
*/ */
// read in each line of the file // read in each line of the file
#ifdef __MWERKS__
in >> skipcomment; in >> skipcomment;
while ( ! in.eof() ) char c = 0;
{ while ( in.get(c) && c != '\0' ) {
in.putback(c);
in >> a; in >> a;
airports.insert(a); airports.insert(a);
in >> skipcomment; in >> skipcomment;
} }
#else
in >> skipcomment;
while ( ! in.eof() ) {
in >> a;
airports.insert(a);
in >> skipcomment;
}
#endif
return 1; return 1;
} }

View file

@ -233,12 +233,9 @@ extern float HUD_matrix[16];
class fgText { class fgText {
private: private:
char msg[32];
float x, y; float x, y;
char msg[32];
public: 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 ) fgText( float x = 0, float y = 0, char *c = NULL )
: x(x), y(y) {strncpy(msg,c,32-1);} : 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 ) 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 ) int getStringWidth ( char *str )
{ {

View file

@ -395,7 +395,6 @@ static void fgRenderFrame( void ) {
xglEnable( GL_FOG ); xglEnable( GL_FOG );
// ssg test // ssg test
cout << "trying to draw ssg scene" << endl;
xglMatrixMode(GL_PROJECTION); xglMatrixMode(GL_PROJECTION);
xglLoadIdentity(); xglLoadIdentity();
@ -1067,8 +1066,8 @@ int main( int argc, char **argv ) {
// distribution) specifically from the ssg tux example // distribution) specifically from the ssg tux example
// //
ssgModelPath( "/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( "/h/curt/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; scene = new ssgRoot;
penguin = new ssgTransform; penguin = new ssgTransform;

View file

@ -614,6 +614,7 @@ void FGView::UpdateViewMath( FGInterface *f ) {
sgMultMat4( sgLARC_TO_SSG, mat1, mat2 ); sgMultMat4( sgLARC_TO_SSG, mat1, mat2 );
/*
cout << "LaRCsim to SSG:" << endl; cout << "LaRCsim to SSG:" << endl;
MAT3mat print; MAT3mat print;
int i; int i;
@ -624,6 +625,7 @@ void FGView::UpdateViewMath( FGInterface *f ) {
} }
} }
MAT3print( print, stdout); MAT3print( print, stdout);
*/
// code to calculate LOCAL matrix calculated from Phi, Theta, and // code to calculate LOCAL matrix calculated from Phi, Theta, and
// Psi (roll, pitch, yaw) in case we aren't running LaRCsim as our // 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 // Calculate the VIEW matrix
MAT3mult(VIEW, LOCAL, UP); MAT3mult(VIEW, LOCAL, UP);
cout << "VIEW matrix" << endl;; // cout << "VIEW matrix" << endl;;
MAT3print(VIEW, stdout); // MAT3print(VIEW, stdout);
sgMat4 sgTMP; sgMat4 sgTMP;
sgMultMat4( sgTMP, sgLOCAL, sgUP ); sgMultMat4( sgTMP, sgLOCAL, sgUP );
sgMultMat4( sgVIEW, sgLARC_TO_SSG, sgTMP ); sgMultMat4( sgVIEW, sgLARC_TO_SSG, sgTMP );
/*
cout << "FG derived VIEW matrix using sg routines" << endl; cout << "FG derived VIEW matrix using sg routines" << endl;
MAT3mat print; MAT3mat print;
int i; int i;
@ -753,6 +756,7 @@ void FGView::UpdateViewMath( FGInterface *f ) {
} }
} }
MAT3print( print, stdout); MAT3print( print, stdout);
*/
// generate the current up, forward, and fwrd-view vectors // generate the current up, forward, and fwrd-view vectors