? projects Index: Makefile.am =================================================================== RCS file: /cvsroot/atlas/Atlas/Makefile.am,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile.am --- Makefile.am 11 Aug 2000 16:33:33 -0000 1.1.1.1 +++ Makefile.am 9 May 2010 13:15:31 -0000 @@ -1 +1,3 @@ SUBDIRS = src + +EXTRA_DIST = projects Index: configure.ac =================================================================== RCS file: /cvsroot/atlas/Atlas/configure.ac,v retrieving revision 1.23 diff -u -r1.23 configure.ac --- configure.ac 1 May 2010 01:20:50 -0000 1.23 +++ configure.ac 9 May 2010 13:15:31 -0000 @@ -1,9 +1,9 @@ -dnl Process this file with aclocal ; automake -a ; autoconf to produce a +dnl Process this file with aclocal ; automake -a ; autoconf to produce a dnl working configure script. dnl dnl $Id: configure.ac,v 1.23 2010/05/01 01:20:50 bjschack Exp $ -AC_INIT([Atlas], [0.4.0]) +AC_INIT([Atlas], [0.4.8]) AC_CONFIG_SRCDIR([src/Atlas.cxx]) dnl Initialize the automake stuff @@ -49,7 +49,7 @@ if test "x$with_simgear" != "x" ; then echo "SimGear prefix path is $with_simgear" SIMGEAR_DIR="$with_simgear" -else +else echo "SimGear not specified" SIMGEAR_DIR= fi @@ -60,7 +60,7 @@ if test "x$with_osg" != "x" ; then echo "OpenSceneGraph prefix path is $with_osg" OSG_DIR="$with_osg" -else +else echo "OpenSceneGraph not specified" OSG_DIR= fi @@ -135,7 +135,7 @@ esac wi_EXTRA_DIRS(no, ${EXTRA_DIRS}) -dnl Using AM_CONDITIONAL is a step out of the protected little +dnl Using AM_CONDITIONAL is a step out of the protected little dnl automake fold so it is potentially dangerous. But, we are dnl beginning to run into cases where the standard checks are not dnl enough. AM_CONDITIONALS are then referenced to conditionally Index: src/Atlas.cxx =================================================================== RCS file: /cvsroot/atlas/Atlas/src/Atlas.cxx,v retrieving revision 1.68 diff -u -r1.68 Atlas.cxx --- src/Atlas.cxx 8 May 2010 16:38:35 -0000 1.68 +++ src/Atlas.cxx 9 May 2010 13:15:33 -0000 @@ -579,10 +579,10 @@ // used elsewhere // The text size in pixels. This must be multiplied by the // current scale (metresPerPixel) to be in the appropriate units. - static const float _pointSize = 10.0; + const float _pointSize; }; -Route::Route(): active(false) +Route::Route(): active(false), _pointSize(10.0) { } Index: src/Map.cxx =================================================================== RCS file: /cvsroot/atlas/Atlas/src/Map.cxx,v retrieving revision 1.52 diff -u -r1.52 Map.cxx --- src/Map.cxx 26 Apr 2010 21:15:29 -0000 1.52 +++ src/Map.cxx 9 May 2010 13:15:33 -0000 @@ -58,7 +58,13 @@ #ifndef __APPLE__ #define GL_GLEXT_PROTOTYPES #include +#if (defined(HAVE_GLEXT_H) || !defined(EXCLUDE_GLEXT_H)) #include +#else +# ifdef HAVE_SGGLEXT_H +# include "MapEXT.hxx" +# endif +#endif #endif #include @@ -73,12 +79,18 @@ using namespace std; +#if (defined(HAVE_GLEXT_H) || !defined(EXCLUDE_GLEXT_H)) +#define DEFAULT_RTB true +#else +#define DEFAULT_RTB false +#endif + char *appName; // Specifies whether to create JPEGs or PNGs. static bool createJPEG = true; static unsigned int jpegQuality = 75; -static bool renderToFramebuffer = true; +static bool renderToFramebuffer = DEFAULT_RTB; // Turn the lights on or off? static bool lighting = true; // True if we want discrete elevation colours, false for smoothly @@ -246,6 +258,9 @@ verbose = true; } else if (strcmp(arg, "--version") == 0) { printf("Map version %s\n", VERSION); +#ifdef _MSC_VER + print_version_details(); +#endif exit(0); } else if (strcmp(arg, "--help") == 0) { print_help(); @@ -257,6 +272,7 @@ return true; } +#if (defined(HAVE_GLEXT_H) || !defined(EXCLUDE_GLEXT_H)) bool getFramebuffer(int textureSize) { #if (defined(__GLEW_H__) || defined(__glew_h__)) @@ -288,6 +304,8 @@ GL_FRAMEBUFFER_COMPLETE_EXT); } +#endif + // Attempts to load a palette at the given path. Returns the palette // if successful, NULL otherwise. Palette *loadPalette(const char *path) @@ -313,12 +331,18 @@ if (tileManager) { delete tileManager; } +#if (defined(HAVE_GLEXT_H) || !defined(EXCLUDE_GLEXT_H)) if (rbo != 0) { glDeleteRenderbuffersEXT(1, &rbo); } if (fbo != 0) { glDeleteFramebuffersEXT(1, &fbo); } +#else +# ifdef HAVE_SGGLEXT_H + Map_Exit_Ext( &fbo, &rbo ); +# endif +#endif if (mapper) { delete mapper; } @@ -508,6 +532,7 @@ glutInitWindowSize(windowSize, windowSize); glutCreateWindow("Map"); +#if (defined(HAVE_GLEXT_H) || !defined(EXCLUDE_GLEXT_H)) if (renderToFramebuffer) { // Try to get a framebuffer. First, check if the requested // size is supported. @@ -529,6 +554,26 @@ printf("Framebuffer size: %dx%d\n", bufferSize, bufferSize); } } +#else + // NO available, as in native windows + if (renderToFramebuffer) + { +# ifdef HAVE_SGGLEXT_H + // Use SimGear GL extension support - really only for windows + if (!Map_Init_Ext(&fbo,&rbo,bufferSize)) + { + fprintf(stderr, "%s: Unable to initialize framebuffer.\n", appName); + cleanup(1); + } + if (verbose) { + printf("Framebuffer size: %dx%d\n", bufferSize, bufferSize); + } +# else + fprintf(stderr, "%s: GL Extended functions NOT supported!\n", appName); + cleanup(1); +# endif + } +#endif // Check if largest desired size will fit into a texture. In some // ways this is immaterial to Map. However, the user should be @@ -611,7 +656,7 @@ } else { printf("No maps to generate\n"); } - exit(1); + cleanup(1); } // Now we know where to get the scenery data, where to put the Index: src/Scenery.cxx =================================================================== RCS file: /cvsroot/atlas/Atlas/src/Scenery.cxx,v retrieving revision 1.23 diff -u -r1.23 Scenery.cxx --- src/Scenery.cxx 8 May 2010 02:54:17 -0000 1.23 +++ src/Scenery.cxx 9 May 2010 13:15:33 -0000 @@ -47,6 +47,10 @@ using namespace std; +#ifndef GL_CLAMP_TO_EDGE // this is defined in glext.h +#define GL_CLAMP_TO_EDGE 0x812F +#endif + // Drawing scenery is a little bit complex, mostly because of a desire // to maintain reasonable response and performance. We try to do only // the minimum amount of work, and we try not to do too much at one Index: src/Tiles.cxx =================================================================== RCS file: /cvsroot/atlas/Atlas/src/Tiles.cxx,v retrieving revision 1.7 diff -u -r1.7 Tiles.cxx --- src/Tiles.cxx 26 Apr 2010 21:15:29 -0000 1.7 +++ src/Tiles.cxx 9 May 2010 13:15:33 -0000 @@ -129,12 +129,23 @@ // thinks _maps has a file at the end, we add an empty item, thus // changing the path to "/Foo/Bar/", which will convince it that // the last thing is in fact a directory. +#ifdef _MSC_VER + size_t len = _maps.str().length(); + if (( len != 0 ) && (_maps.str().rfind("/") != (len - 1))) + _maps.append(""); +#else if (!_maps.file().empty()) { _maps.append(""); } +#endif // If the maps directory doesn't exist, try creating it if requested. - if (!_maps.exists() && createDirs) { +#ifdef _MSC_VER + if (!is_valid_path(_maps.str()) && createDirs) +#else + if (!_maps.exists() && createDirs) +#endif + { if (_maps.create_dir(0755) < 0) { // If we can't create it, throw an error. throw runtime_error("couldn't create maps directory"); Index: src/misc.cxx =================================================================== RCS file: /cvsroot/atlas/Atlas/src/misc.cxx,v retrieving revision 1.10 diff -u -r1.10 misc.cxx --- src/misc.cxx 6 May 2010 22:47:04 -0000 1.10 +++ src/misc.cxx 9 May 2010 13:15:33 -0000 @@ -35,6 +35,12 @@ #include #include +#ifdef _MSC_VER +#include +#define LROUND(a) SGMisc::round(a) +#else +#define LROUND(d) lround(d) +#endif ////////////////////////////////////////////////////////////////////// // atlasSphere ////////////////////////////////////////////////////////////////////// @@ -570,7 +576,7 @@ if (dms) { // Round degrees to the nearest hundredth of a second, then // chop it up into minutes and seconds. - double degs = lround(degrees * 3600.0 * 100.0) / (3600.0 * 100.0); + double degs = LROUND(degrees * 3600.0 * 100.0) / (3600.0 * 100.0); double mins = modf(degs, °s) * 60.0; double secs = modf(mins, &mins) * 60.0; str.printf("%02.0f%C %02.0f' %05.2f\"", degs, degreeSymbol, mins, secs);