MacOS portability tweaks from Darrell Walisser.

This commit is contained in:
curt
2000-09-13 19:29:01 +00:00
parent 2a369803ae
commit 89960ab715
12 changed files with 73 additions and 74 deletions

View File

@@ -118,7 +118,7 @@
# define bcopy(from, to, n) memcpy(to, from, n)
// -rp- please use FG_MEM_COPY everywhere !
# define FG_MEM_COPY(to,from,n) memcpy(to, from, n)
// #define FG_MEM_COPY(to,from,n) memcpy(to, from, n)
// -dw- currently used glut has no game mode stuff
# define GLUT_WRONG_VERSION

View File

@@ -36,16 +36,16 @@
#include <plib/sg.h>
#include "star.hxx"
#include "moon.hxx"
#include "mercury.hxx"
#include "venus.hxx"
#include "mars.hxx"
#include "jupiter.hxx"
#include "saturn.hxx"
#include "uranus.hxx"
#include "neptune.hxx"
#include "stars.hxx"
#include <simgear/ephemeris/star.hxx>
#include <simgear/ephemeris/moon.hxx>
#include <simgear/ephemeris/mercury.hxx>
#include <simgear/ephemeris/venus.hxx>
#include <simgear/ephemeris/mars.hxx>
#include <simgear/ephemeris/jupiter.hxx>
#include <simgear/ephemeris/saturn.hxx>
#include <simgear/ephemeris/uranus.hxx>
#include <simgear/ephemeris/neptune.hxx>
#include <simgear/ephemeris/stars.hxx>
class SGEphemeris {

View File

@@ -25,8 +25,8 @@
#ifndef _MERCURY_HXX_
#define _MERCURY_HXX_
#include "celestialBody.hxx"
#include "star.hxx"
#include <simgear/ephemeris/celestialBody.hxx>
#include <simgear/ephemeris/star.hxx>
class Mercury : public CelestialBody
{

View File

@@ -28,8 +28,8 @@
#include <simgear/constants.h>
#include "celestialBody.hxx"
#include "star.hxx"
#include <simgear/ephemeris/celestialBody.hxx>
#include <simgear/ephemeris/star.hxx>
class Moon : public CelestialBody
{

View File

@@ -26,7 +26,7 @@
#define _STAR_HXX_
#include "celestialBody.hxx"
#include <simgear/ephemeris/celestialBody.hxx>
class Star : public CelestialBody

View File

@@ -100,44 +100,42 @@ CMetarStation::CMetarStation(
int CMetarStation::initialize()
{
// Read the list of metar stations, decoding and adding to global list.
// Read the list of metar stations, decoding and adding to global list.
CMetarStation *m;
char buf[256];
CMetarStation *m;
char buf[256];
// Goto the Flight Gear installation directory
// Goto the Flight Gear installation directory
#ifdef TESTPROG
FGPath weatherPath( "/mkv/Build/FlightGear" );
//FGPath weatherPath( "/mkv/Build/FlightGear" );
FGPath weatherPath( ":Data" );
#else
FGPath weatherPath( current_options.get_fg_root() );
#endif
weatherPath.append( "Weather/MetarStations" );
// Open the metar station list
FILE *f = fopen( weatherPath.c_str(), "r" );
weatherPath.append( "Weather" );
weatherPath.append( "MetarStations" );
// Open the metar station list
FILE *f = fopen( weatherPath.c_str(), "r" );
if ( f != NULL )
{
// Read each line, create an instance of a station, and add it to the vector
while ( fgets( buf, 256, f) != NULL && feof( f ) == 0 )
{
//std::cout << buf << std::endl;
m = new CMetarStation( buf );
//m->dump();
METAR_Stations.push_back( m );
}
if ( f != NULL ) {
// Read each line, create an instance of a station, and add it to the vector
while ( fgets( buf, 256, f) != NULL && feof( f ) == 0 ) {
//std::cout << buf << std::endl;
m = new CMetarStation( buf );
//m->dump();
METAR_Stations.push_back( m );
}
// Close the list
fclose( f );
std::cout << METAR_Stations.size() << " Metar stations" << std::endl;
return 1;
}
else
{
std::cout << "Could not open MetarStations file " << std::endl;
return 0;
}
// Close the list
fclose( f );
// std::cout << METAR_Stations.size() << " Metar stations" << std::endl;
return 1;
} else {
// std::cout << "Could not open MetarStations file " << std::endl;
return 0;
}
}

View File

@@ -491,8 +491,8 @@ SGValue::setUnknownValue (const string &value)
* Returns true on success (i.e. the value is not currently tied).
*/
bool
SGValue::tieBool (bool_getter getter, bool_setter setter = 0,
bool useDefault = true)
SGValue::tieBool (bool_getter getter, bool_setter setter,
bool useDefault)
{
if (_tied) {
return false;
@@ -517,8 +517,8 @@ SGValue::tieBool (bool_getter getter, bool_setter setter = 0,
* Returns true on success (i.e. the value is not currently tied).
*/
bool
SGValue::tieInt (int_getter getter, int_setter setter = 0,
bool useDefault = true)
SGValue::tieInt (int_getter getter, int_setter setter,
bool useDefault)
{
if (_tied) {
return false;
@@ -543,8 +543,8 @@ SGValue::tieInt (int_getter getter, int_setter setter = 0,
* Returns true on success (i.e. the value is not currently tied).
*/
bool
SGValue::tieFloat (float_getter getter, float_setter setter = 0,
bool useDefault = true)
SGValue::tieFloat (float_getter getter, float_setter setter,
bool useDefault)
{
if (_tied) {
return false;
@@ -569,8 +569,8 @@ SGValue::tieFloat (float_getter getter, float_setter setter = 0,
* Returns true on success (i.e. the value is not currently tied).
*/
bool
SGValue::tieDouble (double_getter getter, double_setter setter = 0,
bool useDefault = true)
SGValue::tieDouble (double_getter getter, double_setter setter,
bool useDefault)
{
if (_tied) {
return false;
@@ -595,8 +595,8 @@ SGValue::tieDouble (double_getter getter, double_setter setter = 0,
* Returns true on success (i.e. the value is not currently tied).
*/
bool
SGValue::tieString (string_getter getter, string_setter setter = 0,
bool useDefault = true)
SGValue::tieString (string_getter getter, string_setter setter,
bool useDefault)
{
if (_tied) {
return false;
@@ -693,7 +693,7 @@ SGPropertyList::~SGPropertyList ()
* and must not end with '/'.
*/
SGValue *
SGPropertyList::getValue (const string &name, bool create = false)
SGPropertyList::getValue (const string &name, bool create)
{
const_iterator el = _props.find(name);
if (el == _props.end()) {
@@ -914,7 +914,7 @@ bool
SGPropertyList::tieBool (const string &name,
bool_getter getter,
bool_setter setter,
bool useDefault = true)
bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying bool property '" << name << '\'');
return getValue(name, true)->tieBool(getter, setter, useDefault);
@@ -930,7 +930,7 @@ bool
SGPropertyList::tieInt (const string &name,
int_getter getter,
int_setter setter,
bool useDefault = true)
bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying int property '" << name << '\'');
return getValue(name, true)->tieInt(getter, setter, useDefault);
@@ -946,7 +946,7 @@ bool
SGPropertyList::tieFloat (const string &name,
float_getter getter,
float_setter setter,
bool useDefault = true)
bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying float property '" << name << '\'');
return getValue(name, true)->tieFloat(getter, setter, useDefault);
@@ -962,7 +962,7 @@ bool
SGPropertyList::tieDouble (const string &name,
double_getter getter,
double_setter setter,
bool useDefault = true)
bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying double property '" << name << '\'');
return getValue(name, true)->tieDouble(getter, setter, useDefault);
@@ -978,7 +978,7 @@ bool
SGPropertyList::tieString (const string &name,
string_getter getter,
string_setter setter,
bool useDefault = true)
bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying string property '" << name << '\'');
return getValue(name, true)->tieString(getter, setter, useDefault);
@@ -1037,8 +1037,8 @@ get_base (const string &parent, const string &child,
/**
* Constructor.
*/
SGPropertyNode::SGPropertyNode (const string &path = "",
SGPropertyList * props = 0)
SGPropertyNode::SGPropertyNode (const string &path,
SGPropertyList * props)
: _props(props), _node(0)
{
setPath(path);

View File

@@ -420,6 +420,6 @@ extern bool writePropertyList (const string &file,
extern SGPropertyList current_properties;
#endif __PROPS_HXX
#endif // __PROPS_HXX
// end of props.hxx

View File

@@ -267,10 +267,10 @@ void SGSky::add_cloud_layer( double asl, double thickness,
cloud_layers.push_back( layer );
}
for ( int i = 0; i < (int)cloud_layers.size(); ++i ) {
cout << "layer " << i << " = " << cloud_layers[i]->get_asl() << endl;
}
cout << endl;
// for ( int i = 0; i < (int)cloud_layers.size(); ++i ) {
// cout << "layer " << i << " = " << cloud_layers[i]->get_asl() << endl;
// }
// cout << endl;
}

View File

@@ -39,11 +39,11 @@
#include <vector>
#include "cloud.hxx"
#include "dome.hxx"
#include "moon.hxx"
#include "oursun.hxx"
#include "stars.hxx"
#include <simgear/sky/cloud.hxx>
#include <simgear/sky/dome.hxx>
#include <simgear/sky/moon.hxx>
#include <simgear/sky/oursun.hxx>
#include <simgear/sky/stars.hxx>
FG_USING_STD(vector);

View File

@@ -43,7 +43,7 @@
# include <time.h>
#endif
#include "timezone.h"
#include <simgear/timing/timezone.h>
// Define a structure containing time parameters

View File

@@ -30,9 +30,10 @@
#ifndef _TIMEZONE_H_
#define _TIMEZONE_H_
#include "geocoord.h"
#include <stdio.h>
#include <simgear/timing/geocoord.h>
class Timezone : public GeoCoord
{
private: