Only in Atlas-0.4.8: projects diff -ur C:\FGCVS\Atlas\src\Atlas.cxx Atlas-0.4.8\src\Atlas.cxx --- C:\FGCVS\Atlas\src\Atlas.cxx Sat May 08 11:53:59 2010 +++ Atlas-0.4.8\src\Atlas.cxx Fri May 07 16:53:49 2010 @@ -581,10 +581,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) { } Only in Atlas-0.4.8\src: Atlas.cxx.bak Only in Atlas-0.4.8\src: Globals.hxx.bak diff -ur C:\FGCVS\Atlas\src\Map.cxx Atlas-0.4.8\src\Map.cxx --- C:\FGCVS\Atlas\src\Map.cxx Tue Apr 27 15:58:57 2010 +++ Atlas-0.4.8\src\Map.cxx Sat May 08 17:44:24 2010 @@ -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 diff -ur C:\FGCVS\Atlas\src\misc.cxx Atlas-0.4.8\src\misc.cxx --- C:\FGCVS\Atlas\src\misc.cxx Fri May 07 16:33:43 2010 +++ Atlas-0.4.8\src\misc.cxx Fri May 07 16:49:17 2010 @@ -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); Only in Atlas-0.4.8\src: Preferences.cxx.bak Only in Atlas-0.4.8\src: Preferences.hxx.bak diff -ur C:\FGCVS\Atlas\src\Scenery.cxx Atlas-0.4.8\src\Scenery.cxx --- C:\FGCVS\Atlas\src\Scenery.cxx Sat May 08 11:54:00 2010 +++ Atlas-0.4.8\src\Scenery.cxx Sat May 08 12:38:39 2010 @@ -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 Only in Atlas-0.4.8\src: Scenery.cxx.bak diff -ur C:\FGCVS\Atlas\src\Tiles.cxx Atlas-0.4.8\src\Tiles.cxx --- C:\FGCVS\Atlas\src\Tiles.cxx Tue Apr 27 15:58:58 2010 +++ Atlas-0.4.8\src\Tiles.cxx Thu May 06 19:57:27 2010 @@ -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");