public:
FGTurnCoordinator (float inXPos, float inYPos);
- virtual FGTurnCoordinator::~FGTurnCoordinator (void);
+ virtual ~FGTurnCoordinator (void);
virtual void Init (void);
virtual void Render(void);
INCLUDES
*******************************************************************************/
-#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/stat.h>
#ifdef FGFS
# ifndef __BORLANDC__
string holding_string;
char scratch[128];
ifstream coeffInFile;
- streampos gpos;
+ streampos gpos(0);
int axis;
string axis_descript;
bool readAeroRp=false;
axis = -1;
+#ifdef MACOS
+ aircraftDef = aircraft_path + ":" + fname + ":" + fname + ".cfg";
+#else
aircraftDef = aircraft_path + "/" + fname + "/" + fname + ".cfg";
+#endif
ifstream aircraftfile(aircraftDef.c_str());
cout << "Reading Aircraft Configuration File: " << aircraftDef << endl;
// Output->SocketStatusOutput("Reading Aircraft Configuration File: " + aircraftDef);
while (!aircraftfile.fail()) {
holding_string.erase();
aircraftfile >> holding_string;
-#if defined(__BORLANDC__) || defined(FG_HAVE_NATIVE_SGI_COMPILERS) || defined(_MSC_VER)
+#if defined(__BORLANDC__) || defined(FG_HAVE_NATIVE_SGI_COMPILERS) || defined(_MSC_VER) || defined(__MWERKS__)
if (holding_string.compare(0, 2, "//") != 0) {
#else
if (holding_string.compare("//",0,2) != 0) {
Output = FDMExec->GetOutput();
Name = engineName;
+#ifdef MACOS
+ fullpath = enginePath + ":" + engineName + ".dat";
+#else
fullpath = enginePath + "/" + engineName + ".dat";
+#endif
ifstream enginefile(fullpath.c_str());
if (enginefile) {
class FGFDMExec
{
public:
- FGFDMExec::FGFDMExec(void);
- FGFDMExec::~FGFDMExec(void);
+ FGFDMExec(void);
+ ~FGFDMExec(void);
FGModel* FirstModel;
{
string asciiData;
+#ifdef MACOS
+ if (socket == 0) return;
+#else
if (socket <= 0) return;
+#endif
socket->Clear();
if (sFirstPass) {
{
size = 0;
- #ifdef __BORLANDC__ || _MSC_VER
+ #if defined( __BORLANDC__ ) || defined( _MSC_VER )
WSADATA wsaData;
int PASCAL FAR wsaReturnCode;
wsaReturnCode = WSAStartup(MAKEWORD(1,1), &wsaData);
}
}
+#ifdef MACOS
+/* commented out destructor method. shutdown method needs to link when
+ we don't have networking enabled */
+#else
FGfdmSocket::~FGfdmSocket(void)
{
if (sckt) shutdown(sckt,2);
WSACleanup();
#endif
}
+#endif
void FGfdmSocket::Clear(void)
{
string line;
#ifdef GETLINE_NEEDS_TERMINATOR
- getline( in, line, '\n' );
+ getline( in, line, '\n' );
+#elif defined (MACOS)
+ getline( in, line, '\r' );
#else
- getline( in, line );
+ getline( in, line );
#endif
if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
while ( ! in.eof() ) {
in >> token;
in >> name;
+#ifdef MACOS
+ in >> ::skipws;
+#else
in >> skipws;
+#endif
cout << "token = " << token << " name = " << name << endl;
FGPath custom_path = tile_path;
<< " texture coordinate arrays" );
for ( i = 0; i < (int)vec3_ptrs.size(); ++i ) {
+#ifdef MACOS
+ delete [] vec3_ptrs[i];
+#else
delete vec3_ptrs[i];
+#endif
}
vec3_ptrs.clear();
for ( i = 0; i < (int)vec2_ptrs.size(); ++i ) {
+#ifdef MACOS
+ delete [] vec2_ptrs[i];
+#else
delete vec2_ptrs[i];
+#endif
}
vec2_ptrs.clear();
{
// cout << "sgLOS hit: " << result[0] << ","
// << result[1] << "," << result[2] << endl;
- hit_pts[hitcount] = result;
+ for (int i=0; i < 3; i++) {
+ hit_pts[hitcount][i] = result[i];
+ }
hitcount++;
}
}
/* User specified the empty string; use UTC explicitly. */
tz = "Universal";
+#ifdef MACOS
+ /* as you well know, mac paths contain leading colon, this code
+ messes things up.... */
+#else
/* A leading colon means "implementation defined syntax".
We ignore the colon and always use the same algorithm:
try a data file, and if none exists parse the 1003.1 syntax. */
if (tz && *tz == ':')
++tz;
+#endif
/* Check whether the value changes since the last run. */
if (old_fgtz != NULL && tz != NULL && strcmp (tz, old_fgtz) == 0)
return FGPhysicalProperty(database->Evaluate(p), p[3]);
}
+#ifdef MACOS
+ /* fix a problem with mw compilers in that they don't know the
+ difference between the next two methods. Since the first one
+ doesn't seem to be used anywhere, I commented it out. This is
+ supposed to be fixed in the forthcoming CodeWarrior Release
+ 6. */
+#else
FGPhysicalProperties FGLocalWeatherDatabase::get(const sgVec2& p) const
{
return database->Evaluate(p);
}
+#endif
WeatherPrecision FGLocalWeatherDatabase::getAirDensity(const sgVec3& p) const
{
/************************************************************************/
/* Get the physical properties on the specified point p */
/************************************************************************/
+#ifdef MACOS
+ /* fix a problem with mw compilers in that they don't know the
+ difference between the next two methods. Since the first one
+ doesn't seem to be used anywhere, I commented it out. This is
+ supposed to be fixed in the forthcoming CodeWarrior Release
+ 6. */
+#else
FGPhysicalProperties get(const sgVec2& p) const;
+#endif
FGPhysicalProperty get(const sgVec3& p) const;
WeatherPrecision getAirDensity(const sgVec3& p) const;
return *this;
}
+// slightly modified version that also makes the Mac happy
+inline FGPhysicalProperties& FGPhysicalProperties::operator -= (const FGPhysicalProperties& p)
+{
+ typedef map<FGPhysicalProperties::Altitude, FGWindItem>::const_iterator wind_iterator;
+ typedef map<FGPhysicalProperties::Altitude, FGTurbulenceItem>::const_iterator turbulence_iterator;
+ typedef map<FGPhysicalProperties::Altitude, WeatherPrecision>::const_iterator scalar_iterator;
+
+ // types to replace make_pair
+ typedef map<FGPhysicalProperties::Altitude, FGWindItem>::value_type wind_type;
+ typedef map<FGPhysicalProperties::Altitude, FGTurbulenceItem>::value_type turb_type;
+ typedef map<FGPhysicalProperties::Altitude, WeatherPrecision>::value_type weather_type;
+
+ for (wind_iterator WindIt = p.Wind.begin();
+ WindIt != p.Wind.end();
+ WindIt++)
+ if (!Wind.insert( wind_type(WindIt->first, -WindIt->second) ).second)
+ // when it's not inserted => it's already existing
+ Wind[WindIt->first] -= WindIt->second; //=> substract the value
+
+ for (turbulence_iterator TurbulenceIt = p.Turbulence.begin();
+ TurbulenceIt != p.Turbulence.end();
+ TurbulenceIt++)
+ if (!Turbulence.insert( turb_type(TurbulenceIt->first, -TurbulenceIt->second) ).second)
+ Turbulence[TurbulenceIt->first] -= TurbulenceIt->second;
+
+ for (scalar_iterator TemperatureIt = p.Temperature.begin();
+ TemperatureIt != p.Temperature.end();
+ TemperatureIt++)
+ if (!Temperature.insert( weather_type(TemperatureIt->first, -TemperatureIt->second) ).second)
+ Temperature[TemperatureIt->first] -= TemperatureIt->second;
+
+ AirPressure -= p.AirPressure.getValue();
+
+ for (scalar_iterator VaporPressureIt = p.VaporPressure.begin();
+ VaporPressureIt != p.VaporPressure.end();
+ VaporPressureIt++)
+ if (!VaporPressure.insert( weather_type(VaporPressureIt->first, -VaporPressureIt->second) ).second)
+ VaporPressure[VaporPressureIt->first] -= VaporPressureIt->second;
+
+ return *this;
+}
+
+#if 0 // old version
inline FGPhysicalProperties& FGPhysicalProperties::operator -= (const FGPhysicalProperties& p)
{
typedef map<FGPhysicalProperties::Altitude, FGWindItem >::const_iterator wind_iterator;
return *this;
}
+#endif
inline void FGPhysicalProperties::WindAt(sgVec3 ret, const WeatherPrecision a) const
{