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:
parent
bfe5df5f24
commit
3895c604ce
4 changed files with 34 additions and 16 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue