1
0
Fork 0

Miscellaneous MSVC porting fixes by Christian Mayer.

This commit is contained in:
curt 2001-01-11 05:04:17 +00:00
parent dc7b762a12
commit cff0022a16
7 changed files with 25 additions and 16 deletions

View file

@ -20,6 +20,7 @@
// //
// $Id$ // $Id$
#include <simgear/compiler.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
@ -36,8 +37,8 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include STL_STRING
#include <fstream.h> #include STL_FSTREAM
#include <simgear/constants.h> #include <simgear/constants.h>
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>

View file

@ -276,8 +276,8 @@ void HudLadder :: draw( void )
// velocity vector // velocity vector
glBegin(GL_LINE_LOOP); // Use polygon to approximate a circle glBegin(GL_LINE_LOOP); // Use polygon to approximate a circle
for(count=0; count<50; count++) { for(count=0; count<50; count++) {
cosine = 6 * cos(count * 2 * M_PI/50.0); cosine = 6 * cos(count * 2 * FG_PI/50.0);
sine = 6 * sin(count * 2 * M_PI/50.0); sine = 6 * sin(count * 2 * FG_PI/50.0);
glVertex2f(cosine+vel_x, sine+vel_y); glVertex2f(cosine+vel_x, sine+vel_y);
} }
glEnd(); glEnd();

View file

@ -85,7 +85,8 @@ FGControls::bind ()
&FGControls::get_rudder, &FGControls::set_rudder); &FGControls::get_rudder, &FGControls::set_rudder);
fgTie("/controls/flaps", this, fgTie("/controls/flaps", this,
&FGControls::get_flaps, &FGControls::set_flaps); &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]; char name[32];
sprintf(name, "/controls/throttle[%d]", index); sprintf(name, "/controls/throttle[%d]", index);
fgTie(name, this, index, fgTie(name, this, index,
@ -103,7 +104,7 @@ FGControls::bind ()
&FGControls::get_mixture, &FGControls::set_mixture); &FGControls::get_mixture, &FGControls::set_mixture);
fgTie("/controls/propellor-pitch/all", this, ALL_ENGINES, fgTie("/controls/propellor-pitch/all", this, ALL_ENGINES,
&FGControls::get_prop_advance, &FGControls::set_prop_advance); &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]; char name[32];
sprintf(name, "/controls/brakes[%d]", index); sprintf(name, "/controls/brakes[%d]", index);
fgTie(name, this, index, fgTie(name, this, index,
@ -123,7 +124,8 @@ FGControls::unbind ()
fgUntie("/controls/elevator-trim"); fgUntie("/controls/elevator-trim");
fgUntie("/controls/rudder"); fgUntie("/controls/rudder");
fgUntie("/controls/flaps"); fgUntie("/controls/flaps");
for (int index = 0; index < MAX_ENGINES; index++) { int index;
for (index = 0; index < MAX_ENGINES; index++) {
char name[32]; char name[32];
sprintf(name, "/controls/throttle[%d]", index); sprintf(name, "/controls/throttle[%d]", index);
fgUntie(name); fgUntie(name);
@ -132,7 +134,7 @@ FGControls::unbind ()
sprintf(name, "/controls/propellor-pitch[%d]", index); sprintf(name, "/controls/propellor-pitch[%d]", index);
fgUntie(name); fgUntie(name);
} }
for (int index = 0; index < MAX_WHEELS; index++) { for (index = 0; index < MAX_WHEELS; index++) {
char name[32]; char name[32];
sprintf(name, "/controls/brakes[%d]", index); sprintf(name, "/controls/brakes[%d]", index);
fgUntie(name); fgUntie(name);

View file

@ -245,7 +245,7 @@ bool FGJSBsim::update( int multiloop ) {
} }
for ( int i = 0; i < multiloop; i++ ) { for ( i = 0; i < multiloop; i++ ) {
fdmex->Run(); fdmex->Run();
} }

View file

@ -1398,8 +1398,14 @@ int main( int argc, char **argv ) {
// set default log levels // set default log levels
fglog().setLogLevels( FG_ALL, FG_INFO ); 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 " FG_LOG( FG_GENERAL, FG_INFO, "FlightGear: Version "
<< FLIGHTGEAR_VERSION << endl ); << version << endl );
// seed the random number generater // seed the random number generater
sg_srandom_time(); sg_srandom_time();

View file

@ -929,9 +929,9 @@ int FGOptions::parse_option( const string& arg ) {
} else if ( arg.find( "--view-offset=" ) != string::npos ) { } else if ( arg.find( "--view-offset=" ) != string::npos ) {
string woffset = arg.substr( 14 ); string woffset = arg.substr( 14 );
if ( woffset == "LEFT" ) { if ( woffset == "LEFT" ) {
default_view_offset = M_PI * 0.25; default_view_offset = FG_PI * 0.25;
} else if ( woffset == "RIGHT" ) { } else if ( woffset == "RIGHT" ) {
default_view_offset = M_PI * 1.75; default_view_offset = FG_PI * 1.75;
} else if ( woffset == "CENTER" ) { } else if ( woffset == "CENTER" ) {
default_view_offset = 0.00; default_view_offset = 0.00;
} else { } else {

View file

@ -95,8 +95,8 @@ void FGTileEntry::free_tile() {
<< " texture coordinate arrays" ); << " texture coordinate arrays" );
for ( i = 0; i < (int)vec3_ptrs.size(); ++i ) { for ( i = 0; i < (int)vec3_ptrs.size(); ++i ) {
#ifdef macintosh #if defined(macintosh) || defined(_MSC_VER)
delete [] vec3_ptrs[i]; delete [] vec3_ptrs[i]; //that's the correct version
#else #else
delete vec3_ptrs[i]; delete vec3_ptrs[i];
#endif #endif
@ -104,8 +104,8 @@ void FGTileEntry::free_tile() {
vec3_ptrs.clear(); vec3_ptrs.clear();
for ( i = 0; i < (int)vec2_ptrs.size(); ++i ) { for ( i = 0; i < (int)vec2_ptrs.size(); ++i ) {
#ifdef macintosh #if defined(macintosh) || defined(_MSC_VER)
delete [] vec2_ptrs[i]; delete [] vec2_ptrs[i]; //that's the correct version
#else #else
delete vec2_ptrs[i]; delete vec2_ptrs[i];
#endif #endif