From b8ce139b8a6cb3e49432e7fbee1afafd06975dcc Mon Sep 17 00:00:00 2001 From: curt Date: Sun, 25 Mar 2001 12:06:09 +0000 Subject: [PATCH] FG_ to SG_ namespace changes. Doxygenifing. --- simgear/bucket/newbucket.cxx | 4 +- simgear/ephemeris/ephemeris.cxx | 2 +- simgear/ephemeris/moonpos.cxx | 1 - simgear/ephemeris/stardata.cxx | 8 +- simgear/ephemeris/stardata.hxx | 6 +- simgear/magvar/magvar.cxx | 1 - simgear/math/interpolater.cxx | 4 +- simgear/metar/MetarStation.cpp | 2 - simgear/misc/Makefile.am | 8 +- simgear/misc/fgpath.hxx | 89 ------------ simgear/misc/props_io.cxx | 6 +- simgear/misc/{fgpath.cxx => sg_path.cxx} | 29 ++-- simgear/misc/sg_path.hxx | 120 +++++++++++++++++ simgear/misc/sgstream.cxx | 165 +++++++++++++++++++++++ simgear/misc/sgstream.hxx | 140 +++++++++++++++++++ simgear/sky/moon.cxx | 2 +- simgear/sky/moon.hxx | 4 +- simgear/sky/oursun.cxx | 2 +- simgear/sky/oursun.hxx | 4 +- simgear/sky/sky.cxx | 2 +- simgear/sky/sky.hxx | 6 +- simgear/timing/sg_time.cxx | 8 +- 22 files changed, 472 insertions(+), 141 deletions(-) delete mode 100644 simgear/misc/fgpath.hxx rename simgear/misc/{fgpath.cxx => sg_path.cxx} (81%) create mode 100644 simgear/misc/sg_path.hxx create mode 100644 simgear/misc/sgstream.cxx create mode 100644 simgear/misc/sgstream.hxx diff --git a/simgear/bucket/newbucket.cxx b/simgear/bucket/newbucket.cxx index 0b6898e7..f3c0bee0 100644 --- a/simgear/bucket/newbucket.cxx +++ b/simgear/bucket/newbucket.cxx @@ -31,7 +31,7 @@ #include -#include +#include #include "newbucket.hxx" @@ -180,7 +180,7 @@ string SGBucket::gen_base_path() const { hem, top_lon, pole, top_lat, hem, main_lon, pole, main_lat); - FGPath path( raw_path ); + SGPath path( raw_path ); return path.str(); } diff --git a/simgear/ephemeris/ephemeris.cxx b/simgear/ephemeris/ephemeris.cxx index 95ac3402..3453127c 100644 --- a/simgear/ephemeris/ephemeris.cxx +++ b/simgear/ephemeris/ephemeris.cxx @@ -37,7 +37,7 @@ SGEphemeris::SGEphemeris( const string &path ) { saturn = new Saturn; uranus = new Uranus; neptune = new Neptune; - stars = new SGStarData( FGPath(path) ); + stars = new SGStarData( SGPath(path) ); } diff --git a/simgear/ephemeris/moonpos.cxx b/simgear/ephemeris/moonpos.cxx index d053082c..27d62a73 100644 --- a/simgear/ephemeris/moonpos.cxx +++ b/simgear/ephemeris/moonpos.cxx @@ -27,7 +27,6 @@ #include #include -#include #ifdef __BORLANDC__ # define exception c_exception diff --git a/simgear/ephemeris/stardata.cxx b/simgear/ephemeris/stardata.cxx index b5f5d63b..d7d82a38 100644 --- a/simgear/ephemeris/stardata.cxx +++ b/simgear/ephemeris/stardata.cxx @@ -23,7 +23,7 @@ #include -#include +#include #include "stardata.hxx" @@ -35,8 +35,8 @@ SGStarData::SGStarData() { } -SGStarData::SGStarData( FGPath path ) { - data_path = FGPath( path ); +SGStarData::SGStarData( SGPath path ) { + data_path = SGPath( path ); load(); } @@ -56,7 +56,7 @@ bool SGStarData::load() { data_path.append( "stars" ); SG_LOG( SG_ASTRO, SG_INFO, " Loading stars from " << data_path.str() ); - fg_gzifstream in( data_path.str() ); + sg_gzifstream in( data_path.str() ); if ( ! in.is_open() ) { SG_LOG( SG_ASTRO, SG_ALERT, "Cannot open star file: " << data_path.str() ); diff --git a/simgear/ephemeris/stardata.hxx b/simgear/ephemeris/stardata.hxx index 0f9f7ae7..35ed5c25 100644 --- a/simgear/ephemeris/stardata.hxx +++ b/simgear/ephemeris/stardata.hxx @@ -28,7 +28,7 @@ #include -#include +#include #define SG_MAX_STARS 850 @@ -39,13 +39,13 @@ class SGStarData { int nstars; sgdVec3 *stars; - FGPath data_path; + SGPath data_path; public: // Constructor SGStarData(); - SGStarData( FGPath path ); + SGStarData( SGPath path ); // Destructor ~SGStarData(); diff --git a/simgear/magvar/magvar.cxx b/simgear/magvar/magvar.cxx index ff17ae5d..41dca19b 100644 --- a/simgear/magvar/magvar.cxx +++ b/simgear/magvar/magvar.cxx @@ -27,7 +27,6 @@ #include -#include #include #include "coremag.hxx" diff --git a/simgear/math/interpolater.cxx b/simgear/math/interpolater.cxx index 206e99a7..f0b0a453 100644 --- a/simgear/math/interpolater.cxx +++ b/simgear/math/interpolater.cxx @@ -32,7 +32,7 @@ // depricated - #include #include -#include +#include #include "interpolater.hxx" @@ -44,7 +44,7 @@ SG_USING_STD(string); SGInterpTable::SGInterpTable( const string& file ) { SG_LOG( SG_MATH, SG_INFO, "Initializing Interpolator for " << file ); - fg_gzifstream in( file ); + sg_gzifstream in( file ); if ( !in.is_open() ) { SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file ); exit(-1); diff --git a/simgear/metar/MetarStation.cpp b/simgear/metar/MetarStation.cpp index 8115df48..b13a3aa8 100644 --- a/simgear/metar/MetarStation.cpp +++ b/simgear/metar/MetarStation.cpp @@ -8,8 +8,6 @@ #include "MetarStation.h" #include -#include - #if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(ostream); SG_USING_STD(cout); diff --git a/simgear/misc/Makefile.am b/simgear/misc/Makefile.am index 9623cc64..a4a37a18 100644 --- a/simgear/misc/Makefile.am +++ b/simgear/misc/Makefile.am @@ -9,19 +9,19 @@ endif lib_LIBRARIES = libsgmisc.a include_HEADERS = \ - fgpath.hxx \ - fgstream.hxx \ props.hxx \ + sg_path.hxx \ + sgstream.hxx \ stopwatch.hxx \ strutils.hxx \ texcoord.hxx \ zfstream.hxx libsgmisc_a_SOURCES = \ - fgpath.cxx \ - fgstream.cxx \ props.cxx \ props_io.cxx \ + sg_path.cxx \ + sgstream.cxx \ strutils.cxx \ texcoord.cxx \ zfstream.cxx diff --git a/simgear/misc/fgpath.hxx b/simgear/misc/fgpath.hxx deleted file mode 100644 index 94260461..00000000 --- a/simgear/misc/fgpath.hxx +++ /dev/null @@ -1,89 +0,0 @@ -// -// fgpath.hxx -- routines to abstract out path separator differences -// between MacOS and the rest of the world -// -// Written by Curtis L. Olson, started April 1999. -// -// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the -// Free Software Foundation, Inc., 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. -// -// $Id$ - - -#ifndef _FGPATH_HXX -#define _FGPATH_HXX - - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include STL_STRING - -SG_USING_STD(string); - - -#ifdef macintosh -# define FG_PATH_SEP ':' -# define FG_BAD_PATH_SEP '/' -#else -# define FG_PATH_SEP '/' -# define FG_BAD_PATH_SEP ':' -#endif - - -class FGPath { - -private: - - string path; - -public: - - // default constructor - FGPath(); - - // create a path based on "path" - FGPath( const string p ); - - // destructor - ~FGPath(); - - // set path - void set( const string p ); - - // append another piece to the existing path - void append( const string p ); - - // concatenate a string to the end of the path without inserting a - // path separator - void concat( const string p ); - - // get the directory part of the path - string dir(); - - // get the path string - inline string str() const { return path; } - inline const char *c_str() { return path.c_str(); } -}; - - -#endif // _FGPATH_HXX - - diff --git a/simgear/misc/props_io.cxx b/simgear/misc/props_io.cxx index d4ea27de..7bbe0366 100644 --- a/simgear/misc/props_io.cxx +++ b/simgear/misc/props_io.cxx @@ -10,7 +10,7 @@ #include #include -#include "fgpath.hxx" +#include "sg_path.hxx" #include "props.hxx" #include STL_IOSTREAM @@ -143,9 +143,9 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts) // Check for an include. const char * att_include = atts.getValue("include"); if (att_include != 0) { - FGPath path(FGPath(_base).dir()); + SGPath path(SGPath(_base).dir()); cerr << "Base is " << _base << endl; - cerr << "Dir is " << FGPath(_base).dir() << endl; + cerr << "Dir is " << SGPath(_base).dir() << endl; path.append(att_include); if (!readProperties(path.str(), node)) { SG_LOG(SG_INPUT, SG_ALERT, "Failed to read include file " diff --git a/simgear/misc/fgpath.cxx b/simgear/misc/sg_path.cxx similarity index 81% rename from simgear/misc/fgpath.cxx rename to simgear/misc/sg_path.cxx index e6317a3c..72c2d745 100644 --- a/simgear/misc/fgpath.cxx +++ b/simgear/misc/sg_path.cxx @@ -1,5 +1,4 @@ -// -// fgpath.cxx -- routines to abstract out path separator differences +// sg_path.cxx -- routines to abstract out path separator differences // between MacOS and the rest of the world // // Written by Curtis L. Olson, started April 1999. @@ -24,7 +23,7 @@ // $Id$ -#include "fgpath.hxx" +#include "sg_path.hxx" // If Unix, replace all ":" with "/". If MacOS, replace all "/" with @@ -42,8 +41,8 @@ static string fix_path( const string path ) { continue; } #endif - if ( result[i] == FG_BAD_PATH_SEP ) { - result[i] = FG_PATH_SEP; + if ( result[i] == SG_BAD_PATH_SEP ) { + result[i] = SG_PATH_SEP; } } @@ -52,37 +51,37 @@ static string fix_path( const string path ) { // default constructor -FGPath::FGPath() { +SGPath::SGPath() { path = ""; } // create a path based on "path" -FGPath::FGPath( const string p ) { +SGPath::SGPath( const string p ) { set( p ); } // destructor -FGPath::~FGPath() { +SGPath::~SGPath() { } // set path -void FGPath::set( const string p ) { +void SGPath::set( const string p ) { path = fix_path( p ); } // append another piece to the existing path -void FGPath::append( const string p ) { +void SGPath::append( const string p ) { string part = fix_path( p ); if ( path.size() == 0 ) { path = part; } else { - if ( part[0] != FG_PATH_SEP ) { - path += FG_PATH_SEP; + if ( part[0] != SG_PATH_SEP ) { + path += SG_PATH_SEP; } path += part; } @@ -91,7 +90,7 @@ void FGPath::append( const string p ) { // concatenate a string to the end of the path without inserting a // path separator -void FGPath::concat( const string p ) { +void SGPath::concat( const string p ) { string part = fix_path( p ); if ( path.size() == 0 ) { @@ -103,8 +102,8 @@ void FGPath::concat( const string p ) { // get the directory part of the path. -string FGPath::dir() { - int index = path.rfind(FG_PATH_SEP); +string SGPath::dir() { + int index = path.rfind(SG_PATH_SEP); if (index >= 0) { return path.substr(0, index); } else { diff --git a/simgear/misc/sg_path.hxx b/simgear/misc/sg_path.hxx new file mode 100644 index 00000000..8fd5c3ec --- /dev/null +++ b/simgear/misc/sg_path.hxx @@ -0,0 +1,120 @@ +/** + * \file sg_path.hxx + * Routines to abstract out path separator differences between MacOS + * and the rest of the world. + */ + +// Written by Curtis L. Olson, started April 1999. +// +// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. +// +// $Id$ + + +#ifndef _SG_PATH_HXX +#define _SG_PATH_HXX + + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include STL_STRING + +SG_USING_STD(string); + + +#ifdef macintosh +# define SG_PATH_SEP ':' +# define SG_BAD_PATH_SEP '/' +#else +# define SG_PATH_SEP '/' +# define SG_BAD_PATH_SEP ':' +#endif + + +/** + * A class to hide path separator difference across platforms and assist + * in managing file system path names. + * + * Paths can be input in any platform format and will be converted + * automatically to the proper format. + */ + +class SGPath { + +private: + + string path; + +public: + + /** Default constructor */ + SGPath(); + + /** + * Construct a path based on the starting path provided. + * @param p initial path + */ + SGPath( const string p ); + + /** Destructor */ + ~SGPath(); + + /** + * Set path to a new value + * @param p new path + */ + void set( const string p ); + + /** + * Append another piece to the existing path. Inserts a path + * separator between the existing component and the new component. + * @param p additional path component */ + void append( const string p ); + + /** + * Concatenate a string to the end of the path without inserting a + * path separator. + * @param p addtional path suffix + */ + void concat( const string p ); + + /** + * Get the directory part of the path. + * @return directory string + */ + string dir(); + + /** Get the path string + * @return path string + */ + inline string str() const { return path; } + + /** Get the path string + * @return path in "C" string (ptr to char array) form. + */ + inline const char *c_str() { return path.c_str(); } +}; + + +#endif // _SG_PATH_HXX + + diff --git a/simgear/misc/sgstream.cxx b/simgear/misc/sgstream.cxx new file mode 100644 index 00000000..dec7711e --- /dev/null +++ b/simgear/misc/sgstream.cxx @@ -0,0 +1,165 @@ +// zlib input file stream wrapper. +// +// Written by Bernie Bright, 1998 +// +// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. +// +// $Id$ + +#include // isspace() + +#ifdef SG_HAVE_STD_INCLUDES +# include +#else +# include +#endif + +#include "sgstream.hxx" + +sg_gzifstream::sg_gzifstream() + : istream(&gzbuf) +{ +} + +//----------------------------------------------------------------------------- +// +// Open a possibly gzipped file for reading. +// +sg_gzifstream::sg_gzifstream( const string& name, ios_openmode io_mode ) + : istream(&gzbuf) +{ + this->open( name, io_mode ); +} + +//----------------------------------------------------------------------------- +// +// Attach a stream to an already opened file descriptor. +// +sg_gzifstream::sg_gzifstream( int fd, ios_openmode io_mode ) + : istream(&gzbuf) +{ + gzbuf.attach( fd, io_mode ); +} + +//----------------------------------------------------------------------------- +// +// Open a possibly gzipped file for reading. +// If the initial open fails and the filename has a ".gz" extension then +// remove the extension and try again. +// If the initial open fails and the filename doesn't have a ".gz" extension +// then append ".gz" and try again. +// +void +sg_gzifstream::open( const string& name, ios_openmode io_mode ) +{ + gzbuf.open( name.c_str(), io_mode ); + if ( ! gzbuf.is_open() ) + { + string s = name; + if ( s.substr( s.length() - 3, 3 ) == ".gz" ) + { + // remove ".gz" suffix + s.replace( s.length() - 3, 3, "" ); +// s.erase( s.length() - 3, 3 ); + } + else + { + // Append ".gz" suffix + s += ".gz"; + } + + // Try again. + gzbuf.open( s.c_str(), io_mode ); + } +} + +void +sg_gzifstream::attach( int fd, ios_openmode io_mode ) +{ + gzbuf.attach( fd, io_mode ); +} + +// +// Manipulators +// + +istream& +skipeol( istream& in ) +{ + char c = '\0'; + // skip to end of line. + +#ifdef __MWERKS__ + while ( in.get(c) && c != '\0' ) { +#else + while ( in.get(c) ) { +#endif + if ( (c == '\n') || (c == '\r') ) { + break; + } + } + + return in; +} + +istream& +skipws( istream& in ) { + char c; +#ifdef __MWERKS__ + while ( in.get(c) && c != '\0' ) { +#else + while ( in.get(c) ) { +#endif + +#ifdef __MWERKS__ + if ( ! isspace( c ) && c != '\n' ) { +#else + if ( ! isspace( c ) ) { +#endif + // put pack the non-space character + in.putback(c); + break; + } + } + return in; +} + +istream& +skipcomment( istream& in ) +{ + while ( in ) + { + // skip whitespace +#ifdef __MWERKS__ + in >> ::skipws; +#else + in >> skipws; +#endif + + char c; + if ( in.get( c ) && c != '#' ) + { + // not a comment + in.putback(c); + break; + } + in >> skipeol; + } + return in; +} + diff --git a/simgear/misc/sgstream.hxx b/simgear/misc/sgstream.hxx new file mode 100644 index 00000000..7473ee87 --- /dev/null +++ b/simgear/misc/sgstream.hxx @@ -0,0 +1,140 @@ +/** + * \file sgstream.hxx + * zlib input file stream wrapper. + */ + +// Written by Bernie Bright, 1998 +// +// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. +// +// $Id$ + + +#ifndef _SGSTREAM_HXX +#define _SGSTREAM_HXX + +#ifndef __cplusplus +# error This library requires C++ +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#if defined( SG_HAVE_STD_INCLUDES ) +# include +#elif defined ( SG_HAVE_NATIVE_SGI_COMPILERS ) +# include +#elif defined ( __BORLANDC__ ) +# include +#else +# include +#endif + +#include STL_STRING + +#include + +SG_USING_STD(string); + +#ifndef SG_HAVE_NATIVE_SGI_COMPILERS +SG_USING_STD(istream); +#endif + + +/** + * An envelope class for gzifstream. + */ +class sg_gzifstream : private gzifstream_base, public istream +{ +public: + /** Default constructor */ + sg_gzifstream(); + + /** + * Constructor that attempt to open a file with and without + * ".gz" extension. + * @param name name of file + * @param io_mode file open mode(s) "or'd" together + */ + sg_gzifstream( const string& name, + ios_openmode io_mode = ios_in | ios_binary ); + + /** + * Constructor that attaches itself to an existing file descriptor. + * @param fd file descriptor + * @param io_mode file open mode(s) "or'd" together + */ + sg_gzifstream( int fd, ios_openmode io_mode = ios_in|ios_binary ); + + /** + * Attempt to open a file with and without ".gz" extension. + * @param name name of file + * @param io_mode file open mode(s) "or'd" together + */ + void open( const string& name, + ios_openmode io_mode = ios_in|ios_binary ); + + /** + * Attach to an existing file descriptor. + * @param fd file descriptor + * @param io_mode file open mode(s) "or'd" together + */ + void attach( int fd, ios_openmode io_mode = ios_in|ios_binary ); + + /** + * Close the stream. + */ + void close() { gzbuf.close(); } + + /** @return true if the file is successfully opened, false otherwise. */ + bool is_open() { return gzbuf.is_open(); } + +private: + // Not defined! + sg_gzifstream( const sg_gzifstream& ); + void operator= ( const sg_gzifstream& ); +}; + +/** + * \relates sg_gzifstream + * An istream manipulator that skips to end of line. + * @param in input stream + */ +istream& skipeol( istream& in ); + +/** + * \relates sg_gzifstream + * An istream manipulator that skips over white space. + * @param in input stream + */ +istream& skipws( istream& in ); + +/** + * \relates sg_gzifstream + * An istream manipulator that skips comments and white space. + * Ignores comments that start with '#'. + * @param in input stream + */ +istream& skipcomment( istream& in ); + + +#endif /* _SGSTREAM_HXX */ + diff --git a/simgear/sky/moon.cxx b/simgear/sky/moon.cxx index 91049ef4..513cdf4f 100644 --- a/simgear/sky/moon.cxx +++ b/simgear/sky/moon.cxx @@ -124,7 +124,7 @@ SGMoon::~SGMoon( void ) { // build the moon object -ssgBranch * SGMoon::build( FGPath path, double moon_size ) { +ssgBranch * SGMoon::build( SGPath path, double moon_size ) { // set up the orb state path.append( "moon.rgba" ); diff --git a/simgear/sky/moon.hxx b/simgear/sky/moon.hxx index f64447e2..7fc8f808 100644 --- a/simgear/sky/moon.hxx +++ b/simgear/sky/moon.hxx @@ -32,7 +32,7 @@ #include -#include +#include class SGMoon { @@ -55,7 +55,7 @@ public: ~SGMoon( void ); // build the moon object - ssgBranch *build( FGPath path, double moon_size ); + ssgBranch *build( SGPath path, double moon_size ); // repaint the moon colors based on current value of moon_anglein // degrees relative to verticle diff --git a/simgear/sky/oursun.cxx b/simgear/sky/oursun.cxx index a1c08306..6dffc90c 100644 --- a/simgear/sky/oursun.cxx +++ b/simgear/sky/oursun.cxx @@ -222,7 +222,7 @@ void my_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int // initialize the sun object and connect it into our scene graph root -ssgBranch * SGSun::build( FGPath path, double sun_size ) { +ssgBranch * SGSun::build( SGPath path, double sun_size ) { // set up the orb state orb_state = new ssgSimpleState(); diff --git a/simgear/sky/oursun.hxx b/simgear/sky/oursun.hxx index 023b3857..2ee90040 100644 --- a/simgear/sky/oursun.hxx +++ b/simgear/sky/oursun.hxx @@ -32,7 +32,7 @@ #include -#include +#include class SGSun { @@ -58,7 +58,7 @@ public: ~SGSun( void ); // return the sun object - ssgBranch *build( FGPath path, double sun_size ); + ssgBranch *build( SGPath path, double sun_size ); // repaint the sun colors based on current value of sun_anglein // degrees relative to verticle diff --git a/simgear/sky/sky.cxx b/simgear/sky/sky.cxx index a3f756be..fee1b601 100644 --- a/simgear/sky/sky.cxx +++ b/simgear/sky/sky.cxx @@ -98,7 +98,7 @@ void SGSky::build( double sun_size, double moon_size, post_root->addKid( post_selector ); // add the cloud ssgStates to the material lib - FGPath cloud_path; + SGPath cloud_path; cloud_path.set( tex_path.str() ); cloud_path.append( "overcast.rgb" ); diff --git a/simgear/sky/sky.hxx b/simgear/sky/sky.hxx index edaf9c7c..71304811 100644 --- a/simgear/sky/sky.hxx +++ b/simgear/sky/sky.hxx @@ -35,7 +35,7 @@ #include // plib include #include -#include +#include #include @@ -71,7 +71,7 @@ private: ssgSelector *pre_selector, *post_selector; ssgTransform *pre_transform, *post_transform; - FGPath tex_path; + SGPath tex_path; // visibility float visibility; @@ -137,7 +137,7 @@ public: // specify the texture path (optional, defaults to current directory) inline void texture_path( const string& path ) { - tex_path = FGPath( path ); + tex_path = SGPath( path ); } // enable the sky diff --git a/simgear/timing/sg_time.cxx b/simgear/timing/sg_time.cxx index 507c9b35..64628674 100644 --- a/simgear/timing/sg_time.cxx +++ b/simgear/timing/sg_time.cxx @@ -54,7 +54,7 @@ #include #include -#include +#include #include "sg_time.hxx" #include "timezone.h" @@ -83,7 +83,7 @@ SGTime::SGTime( double lon, double lat, const string& root ) // << asctime(localtime(&cur_time)) << endl; if ( root != (string)"" ) { - FGPath zone( root ); + SGPath zone( root ); zone.append( "zone.tab" ); SG_LOG( SG_EVENT, SG_DEBUG, "Reading timezone info from: " << zone.str() ); @@ -92,7 +92,7 @@ SGTime::SGTime( double lon, double lat, const string& root ) GeoCoord location( SGD_RADIANS_TO_DEGREES * lat, SGD_RADIANS_TO_DEGREES * lon ); GeoCoord* nearestTz = tzContainer->getNearest(location); - FGPath name( root ); + SGPath name( root ); name.append( nearestTz->getDescription() ); zonename = strdup( name.c_str() ); // cout << "Using zonename = " << zonename << endl; @@ -254,7 +254,7 @@ void SGTime::updateLocal( double lon, double lat, const string& root ) time_t aircraftLocalTime; GeoCoord location( SGD_RADIANS_TO_DEGREES * lat, SGD_RADIANS_TO_DEGREES * lon ); GeoCoord* nearestTz = tzContainer->getNearest(location); - FGPath zone( root ); + SGPath zone( root ); zone.append ( nearestTz->getDescription() ); if ( zonename ) { delete zonename; -- 2.39.5