#else
- in >> skipws;
+ in >> ::skipws;
while ( ! in.eof() ) {
char c = 0;
in.get(c);
} else {
in >> skipeol;
}
- in >> skipws;
+ in >> ::skipws;
}
#endif
#else
- in >> skipws;
+ in >> ::skipws;
while ( ! in.eof() ) {
char c = 0;
in.get(c);
} else {
in >> skipeol;
}
- in >> skipws;
+ in >> ::skipws;
}
#endif
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);
#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 "#"
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);
#include <string>
#include <iostream>
+using std::string;
+
void uiuc_warnings_errors(int errorCode, string line);
#endif //_WARNINGS_ERRORS_H_
//
// 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/";
//
// 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/";
//
// 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];
//
// 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)
// }
// 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 );
// $Id$
+#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/io/iochannel.hxx>
#include <simgear/math/fg_geodesy.hxx>
/* 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 */
/* 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;
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
/* 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 ) ) );
}
while ( ! in.eof() ) {
#endif
-#if defined( macintosh )
+#if defined( macintosh ) || defined( _MSC_VER )
in >> ::skipws;
#else
in >> skipws;
// 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;
// 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;