Only in C:\FGCVS\Atlas: Atlas Only in C:\FGCVS\Atlas: atlas.sln Only in C:\FGCVS\Atlas: GetMap Only in C:\FGCVS\Atlas: Map Only in C:\FGCVS\Atlas: MapPS Only in Atlas-0.4.3: projects diff -ur C:\FGCVS\Atlas\src\AirportsOverlay.cxx Atlas-0.4.3\src\AirportsOverlay.cxx --- C:\FGCVS\Atlas\src\AirportsOverlay.cxx Fri Apr 02 04:34:22 2010 +++ Atlas-0.4.3\src\AirportsOverlay.cxx Thu Apr 15 19:50:48 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include @@ -32,6 +35,13 @@ #include "misc.hxx" #include "Geographics.hxx" +#ifdef _MSC_VER +#include +#define ROUND(a) SGMisc::round(a) +#else +#define ROUND(d) round(d) +#endif + using namespace std; void airportLatLon(ARP *ap); @@ -1151,7 +1161,7 @@ // it may be different on VFR charts. For now, though, we'll // use the '70 rule'. globalString.printf("%.0f", - round((maxRwy * SG_METER_TO_FEET - 20) / 100)); + ROUND((maxRwy * SG_METER_TO_FEET - 20) / 100)); lm.addText(globalString.str()); } diff -ur C:\FGCVS\Atlas\src\AirwaysOverlay.cxx Atlas-0.4.3\src\AirwaysOverlay.cxx --- C:\FGCVS\Atlas\src\AirwaysOverlay.cxx Sat Apr 17 15:06:17 2010 +++ Atlas-0.4.3\src\AirwaysOverlay.cxx Sat Apr 17 16:53:19 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include #include diff -ur C:\FGCVS\Atlas\src\Atlas.cxx Atlas-0.4.3\src\Atlas.cxx --- C:\FGCVS\Atlas\src\Atlas.cxx Wed Apr 14 19:06:50 2010 +++ Atlas-0.4.3\src\Atlas.cxx Thu Apr 15 15:50:50 2010 @@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#include "config.h" // For our version number #include #include @@ -37,8 +38,6 @@ #include #include -#include "config.h" // For our version number - #include "FlightTrack.hxx" #include "Tiles.hxx" #include "Search.hxx" @@ -53,6 +52,13 @@ #include "Palette.hxx" #include "Bucket.hxx" +#ifdef _MSC_VER +#include // for access() +#ifndef F_OK +#define F_OK 0 +#endif +#endif + using namespace std; // User preferences (including command-line arguments). @@ -589,7 +595,7 @@ glMatrixMode(GL_PROJECTION); glLoadIdentity(); - double left, right, bottom, top, near, far; + double left, right, bottom, top, d_near, d_far; right = window.width * globals.metresPerPixel / 2.0; left = -right; top = window.height * globals.metresPerPixel / 2.0; @@ -597,14 +603,14 @@ double l = sgdLengthVec3(eye); // near = l - SGGeodesy::EQURAD - 10000; - near = -100000.0; // EYE - magic number - far = l; // EYE - need better magic + d_near = -100000.0; // EYE - magic number + d_far = l; // EYE - need better magic // number (use bounds?) - glOrtho(left, right, bottom, top, near, far); + glOrtho(left, right, bottom, top, d_near, d_far); // Set our global frustum. This is used by various subsystems // to find out what's going on. - globals.frustum.setFrustum(left, right, bottom, top, near, far); + globals.frustum.setFrustum(left, right, bottom, top, d_near, d_far); } glPopAttrib(); @@ -3538,7 +3544,8 @@ // numeric_limits::max(). static double scanLatLon(puInput *p) { - float result = std::numeric_limits::max(); + //float result = std::numeric_limits::max(); + float result = std::numeric_limits::max(); char *buffer; p->getValue(&buffer); diff -ur C:\FGCVS\Atlas\src\Bucket.cxx Atlas-0.4.3\src\Bucket.cxx --- C:\FGCVS\Atlas\src\Bucket.cxx Fri Apr 09 07:00:10 2010 +++ Atlas-0.4.3\src\Bucket.cxx Thu Apr 15 15:17:24 2010 @@ -187,7 +187,7 @@ // and why we need to pass near and far and how they should be // defined. Should the RaySphere test be moved out? (Because it may // not be 100% reliable, and/or because it belongs higher up). -bool Bucket::intersection(SGVec3 near, SGVec3 far, +bool Bucket::intersection(SGVec3 d_near, SGVec3 d_far, SGVec3 *c) { // We don't try to do a "live" intersection unless we've actually @@ -204,7 +204,7 @@ // EYE - is it possible to *not* intersect the bounding sphere but // to intersect the bucket? We should check carefully how the // bounding sphere is defined. - if (!RaySphere(near, far, SGVec3(_bounds.center), _bounds.radius, + if (!RaySphere(d_near, d_far, SGVec3(_bounds.center), _bounds.radius, &mu1, &mu2)) { // Doesn't intersect our bounding sphere, so return false // immediately. @@ -245,7 +245,7 @@ const double scale = (double)numeric_limits::max(); double minZ = selectBuf[1] / scale; - *c = (far - near) * minZ + near; + *c = (d_far - d_near) * minZ + d_near; return true; } diff -ur C:\FGCVS\Atlas\src\CrosshairsOverlay.cxx Atlas-0.4.3\src\CrosshairsOverlay.cxx --- C:\FGCVS\Atlas\src\CrosshairsOverlay.cxx Fri Apr 09 06:14:54 2010 +++ Atlas-0.4.3\src\CrosshairsOverlay.cxx Thu Apr 15 15:27:50 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #if defined( __APPLE__) # include // Needed for gluOrtho2D(). diff -ur C:\FGCVS\Atlas\src\Culler.cxx Atlas-0.4.3\src\Culler.cxx --- C:\FGCVS\Atlas\src\Culler.cxx Thu Jul 16 11:53:17 2009 +++ Atlas-0.4.3\src\Culler.cxx Thu Apr 15 15:48:46 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include "Culler.hxx" #include "Globals.hxx" @@ -466,11 +469,11 @@ void Culler::FrustumSearch::zoom(double left, double right, double bottom, double top, - double near, double far) + double d_near, double d_far) { // EYE - change to setOrtho(w, h), and have near and far set to // contants (eg, earth radius)? - _frustum.setOrtho(left, right, bottom, top, near, far); + _frustum.setOrtho(left, right, bottom, top, d_near, d_far); _setDirty(true); } Only in Atlas-0.4.3\src\data\CVS: Entries.Log diff -ur C:\FGCVS\Atlas\src\FixesOverlay.cxx Atlas-0.4.3\src\FixesOverlay.cxx --- C:\FGCVS\Atlas\src\FixesOverlay.cxx Tue Jan 26 23:46:11 2010 +++ Atlas-0.4.3\src\FixesOverlay.cxx Thu Apr 15 15:48:46 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version, and lots more ;=)) +#endif #include #include diff -ur C:\FGCVS\Atlas\src\FlightTrack.cxx Atlas-0.4.3\src\FlightTrack.cxx --- C:\FGCVS\Atlas\src\FlightTrack.cxx Wed Apr 14 19:06:50 2010 +++ Atlas-0.4.3\src\FlightTrack.cxx Thu Apr 15 15:13:54 2010 @@ -21,6 +21,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include diff -ur C:\FGCVS\Atlas\src\FlightTracksOverlay.cxx Atlas-0.4.3\src\FlightTracksOverlay.cxx --- C:\FGCVS\Atlas\src\FlightTracksOverlay.cxx Tue Jan 26 05:46:12 2010 +++ Atlas-0.4.3\src\FlightTracksOverlay.cxx Thu Apr 15 15:13:54 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include diff -ur C:\FGCVS\Atlas\src\Globals.cxx Atlas-0.4.3\src\Globals.cxx --- C:\FGCVS\Atlas\src\Globals.cxx Fri Feb 05 06:21:02 2010 +++ Atlas-0.4.3\src\Globals.cxx Thu Apr 15 15:13:54 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include #include diff -ur C:\FGCVS\Atlas\src\Graphs.cxx Atlas-0.4.3\src\Graphs.cxx --- C:\FGCVS\Atlas\src\Graphs.cxx Wed Apr 14 19:06:50 2010 +++ Atlas-0.4.3\src\Graphs.cxx Thu Apr 15 15:54:16 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include #include @@ -1387,7 +1390,7 @@ // Break it down into an exponent (base-10) and mantissa. int exponent = floor(log10(actual)); - float mantissa = actual / pow(10, exponent); + float mantissa = actual / pow(10.0, exponent); // Our heuristic: good mantissa values are 2, 5, and 10. We move // up from our actual mantissa to the next good mantissa value, @@ -1397,13 +1400,13 @@ // negative - I assume that printf() is smart enough to handle // this. if (mantissa < 2) { - _d = 2 * pow(10, exponent); + _d = 2 * pow(10.0, exponent); _decimals = -exponent - 1; } else if (mantissa < 5) { - _d = 5 * pow(10, exponent); + _d = 5 * pow(10.0, exponent); _decimals = -exponent; } else { - _d = 10 * pow(10, exponent); + _d = 10 * pow(10.0, exponent); _decimals = -exponent - 1; } // Large ticks are always placed every 5 small ticks. @@ -1749,7 +1752,7 @@ // The glideslope's heading is given by the lower 3 digits of the // magvar variable. The thousands and above give slope: // ssshhh.hhh. - *heading = fmod(n->magvar, 1000.0); + *heading = fmod((double)n->magvar, 1000.0); *slope = (n->magvar - *heading) / 1e5; } diff -ur C:\FGCVS\Atlas\src\Image.cxx Atlas-0.4.3\src\Image.cxx --- C:\FGCVS\Atlas\src\Image.cxx Fri Apr 09 06:55:38 2010 +++ Atlas-0.4.3\src\Image.cxx Thu Apr 15 15:56:53 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version, and lots more ;=)) +#endif #include diff -ur C:\FGCVS\Atlas\src\Map.cxx Atlas-0.4.3\src\Map.cxx --- C:\FGCVS\Atlas\src\Map.cxx Wed Apr 14 19:06:51 2010 +++ Atlas-0.4.3\src\Map.cxx Sat Apr 24 18:49:50 2010 @@ -37,9 +37,14 @@ 2005-02-26 FB: Arbitrary size by tiling. Move fg_set_scenery to a specific file. ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version, and lots more ;=)) +#endif // EYE - put in configure.ac somehow? +#ifndef VERSION #define VERSION "0.4.0" +#endif #include #include @@ -50,6 +55,15 @@ #include +#ifdef _MSC_VER +#include +#endif +#define GL_GLEXT_PROTOTYPES +#include +#if (defined(HAVE_GLEXT_H) || !defined(EXCLUDE_GLEXT_H)) +#include +#endif + #include #include @@ -235,6 +249,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(); @@ -246,8 +263,24 @@ return true; } +#if (defined(HAVE_GLEXT_H) || !defined(EXCLUDE_GLEXT_H)) bool getFramebuffer(int textureSize) { +#if (defined(__GLEW_H__)||defined(__glew_h__)) +#ifdef _MSC_VER +#pragma message("Compiled with GLEXT supplied by GLEW 1.5.3") +#endif + GLenum err = glewInit(); + if (err != GLEW_OK) + { + /* Problem: glewInit failed, something is seriously wrong. */ + fprintf(stderr, "Error: glewInit FAILED!\n%s\n", glewGetErrorString(err)); + exit(1); + } + if (verbose) + printf("Status: Using GLEW %s\n", glewGetString(GLEW_VERSION)); +#endif + glGenFramebuffersEXT(1, &fbo); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo); @@ -263,6 +296,11 @@ return (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT); } +#else +#ifdef _MSC_VER +#pragma message("Compiled WITHOUT GLEXT!") +#endif +#endif // Attempts to load a palette at the given path. Returns the palette // if successful, NULL otherwise. @@ -289,12 +327,14 @@ 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); } +#endif if (mapper) { delete mapper; } @@ -484,6 +524,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. @@ -505,6 +546,7 @@ printf("Framebuffer size: %dx%d\n", bufferSize, bufferSize); } } +#endif // Check if largest desired size will fit into a texture. In some // ways this is immaterial to Map. However, the user should be diff -ur C:\FGCVS\Atlas\src\misc.cxx Atlas-0.4.3\src\misc.cxx --- C:\FGCVS\Atlas\src\misc.cxx Sat Apr 17 15:06:17 2010 +++ Atlas-0.4.3\src\misc.cxx Sat Apr 17 16:53:19 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For va_copy in windows +#endif #include #include diff -ur C:\FGCVS\Atlas\src\NavaidsOverlay.cxx Atlas-0.4.3\src\NavaidsOverlay.cxx --- C:\FGCVS\Atlas\src\NavaidsOverlay.cxx Sat Apr 17 15:06:17 2010 +++ Atlas-0.4.3\src\NavaidsOverlay.cxx Sat Apr 17 16:53:19 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include diff -ur C:\FGCVS\Atlas\src\Overlays.cxx Atlas-0.4.3\src\Overlays.cxx --- C:\FGCVS\Atlas\src\Overlays.cxx Wed Apr 14 19:06:51 2010 +++ Atlas-0.4.3\src\Overlays.cxx Thu Apr 15 15:13:54 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include #include diff -ur C:\FGCVS\Atlas\src\Preferences.cxx Atlas-0.4.3\src\Preferences.cxx --- C:\FGCVS\Atlas\src\Preferences.cxx Wed Apr 14 19:06:51 2010 +++ Atlas-0.4.3\src\Preferences.cxx Thu Apr 15 20:18:06 2010 @@ -20,11 +20,15 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version, and lots more ;=)) +#endif #include #include -#include "config.h" +#ifndef _MSC_VER #include "libgen.h" +#endif #include #include diff -ur C:\FGCVS\Atlas\src\Scenery.cxx Atlas-0.4.3\src\Scenery.cxx --- C:\FGCVS\Atlas\src\Scenery.cxx Wed Apr 14 19:06:51 2010 +++ Atlas-0.4.3\src\Scenery.cxx Fri Apr 16 14:51:47 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version, and lots more ;=)) +#endif #include @@ -164,7 +167,9 @@ unsigned int _size; }; +#ifndef _MSC_VER const int Texture::__defaultSize; +#endif GLubyte Texture::__defaultImage[Texture::__defaultSize][Texture::__defaultSize][3]; GLuint Texture::__defaultTexture = 0; @@ -236,8 +241,10 @@ // Smoothed, no fade-offs, but a sharp border between tiles. This // is not apparent until zoomed pretty close. +#ifdef GL_CLAMP_TO_EDGE glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); +#endif glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); @@ -1170,11 +1177,11 @@ // Near depth plane intersection. gluUnProject (x, y, 0.0, mvmatrix, projmatrix, viewport, &wx, &wy, &wz); - SGVec3 near(wx, wy, wz); + SGVec3 d_near(wx, wy, wz); // Far depth plane intersection. gluUnProject (x, y, 1.0, mvmatrix, projmatrix, viewport, &wx, &wy, &wz); - SGVec3 far(wx, wy, wz); + SGVec3 d_far(wx, wy, wz); // If validElevation is not NULL, that means the caller is // interested in a valid elevation result, which means we must @@ -1207,7 +1214,7 @@ if (!t) { continue; } - if (t->intersection(near, far, c)) { + if (t->intersection(d_near, d_far, c)) { // Found one! Since the tile found the // intersection using one of its buckets (ie, live // scenery), we know that the elevation value is @@ -1239,16 +1246,16 @@ assert((validElevation == NULL) || (*validElevation == false)); SGVec3 centre(0.0, 0.0, 0.0); double mu1, mu2; - near[2] *= SGGeodesy::STRETCH; - far[2] *= SGGeodesy::STRETCH; - if (RaySphere(near, far, centre, SGGeodesy::EQURAD, &mu1, &mu2)) { + d_near[2] *= SGGeodesy::STRETCH; + d_far[2] *= SGGeodesy::STRETCH; + if (RaySphere(d_near, d_far, centre, SGGeodesy::EQURAD, &mu1, &mu2)) { SGVec3 s1, s2; - s1 = near + mu1 * (far - near); - s2 = near + mu2 * (far - near); + s1 = d_near + mu1 * (d_far - d_near); + s2 = d_near + mu2 * (d_far - d_near); // Take the nearest intersection (the other is on the other // side of the world). - if (dist(near, s1) < dist(near, s2)) { + if (dist(d_near, s1) < dist(d_near, s2)) { // Unstretch the world. s1[2] /= SGGeodesy::STRETCH; *c = s1; diff -ur C:\FGCVS\Atlas\src\Search.cxx Atlas-0.4.3\src\Search.cxx --- C:\FGCVS\Atlas\src\Search.cxx Wed Apr 14 19:06:51 2010 +++ Atlas-0.4.3\src\Search.cxx Thu Apr 15 15:36:51 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version, and lots more ;=)) +#endif #include "Search.hxx" diff -ur C:\FGCVS\Atlas\src\Searcher.cxx Atlas-0.4.3\src\Searcher.cxx --- C:\FGCVS\Atlas\src\Searcher.cxx Fri Jun 12 11:19:51 2009 +++ Atlas-0.4.3\src\Searcher.cxx Fri Apr 16 14:39:53 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For our version number, and lots more ;=)) +#endif #include "Searcher.hxx" @@ -120,7 +123,11 @@ // The value of 'str' in the previous call. static string lastSearchString; // The end of the last search (-1 if a new search). +#ifdef _MSC_VER + static multimap::const_iterator end = _tokens.end(); +#else static multimap::const_iterator end = _tokens.end(); +#endif // The complete search token(s). static vector completeSearchTokens; // Partial search token. @@ -220,7 +227,11 @@ return changed; } +#ifdef _MSC_VER + multimap::const_iterator i; +#else multimap::const_iterator i; +#endif int noOfMatches; // If end is _tokens.end(), that means we're beginning a new search. @@ -294,7 +305,11 @@ } // EYE - not too efficient. +#ifdef _MSC_VER + set::const_iterator iter = _matches->begin(); +#else set::const_iterator iter = _matches->begin(); +#endif for (unsigned int j = 0; j < i; j++) { iter++; } diff -ur C:\FGCVS\Atlas\src\Subbucket.cxx Atlas-0.4.3\src\Subbucket.cxx --- C:\FGCVS\Atlas\src\Subbucket.cxx Sat Apr 10 07:25:50 2010 +++ Atlas-0.4.3\src\Subbucket.cxx Wed Apr 21 16:42:54 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include @@ -521,8 +524,11 @@ } int_list& indices = _contours[i]; + if (indices.size() >= 3) glDrawElements(GL_TRIANGLES, indices.size(), GL_UNSIGNED_INT, &(indices[0])); + //else + // printf("WARNING: Number of contours less than 3 = %d\n", indices.size()); } } glPopClientAttrib(); diff -ur C:\FGCVS\Atlas\src\Subbucket.hxx Atlas-0.4.3\src\Subbucket.hxx --- C:\FGCVS\Atlas\src\Subbucket.hxx Fri Apr 09 05:05:15 2010 +++ Atlas-0.4.3\src\Subbucket.hxx Tue Apr 20 19:36:33 2010 @@ -37,9 +37,13 @@ #include #include +#if (defined(_MSC_VER) && !defined(HAVE_TRI_UNORDERED)) +#include +#include +#else #include #include - +#endif #include #include diff -ur C:\FGCVS\Atlas\src\Tiles.cxx Atlas-0.4.3\src\Tiles.cxx --- C:\FGCVS\Atlas\src\Tiles.cxx Fri Apr 09 07:25:33 2010 +++ Atlas-0.4.3\src\Tiles.cxx Sat Apr 17 19:22:34 2010 @@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License along with Atlas. If not, see . ---------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" // For version number, and lots more ;=)) +#endif #include #include @@ -31,6 +34,13 @@ #include "Tiles.hxx" +#ifdef _MSC_VER +#include +#define ROUND(a) SGMisc::round(a) +#else +#define ROUND(d) round(d) +#endif + using namespace std; //////////////////////////////////////////////////////////////////////////////// @@ -118,12 +128,26 @@ // 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 + // now need to append the '/' - note: FG ALWAYS uses '/' as the path separator - UNCONDITIONAL + size_t len = _maps.str().length(); + if (( len != 0) && + (_maps.str().rfind("/") != (len - 1))) { + _maps.append(""); + } + // following ulOpenDir() does not mind if '/' has been added +#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"); @@ -342,7 +366,7 @@ _missingMaps = mapLevels; // Get the SW corner of our tile. - char ns, ew; + char ns = 'n', ew = 'e'; assert(sscanf(name, "%c%3d%c%2d", &ew, &_lon, &ns, &_lat) == 4); if (ew == 'w') { _lon = -_lon; @@ -424,7 +448,7 @@ double w = *height * cos(centreLat() * SGD_DEGREES_TO_RADIANS) * _width; // Oh yeah, and it has to be a power of 2, and non-zero. - *width = pow(2.0, round(log2f(w))); + *width = pow(2.0, ROUND(log2f(w))); if (*width == 0) { *width = 1; }