]> git.mxchange.org Git - flightgear.git/commitdiff
Fixes for MSVC++ issues.
authorcurt <curt>
Thu, 21 Sep 2000 22:59:27 +0000 (22:59 +0000)
committercurt <curt>
Thu, 21 Sep 2000 22:59:27 +0000 (22:59 +0000)
src/Airports/runways.cxx
src/Airports/simple.cxx
src/Cockpit/sp_panel.cxx
src/FDM/UIUCModel/uiuc_parsefile.h
src/FDM/UIUCModel/uiuc_recorder.cpp
src/FDM/UIUCModel/uiuc_warnings_errors.h
src/Joystick/joystick.cxx
src/Main/main.cxx
src/Network/ray.cxx
src/Objects/obj.cxx

index 4bd1ece87d42926fad0568492383d6cfc24a3d24..85639eb0ed001acee7dcb3dc8cadc03ee3be5266 100644 (file)
@@ -207,7 +207,7 @@ int FGRunwaysUtil::load( const string& file ) {
 
 #else
 
-    in >> skipws;
+    in >> ::skipws;
     while ( ! in.eof() ) {
        char c = 0;
        in.get(c);
@@ -222,7 +222,7 @@ int FGRunwaysUtil::load( const string& file ) {
        } else {
            in >> skipeol;
        }
-       in >> skipws;
+       in >> ::skipws;
     }
 
 #endif
index 6915132c72d84dc3ccfde2669c2f56f234842f3a..6c0911a0c906d1a502267ba4cb4d437e26d7efb9 100644 (file)
@@ -151,7 +151,7 @@ int FGAirportsUtil::load( const string& file ) {
 
 #else
 
-    in >> skipws;
+    in >> ::skipws;
     while ( ! in.eof() ) {
        char c = 0;
        in.get(c);
@@ -165,7 +165,7 @@ int FGAirportsUtil::load( const string& file ) {
        } else {
            in >> skipeol;
        }
-       in >> skipws;
+       in >> ::skipws;
     }
 
 #endif
index 89e32248d27098bae834a47db5705bd9f486751e..172c099945c6817aee7115a8c3b205a8d1226f1c 100644 (file)
@@ -1020,11 +1020,12 @@ fgCreateSmallSinglePropPanel (int xpos, int ypos, int finx, int finy)
     FGLayeredInstrument * inst =
       new FGLayeredInstrument(gauge.x, gauge.y, gauge.w, gauge.h);
 
-    for (int j = 0; gauge.actions[j]; j++) {
+    int j;
+    for (j = 0; gauge.actions[j]; j++) {
       inst->addAction(gauge.actions[j]);
     }
 
-    for (int j = 0; gauge.layers[j].layer; j++) {
+    for (j = 0; gauge.layers[j].layer; j++) {
       LayerData &layer = gauge.layers[j];
 //       inst->addLayer(tex[layer.textureName], layer.w, layer.h);
       inst->addLayer(layer.layer);
index 09752146cf78fa34668d0ba1f898406e388d9b67..8d831cba5658674d43154581be647e027b3c4693 100644 (file)
@@ -5,6 +5,12 @@
 #include <list>
 #include <fstream>
 
+#include <simgear/compiler.h>
+
+FG_USING_STD(list);
+FG_USING_STD(string);
+FG_USING_STD(ifstream);
+
 #define DELIMITERS " \t"
 #define COMMENT "#"
 
index 4c1e316d030eead51418ef2eddeb41545162ec1a..f5a5998cfe48ac00df8a259abf72e284394ebdc9 100644 (file)
@@ -87,11 +87,12 @@ void uiuc_recorder( double dt )
       command_list = recordParts->getCommands();
       fout << endl;
 
-      for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
+      LIST command_line;
+      for (command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
         record_variables += recordParts->getToken(*command_line,2) + "  ";
 
       fout << record_variables << endl; 
-      for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
+      for (command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
         {
           linetoken = recordParts->getToken(*command_line, 2); 
 
index 80cb9eaad08db3532cbad34316859ef118b9669f..5977b2faa5835376dc7ef3091aeb10bbca031402 100644 (file)
@@ -4,6 +4,8 @@
 #include <string>
 #include <iostream>
 
+using std::string;
+
 void uiuc_warnings_errors(int errorCode, string line);
 
 #endif  //_WARNINGS_ERRORS_H_
index 279632abb5cc083bd56d06608b9512101c03faaa..76f2f636a991f2c1d17ae251fa92c544bc4fd951 100644 (file)
@@ -275,7 +275,8 @@ fgJoystickInit()
        //
        // Initialize the axes.
        //
-       for (int j = 0; j < naxes; j++) {
+       int j;
+       for (j = 0; j < naxes; j++) {
            axis &a = joysticks[i].axes[j];
 
            string base = "/input/";
@@ -368,7 +369,7 @@ fgJoystickInit()
        //
        // Initialize the buttons.
        //
-       for (int j = 0; j < nbuttons; j++) {
+       for (j = 0; j < nbuttons; j++) {
            button &b = joysticks[i].buttons[j];
       
            string base = "/input/";
@@ -472,7 +473,8 @@ fgJoystickRead()
        //
        // Axes
        //
-       for (int j = 0; j < joysticks[i].naxes; j++) {
+       int j;
+       for (j = 0; j < joysticks[i].naxes; j++) {
            bool flag = true;
            axis &a = joysticks[i].axes[j];
 
@@ -494,7 +496,7 @@ fgJoystickRead()
        //
        // Buttons
        //
-       for (int j = 0; j < joysticks[i].nbuttons; j++) {
+       for (j = 0; j < joysticks[i].nbuttons; j++) {
            bool flag;
            button &b = joysticks[i].buttons[j];
            if (b.value == 0)
index c577ba9ce1ad64c5a6335a297f8a5ae3bbcf44fe..a27c142ec5ed75397ed4bee7bbbb9b756c09bfa4 100644 (file)
@@ -945,8 +945,10 @@ static void fgMainLoop( void ) {
        // }
        // fprintf(stderr, "pitch4: %f\n", pitch);
 
-       double volume = controls.get_throttle(0) * 1.15 + 0.3 +
+       double volume = controls.get_throttle(0) * 0.1 + 0.3 +
            log(cur_fdm_state->get_V_calibrated_kts() * kts_to_fts + 1.0)/14.0;
+       if ( volume > 1.0 ) { volume = 1.0; }
+
        // fprintf(stderr, "volume: %f\n", volume);
 
        pitch_envelope.setStep  ( 0, 0.01, pitch );
index 0173f927579dbb180c28e63097bcb27920ae2a5b..1d471972d39239dd642eec264a4412d67aea9bf9 100644 (file)
@@ -21,6 +21,7 @@
 // $Id$
 
 
+#include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/io/iochannel.hxx>
 #include <simgear/math/fg_geodesy.hxx>
@@ -104,11 +105,11 @@ bool FGRAY::gen_message() {
        /* Make sure the angles are reasonable onscale */
        /* We use an asymmetric mapping so that the chair behaves
           reasonably when upside down.  Otherwise it oscillates. */
-       while ( ang_pos < -2*M_PI/3 ) {
-               ang_pos += 2 * M_PI;
+       while ( ang_pos < -2*FG_PI/3 ) {
+               ang_pos += 2 * FG_PI;
        }
-       while ( ang_pos >  4*M_PI/3 ) {
-               ang_pos -= 2 * M_PI;
+       while ( ang_pos >  4*FG_PI/3 ) {
+               ang_pos -= 2 * FG_PI;
        }
 
        /* Tell interested parties what the situation is */
@@ -131,11 +132,11 @@ bool FGRAY::gen_message() {
 
        /* yaw */
                /* Make sure that we walk through North cleanly */
-               if ( fabs ( ang_pos - chair_heading ) > M_PI )
+               if ( fabs ( ang_pos - chair_heading ) > FG_PI )
                {       /* Need to swing chair by 360 degrees */
                        if ( ang_pos < chair_heading )
-                               chair_heading -= 2 * M_PI;
-                       else    chair_heading += 2 * M_PI;
+                               chair_heading -= 2 * FG_PI;
+                       else    chair_heading += 2 * FG_PI;
                }
                /* Remove the chair heading from the true heading */
                ang_pos -= chair_heading;
@@ -144,7 +145,7 @@ bool FGRAY::gen_message() {
                   can just about represent 30 degrees full scale.  */
                chair_heading += ang_pos * dt * 0.2;
                /* If they turn fast, at 90 deg error subtract 30 deg */
-               if ( fabs(ang_pos) > M_PI / 2 )
+               if ( fabs(ang_pos) > FG_PI / 2 )
                        chair_heading += ang_pos / 3;
 
        } else
@@ -178,8 +179,8 @@ bool FGRAY::gen_message() {
                /* Scale to the hardware's full scale range */
                propose /= fullscale [ subaxis ];
                /* Use a sine shaped washout on all axes */
-               if ( propose < -M_PI / 2 ) *dac = 0x0000; else
-               if ( propose >  M_PI / 2 ) *dac = 0xFFFF; else
+               if ( propose < -FG_PI / 2 ) *dac = 0x0000; else
+               if ( propose >  FG_PI / 2 ) *dac = 0xFFFF; else
                   *dac = (unsigned short) ( 32767 * 
                                ( 1.0 + sin ( propose ) ) );
        }
index 2f7cef034e3c53ab4655e2ccf45183b0702ec221..8db9e1e828b8fe4599cad802ee9188d56676efb6 100644 (file)
@@ -338,7 +338,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t, const bool is_base) {
     while ( ! in.eof() ) {
 #endif
 
-#if defined( macintosh )
+#if defined( macintosh ) || defined( _MSC_VER )
        in >> ::skipws;
 #else
        in >> skipws;
@@ -572,7 +572,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t, const bool is_base) {
                
                // read all subsequent numbers until next thing isn't a number
                while ( true ) {
-#if defined( macintosh )
+#if defined( macintosh ) || defined( _MSC_VER )
                    in >> ::skipws;
 #else
                    in >> skipws;
@@ -673,7 +673,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t, const bool is_base) {
 
            // eat white space before start of while loop so if we are
            // done with useful input it is noticed before hand.
-#if defined( macintosh )
+#if defined( macintosh ) || defined( _MSC_VER )
            in >> ::skipws;
 #else
            in >> skipws;