//
// $Id$
+#include <simgear/compiler.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#include <GL/glut.h>
#include <stdlib.h>
-#include <string.h>
-#include <fstream.h>
+#include STL_STRING
+#include STL_FSTREAM
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
// velocity vector
glBegin(GL_LINE_LOOP); // Use polygon to approximate a circle
for(count=0; count<50; count++) {
- cosine = 6 * cos(count * 2 * M_PI/50.0);
- sine = 6 * sin(count * 2 * M_PI/50.0);
+ cosine = 6 * cos(count * 2 * FG_PI/50.0);
+ sine = 6 * sin(count * 2 * FG_PI/50.0);
glVertex2f(cosine+vel_x, sine+vel_y);
}
glEnd();
&FGControls::get_rudder, &FGControls::set_rudder);
fgTie("/controls/flaps", this,
&FGControls::get_flaps, &FGControls::set_flaps);
- for (int index = 0; index < MAX_ENGINES; index++) {
+ int index;
+ for (index = 0; index < MAX_ENGINES; index++) {
char name[32];
sprintf(name, "/controls/throttle[%d]", index);
fgTie(name, this, index,
&FGControls::get_mixture, &FGControls::set_mixture);
fgTie("/controls/propellor-pitch/all", this, ALL_ENGINES,
&FGControls::get_prop_advance, &FGControls::set_prop_advance);
- for (int index = 0; index < MAX_WHEELS; index++) {
+ for (index = 0; index < MAX_WHEELS; index++) {
char name[32];
sprintf(name, "/controls/brakes[%d]", index);
fgTie(name, this, index,
fgUntie("/controls/elevator-trim");
fgUntie("/controls/rudder");
fgUntie("/controls/flaps");
- for (int index = 0; index < MAX_ENGINES; index++) {
+ int index;
+ for (index = 0; index < MAX_ENGINES; index++) {
char name[32];
sprintf(name, "/controls/throttle[%d]", index);
fgUntie(name);
sprintf(name, "/controls/propellor-pitch[%d]", index);
fgUntie(name);
}
- for (int index = 0; index < MAX_WHEELS; index++) {
+ for (index = 0; index < MAX_WHEELS; index++) {
char name[32];
sprintf(name, "/controls/brakes[%d]", index);
fgUntie(name);
}
- for ( int i = 0; i < multiloop; i++ ) {
+ for ( i = 0; i < multiloop; i++ ) {
fdmex->Run();
}
// set default log levels
fglog().setLogLevels( FG_ALL, FG_INFO );
+ string version;
+#ifdef FLIGHTGEAR_VERSION
+ version = FLIGHTGEAR_VERSION;
+#else
+ version = "unknown version";
+#endif
FG_LOG( FG_GENERAL, FG_INFO, "FlightGear: Version "
- << FLIGHTGEAR_VERSION << endl );
+ << version << endl );
// seed the random number generater
sg_srandom_time();
} else if ( arg.find( "--view-offset=" ) != string::npos ) {
string woffset = arg.substr( 14 );
if ( woffset == "LEFT" ) {
- default_view_offset = M_PI * 0.25;
+ default_view_offset = FG_PI * 0.25;
} else if ( woffset == "RIGHT" ) {
- default_view_offset = M_PI * 1.75;
+ default_view_offset = FG_PI * 1.75;
} else if ( woffset == "CENTER" ) {
default_view_offset = 0.00;
} else {
<< " texture coordinate arrays" );
for ( i = 0; i < (int)vec3_ptrs.size(); ++i ) {
-#ifdef macintosh
- delete [] vec3_ptrs[i];
+#if defined(macintosh) || defined(_MSC_VER)
+ delete [] vec3_ptrs[i]; //that's the correct version
#else
delete vec3_ptrs[i];
#endif
vec3_ptrs.clear();
for ( i = 0; i < (int)vec2_ptrs.size(); ++i ) {
-#ifdef macintosh
- delete [] vec2_ptrs[i];
+#if defined(macintosh) || defined(_MSC_VER)
+ delete [] vec2_ptrs[i]; //that's the correct version
#else
delete vec2_ptrs[i];
#endif