--- temp/Atlas01/configure.ac 2007-11-10 11:24:30.000000000 +0100 +++ Atlas01/configure.ac 2011-10-22 15:05:33.000000000 +0200 @@ -54,6 +54,17 @@ SIMGEAR_DIR= fi +dnl Specify the openscenegraph location +AC_ARG_WITH(osg, [ --with-osg=prefix specify the prefix path to openscenegraph]) + +if test "x$with_osg" != "x" ; then + echo "OpenSceneGraph prefix path is $with_osg" + OSG_DIR="$with_osg" +else + echo "OpenSceneGraph not specified" + OSG_DIR= +fi + dnl Specify the base package location AC_ARG_WITH(fgbase, [ --with-fgbase=prefix specify the location of the FlightGear base package]) @@ -97,7 +108,8 @@ AC_SUBST(ARFLAGS) dnl extra library and include directories -EXTRA_DIRS="${SIMGEAR_DIR} ${PLIB_DIR} ${LIBCURL_DIR} /usr/local/plib" +### EXTRA_DIRS="${SIMGEAR_DIR} ${PLIB_DIR} ${LIBCURL_DIR} /usr/local/plib" +EXTRA_DIRS="${SIMGEAR_DIR} ${PLIB_DIR} ${LIBCURL_DIR} ${OSG_DIR} /usr/local/plib" dnl Determine an extra directories to add to include/lib search paths case "${host}" in --- temp/Atlas01/src/Atlas.cxx 2008-04-24 16:43:32.000000000 +0200 +++ Atlas01/src/Atlas.cxx 2011-10-22 15:23:33.000000000 +0200 @@ -33,6 +33,9 @@ #include #include +#ifndef SG_GLUT_H +#include "sg_glue.hxx" +#endif #include SG_GLUT_H #include #include @@ -840,7 +843,7 @@ // Add track to end of tracks vector and display it. tracks.push_back(aTrack); setFlightTrack(tracks.size() - 1); - } catch (runtime_error e) { + } catch (std::runtime_error e) { // EYE - beep? dialog box? console message? printf("Failed to read flight file '%s'\n", file); } @@ -1757,7 +1760,7 @@ // Set the mark aircraft to the beginning of the track. aTrack->setMark(0); tracks.push_back(aTrack); - } catch (runtime_error e) { + } catch (std::runtime_error e) { printf("Failed to read flight file '%s'\n", prefs.flightFiles[i].c_str()); } --- temp/Atlas01/src/fg_mkdir.cxx 2008-04-23 19:29:58.000000000 +0200 +++ Atlas01/src/fg_mkdir.cxx 2011-10-22 15:42:06.000000000 +0200 @@ -34,6 +34,7 @@ #endif #include #include +#include // for system() using namespace std; --- temp/Atlas01/src/FlightTrack.cxx 2008-04-23 14:28:44.000000000 +0200 +++ Atlas01/src/FlightTrack.cxx 2011-10-22 15:26:55.000000000 +0200 @@ -28,6 +28,7 @@ #include #include #include +#include #include "FlightTrack.hxx" --- temp/Atlas01/src/FlightTrack.hxx 2008-01-03 09:28:48.000000000 +0100 +++ Atlas01/src/FlightTrack.hxx 2011-10-22 14:55:22.000000000 +0200 @@ -26,6 +26,9 @@ #include #include #include +#ifndef SG_GLUT_H +#include "sg_glue.hxx" +#endif #include #include #include --- temp/Atlas01/src/Graphs.cxx 2008-04-24 13:16:10.000000000 +0200 +++ Atlas01/src/Graphs.cxx 2011-10-22 14:56:17.000000000 +0200 @@ -24,6 +24,9 @@ #endif // #ifdef HAVE_CONFIG_H #include +#ifndef SG_GLUT_H +#include "sg_glue.hxx" +#endif #include SG_GLUT_H #include "Graphs.hxx" --- temp/Atlas01/src/Makefile.am 2007-12-10 09:23:08.000000000 +0100 +++ Atlas01/src/Makefile.am 2011-10-23 11:15:02.000000000 +0200 @@ -8,6 +8,9 @@ bin_PROGRAMS += GetMap endif +simgear_LIBS = -lsgmagvar -lsgtiming -lsgmisc -lsgio -lsgserial -lsgdebug \ + -lsgbucket -lsgxml -lsgscreen -lsgstructure -lsgmath -lsgthreads + bin_SCRIPTS = buildmaps.sh Atlas_SOURCES = \ @@ -29,8 +32,7 @@ Graphs.cxx Graphs.hxx Atlas_LDADD = \ - -lsgmagvar -lsgtiming -lsgmisc -lsgio -lsgserial -lsgdebug \ - -lsgbucket -lsgxml -lsgstructure \ + $(simgear_LIBS) \ -lplibsg -lplibpuaux -lplibpu -lplibul -lplibfnt -lplibnet \ $(opengl_LIBS) \ -lpng -lz -lpthread -ljpeg @@ -47,8 +49,7 @@ fg_mkdir.cxx fg_mkdir.hxx Map_LDADD = \ - -lsgmagvar -lsgtiming -lsgmisc -lsgio -lsgserial -lsgdebug \ - -lsgbucket -lsgscreen -lsgstructure \ + $(simgear_LIBS) \ -lplibsg -lplibpu -lplibul -lplibfnt -lplibnet \ $(opengl_LIBS) \ -lpng -lz -ljpeg @@ -64,8 +65,8 @@ Scenery.cxx Scenery.hxx MapPS_LDADD = \ - -lsgmagvar -lsgtiming -lsgmisc -lsgio -lsgserial -lsgdebug \ - -lplibsg -lplibnet -lsgbucket -lsgstructure \ + $(simgear_LIBS) \ + -lplibsg -lplibpu -lplibul -lplibfnt -lplibnet \ -lpng -lz GetMap_SOURCES = \ @@ -73,3 +74,4 @@ GetMap_LDADD = \ -lcurl + --- temp/Atlas01/src/MapBrowser.cxx 2008-04-24 12:17:30.000000000 +0200 +++ Atlas01/src/MapBrowser.cxx 2011-10-22 15:28:41.000000000 +0200 @@ -119,7 +119,7 @@ void MapBrowser::changeResolution(const char *path) { MapTile *tile; - list::iterator i = tiles.begin(); + std::list::iterator i = tiles.begin(); while (i != tiles.end()) { tile =*i; @@ -176,7 +176,7 @@ glEnable( GL_TEXTURE_2D ); GLfloat tilesize = earth_radius_lat(clat) * SG_DEGREES_TO_RADIANS; - for (list::iterator i = tiles.begin(); i != tiles.end(); i++) { + for (std::list::iterator i = tiles.begin(); i != tiles.end(); i++) { MapTile *tile = *i; if ( tile->tex ) { GLfloat dxs = 0.5f; @@ -242,7 +242,7 @@ if (max_lat > 90) max_lat = 90; int num_lat = (max_lat - min_lat) + 1, num_lon = (max_lon - min_lon) + 1; - list::iterator it = tiles.begin(); + std::list::iterator it = tiles.begin(); while (it != tiles.end()) { MapTile *tile = *it; --- temp/Atlas01/src/MapBrowser.hxx 2007-08-03 10:24:24.000000000 +0200 +++ Atlas01/src/MapBrowser.hxx 2011-10-22 15:18:07.000000000 +0200 @@ -113,9 +113,9 @@ } }; - typedef map TileTable; + typedef std::map TileTable; - list tiles; + std::list tiles; TileTable tiletable; char mpath[512]; --- temp/Atlas01/src/Map.cxx 2008-04-24 17:49:50.000000000 +0200 +++ Atlas01/src/Map.cxx 2011-10-22 16:23:02.000000000 +0200 @@ -43,6 +43,9 @@ #include #include +#ifndef SG_GLUT_H +#include "sg_glue.hxx" +#endif #include SG_GL_H #ifdef UL_GLX # define GLX_GLXEXT_PROTOTYPES @@ -66,13 +69,18 @@ #include "fg_mkdir.hxx" #include #include +#ifdef ADD_HEADLESS_OPTION #include +#endif // #ifdef ADD_HEADLESS_OPTION #include "Scenery.hxx" #include -#include STL_STRING - -SG_USING_STD(vector); -SG_USING_STD(string); +//#include STL_STRING +#include +#include + +using namespace std; +//SG_USING_STD(vector); +//SG_USING_STD(string); typedef vector string_list; @@ -97,7 +105,9 @@ int opathl, spathl; ulDir *dir1 = NULL, *dir2 = NULL; ulDirEnt *ent = NULL; +#ifdef ADD_HEADLESS_OPTION RenderTexture *rt2 = 0; +#endif // #ifdef ADD_HEADLESS_OPTION /*****************************************************************************/ void reshapeMap( int width, int height ) { @@ -245,7 +255,9 @@ printf(" --atlas=path Create maps of all scenery, and store them in path\n"); printf(" --verbose Display information during processing\n"); printf(" --singlebuffer Use single buffered display\n"); +#ifdef ADD_HEADLESS_OPTION printf(" --headless Don't display output (render into an off-screen buffer)\n"); +#endif // #ifdef ADD_HEADLESS_OPTION printf(" --glutfonts Use GLUT built-in fonts\n"); printf(" --palette=path Set the palette file to use\n"); printf(" --smooth-color Make smooth color heights\n"); @@ -335,6 +347,7 @@ } #endif +#ifdef ADD_HEADLESS_OPTION bool InitPbuffer( int &tex_size ) { rt2 = new RenderTexture(); rt2->Reset("rgb tex2D"); @@ -376,6 +389,7 @@ } return cur_ok; } +#endif // #ifdef ADD_HEADLESS_OPTION int main( int argc, char **argv ) { if (argc < 2) { @@ -534,6 +548,7 @@ glutCreateWindow( "MAP - Please wait while drawing" ); int tex_size = 0; +#ifdef ADD_HEADLESS_OPTION if(headless) { headless = InitPbuffer( tex_size ); mapobj.setDeviceSize( tex_size ); @@ -544,6 +559,7 @@ exit(0); } } +#endif // ADD_HEADLESS_OPTION if ( mapobj.getSize() > 1024 ) mapobj.setDeviceSize( 1024 ); glutReshapeWindow( mapobj.getDeviceSize(), mapobj.getDeviceSize() ); --- temp/Atlas01/src/MapMaker.cxx 2008-04-24 16:07:32.000000000 +0200 +++ Atlas01/src/MapMaker.cxx 2011-10-22 16:43:26.000000000 +0200 @@ -33,10 +33,13 @@ #endif #include #include +#include #include "MapMaker.hxx" /*#include */ +using namespace std; + // Utility function that I needed to put somewhere - this probably isn't the best place for it. // Appends a path separator to a directory path if not present. // Calling function MUST ENSURE that there is space allocated for the potential strcat. @@ -710,7 +713,7 @@ } } -#ifdef _MSC_VER +#if defined(_MSC_VER) || !defined(USE_OLD_POINT3D) // typedef vector < Point3D > point_list; typedef const std::vector pt_list; typedef const std::vector pt_listf; @@ -733,7 +736,11 @@ /* ugly conversion of GBS as Point3D to sgVec3 (why doesn't SimGear use SG from PLIB?) */ +#ifdef USE_OLD_POINT3D Point3D gbs_p = tile.get_gbs_center(); +#else // #ifdef USE_OLD_POINT3D + const SGVec3& gbs_p = tile.get_gbs_center(); +#endif // #ifdef USE_OLD_POINT3D for (i = 0; i < 3; i++) { gbs[i] = gbs_p[i]; } @@ -749,7 +756,8 @@ // http://www.flightgear.org/Docs/Scenery/CoordinateSystem/CoordinateSystem.html // // for more. -#ifdef _MSC_VER +//#ifdef _MSC_VER +#if defined(_MSC_VER) || !defined(USE_OLD_POINT3D) // typedef vector < Point3D > point_list; // typedef const std::vector pt_list; pt_list wgs84_nodes = tile.get_wgs84_nodes(); --- temp/Atlas01/src/MapMaker.hxx 2007-12-10 09:29:30.000000000 +0100 +++ Atlas01/src/MapMaker.hxx 2011-10-22 15:51:55.000000000 +0200 @@ -26,19 +26,24 @@ ---------------------------------------------------------------------------*/ #include +#ifndef SG_GLUT_H +#include "sg_glue.hxx" +#endif #include #include #include #include #include -#include STL_STRING +//#include STL_STRING +#include #include "Output.hxx" #include "Overlays.hxx" #include "Geodesy.hxx" -SG_USING_STD(vector); -SG_USING_STD(string); +using namespace std; +//SG_USING_STD(vector); +//SG_USING_STD(string); // Utility function that I needed to put somewhere - this probably isn't the best place for it. // Appends a path separator to a directory path if not present. --- temp/Atlas01/src/MapPS.cxx 2008-04-24 16:28:44.000000000 +0200 +++ Atlas01/src/MapPS.cxx 2011-10-22 16:47:04.000000000 +0200 @@ -41,9 +41,13 @@ #include "OutputPS.hxx" #include #include "Scenery.hxx" - -SG_USING_STD(vector); -SG_USING_STD(string); +#include // for cout() +#include +#include + +using namespace std; +//SG_USING_STD(vector); +//SG_USING_STD(string); typedef vector string_list; --- temp/Atlas01/src/OutputGL.hxx 2007-12-10 09:14:22.000000000 +0100 +++ Atlas01/src/OutputGL.hxx 2011-10-22 14:53:11.000000000 +0200 @@ -2,6 +2,9 @@ #define __OUTPUTGL_H__ #include +#ifndef SG_GLUT_H +#include "sg_glue.hxx" +#endif #include SG_GLUT_H #include #include --- temp/Atlas01/src/Overlays.cxx 2008-04-24 12:38:00.000000000 +0200 +++ Atlas01/src/Overlays.cxx 2011-10-22 15:38:19.000000000 +0200 @@ -32,8 +32,13 @@ #include #include +#include // for sort() -SG_USING_STD(map); +//SG_USING_STD(map); +using namespace std; +//using std::map; +//using std::max; +//using std::min; #ifdef _MSC_VER @@ -372,7 +377,7 @@ sgVec2 *outlines = new sgVec2[ap->rwys.size()*4]; sgVec2 *insides = new sgVec2[ap->rwys.size()*4]; int oc = 0, ic = 0; - for (list::const_iterator j = ap->rwys.begin(); j != ap->rwys.end(); + for (std::list::const_iterator j = ap->rwys.begin(); j != ap->rwys.end(); j++) { sgVec2 rwyc, rwyl, rwyw; --- temp/Atlas01/src/Overlays.hxx 2008-04-24 12:15:44.000000000 +0200 +++ Atlas01/src/Overlays.hxx 2011-10-23 11:12:54.000000000 +0200 @@ -37,6 +37,8 @@ #include "FlightTrack.hxx" #include "Projection.hxx" +using namespace std; + class Overlays { public: static const int OVERLAY_AIRPORTS = 1 << 0; @@ -139,7 +141,7 @@ struct ARP { char name[64], id[5]; float lat, lon; - list rwys; + std::list rwys; }; enum NavType { NAV_VOR, NAV_DME, NAV_NDB, NAV_ILS, NAV_FIX }; --- temp/Atlas01/src/Preferences.hxx 2007-12-13 14:37:04.000000000 +0100 +++ Atlas01/src/Preferences.hxx 2011-10-22 15:39:58.000000000 +0200 @@ -94,8 +94,8 @@ int height; bool softcursor; // EYE - use sets? - vector networkConnections; - vector serialConnections; + std::vector networkConnections; + std::vector serialConnections; float update; int mode; SGPath scenery_root; @@ -108,7 +108,7 @@ int concurrency; bool autocenter_mode; - vector flightFiles; + std::vector flightFiles; protected: bool _loadPreferences(int argc, char *argv[]); --- temp/Atlas01/src/Scenery.cxx 2008-04-24 16:14:40.000000000 +0200 +++ Atlas01/src/Scenery.cxx 2011-10-22 16:45:28.000000000 +0200 @@ -8,10 +8,14 @@ #include #include +#include +#include + #include "MapMaker.hxx" -SG_USING_STD(vector); -SG_USING_STD(string); +using namespace std; +//SG_USING_STD(vector); +//SG_USING_STD(string); typedef vector string_list; diff -rwuN temp/Atlas01/src/sg_glue.hxx Atlas01/src/sg_glue.hxx --- temp/Atlas01/src/sg_glue.hxx 1970-01-01 01:00:00.000000000 +0100 +++ Atlas01/src/sg_glue.hxx 2011-10-22 14:59:01.000000000 +0200 @@ -0,0 +1,24 @@ +// some glue betweeen 2008 and now +#ifndef _SG_GLUE_HXX_ +#define _SG_GLUE_HXX_ + +#ifdef __APPLE__ +# define SG_GL_H +# define SG_GLX_H +# define SG_GLU_H +# define SG_GLEXT_H +# define SG_GLUT_H +//inline int (isnan)(double r) { return !(r <= 0 || r >= 0); } +#else +# define SG_GL_H +# define SG_GLX_H +# define SG_GLU_H +# define SG_GLEXT_H +# define SG_GLUT_H +#endif + +#include SG_GLUT_H +#include + +#endif // #ifndef _SG_GLUE_HXX_ +// eof - sg_glue.hxx