]> git.mxchange.org Git - flightgear.git/commitdiff
Miscellaneous MSVC porting fixes by Christian Mayer.
authorcurt <curt>
Thu, 11 Jan 2001 05:04:17 +0000 (05:04 +0000)
committercurt <curt>
Thu, 11 Jan 2001 05:04:17 +0000 (05:04 +0000)
src/Cockpit/hud.cxx
src/Cockpit/hud_ladr.cxx
src/Controls/controls.cxx
src/FDM/JSBSim.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Scenery/tileentry.cxx

index 17082b83012973c67f0e0bde0586798113955245..65e00958c6f00634e29f67bd60b9f70909e78ad1 100644 (file)
@@ -20,6 +20,7 @@
 //
 // $Id$
 
+#include <simgear/compiler.h>
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
@@ -36,8 +37,8 @@
 
 #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>
index 081cb7c787f6938fb82b2dab78ecefdb212bce47..2e9524ac380205e879d2eeea612e711ec2d9e08c 100644 (file)
@@ -276,8 +276,8 @@ void HudLadder :: draw( void )
        //  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(); 
index d5152c739396c3b70a999705c3d30e8a96422128..97d6a8990c9ac774545187ee4a430d3085cfc3bb 100644 (file)
@@ -85,7 +85,8 @@ FGControls::bind ()
        &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,
@@ -103,7 +104,7 @@ FGControls::bind ()
        &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,
@@ -123,7 +124,8 @@ FGControls::unbind ()
   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);
@@ -132,7 +134,7 @@ FGControls::unbind ()
     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);
index 590ea136225138b0219b8cdaf6ec6309aa8f9dfa..9f072537719c6c957c562bb70470d901c0f95279 100644 (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();
     }
 
index 0b831e7302c487a1399b4b6ff8104551703425e8..309c1f9d23cd33bbf0927c3ff956086247b52fec 100644 (file)
@@ -1398,8 +1398,14 @@ int main( int argc, char **argv ) {
     // 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();
index 857a07b5677514e1618274a64e502b725b14517e..8cc96f04bc26bd0b6442f1d34958998fcda6a9a7 100644 (file)
@@ -929,9 +929,9 @@ int FGOptions::parse_option( const string& arg ) {
     } 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 {
index 5370d7858c1681ac8213302ba5621b6df75fa30c..dda39841a02fd9fdf261c19e3659b8aaabfff88d 100644 (file)
@@ -95,8 +95,8 @@ void FGTileEntry::free_tile() {
            << " 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
@@ -104,8 +104,8 @@ void FGTileEntry::free_tile() {
     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