MacOS/Metrowerks tweaks.
Fix for fgText default constructor.
#endif
+#include <math.h>
+
#include <Misc/fgpath.hxx>
#include "newbucket.hxx"
while ( in.get(c) ) {
#ifdef __MWERKS__
+
// -dw- for unix file compatibility
// -clo- this causes problems for unix
if ( (c == '\n') || (c == '\r') || (c == '\0') ) {
break;
- }
-#endif
+ }
+
+ if ( ! isspace( c ) && c != '\n' ) {
+ // put pack the non-space character
+ in.putback(c);
+ break;
+ }
+
+#else
if ( ! isspace( c ) ) {
// put pack the non-space character
in.putback(c);
break;
}
+
+#endif
+
}
return in;
}
#include <stdlib.h>
#include <string.h>
-#if !defined( __CYGWIN__ ) && !defined( __CYGWIN32__ )
+#if !defined( WIN32 )
# if !defined( HAVE_STL_SGI_PORT ) && !defined( __MWERKS__ )
// Avoid malloc with STLport and MSL
# include <malloc.h>
int xglTraceOn = TRUE ;
-#ifndef WIN32
- FILE *xglTraceFd = stdout ;
-#else /* WIN32 */
- /* Bail for now, we just want it to compile I guess */
- FILE *xglTraceFd = NULL;
-#endif /* WIN32 */
+FILE *xglTraceFd = NULL;
struct GLenumLookup
{
#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:
- // note to Norman from Curt. You had two constructors here that
- // have defaults values for all parameters. So, if a constructor
- // is called with no parameters, which is chosen? For the second,
- // I've removed the default value for x which fixes the problem.
- // However, it might be best to just delete the second redundant
- // constructor, and fix the constructor variable ordering
- // throughout the rest of the code.
- fgText( char *c = NULL, float x = 0, float y =0 )
- : x(x), y(y) {strncpy(msg,c,32-1);}
-
- fgText( float x, 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);}
fgText( const fgText & image )
}
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 )
{