summaryrefslogtreecommitdiff
path: root/games-util/atlas/files/atlas-0.5.1_beta_pre20160907-simgear-compilation.patch
blob: f6e4d58bf3b2e6e245886c725c9beeb278886a29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
diff -r e183e3b3a041 configure.ac
--- a/configure.ac	Tue Sep 06 22:12:05 2016 -0700
+++ b/configure.ac	Sat Mar 18 05:09:04 2017 +0100
@@ -10,6 +10,8 @@
 AC_PREREQ(2.52)
 AM_INIT_AUTOMAKE
 
+CXXFLAGS="-std=c++11"
+
 dnl Checks for programs.
 AC_PROG_MAKE_SET
 AC_PROG_CC
diff -r e183e3b3a041 src/FlightTrack.cxx
--- a/src/FlightTrack.cxx	Tue Sep 06 22:12:05 2016 -0700
+++ b/src/FlightTrack.cxx	Sat Mar 18 05:09:04 2017 +0100
@@ -81,7 +81,7 @@
 	throw runtime_error("flight file open failure");
     }
 
-    _file.set(filePath);
+    _file = SGPath(filePath);
 
     _port = -1;
     _device = "";
@@ -101,7 +101,7 @@
     _input_channel = new SGSocket("", portStr.str(), "udp");
     _input_channel->open(SG_IO_IN);
 
-    _file.set("");
+    _file = SGPath();
 
     _port = port;
     _device = "";
@@ -123,7 +123,7 @@
     _input_channel = new SGSerial(device, baudStr.str());
     _input_channel->open(SG_IO_IN);
 
-    _file.set("");
+    _file = SGPath();
 
     _port = -1;
     _device = device;
@@ -399,11 +399,11 @@
     return _name.str();
 }
 
-void FlightTrack::setFilePath(char *path)
+void FlightTrack::setFilePath(const char *path)
 {
     // EYE - check for existing name?  overwriting?
     // EYE - call this (and other accessors) from constructors?
-    _file.set(path);
+    _file = SGPath(path);
     // We count this as a change.
     _version++;
     _versionAtLastSave = 0;
diff -r e183e3b3a041 src/FlightTrack.hxx
--- a/src/FlightTrack.hxx	Tue Sep 06 22:12:05 2016 -0700
+++ b/src/FlightTrack.hxx	Sat Mar 18 05:09:04 2017 +0100
@@ -141,7 +141,7 @@
     const char *fileName();	// File name
     const char *filePath();	// Full path, including file
     const char *niceName();	// Nicely formatted name
-    void setFilePath(char *path);
+    void setFilePath(const char *path);
     void save();
     bool modified();
 
diff -r e183e3b3a041 src/Geographics.cxx
--- a/src/Geographics.cxx	Tue Sep 06 22:12:05 2016 -0700
+++ b/src/Geographics.cxx	Sat Mar 18 05:09:04 2017 +0100
@@ -25,6 +25,7 @@
 #include "Geographics.hxx"
 
 // C++ system files
+#include <cmath>
 #include <stdexcept>
 
 // Our project's include files
@@ -431,11 +432,11 @@
 bool AtlasCoord::_geodValid() const
 {
     // Note: this has to agree with the value set in invalidate()!
-    return !isnan(_geod.getLatitudeDeg());
+    return !std::isnan(_geod.getLatitudeDeg());
 }
 
 bool AtlasCoord::_cartValid() const
 {
     // Note: this has to agree with the value set in invalidate()!
-    return !isnan(_cart.x());
+    return !std::isnan(_cart.x());
 }
diff -r e183e3b3a041 src/Map.cxx
--- a/src/Map.cxx	Tue Sep 06 22:12:05 2016 -0700
+++ b/src/Map.cxx	Sat Mar 18 05:09:04 2017 +0100
@@ -168,13 +168,13 @@
 bool parse_arg(char* arg) 
 {
     if (strncmp(arg, "--fg-root=", 10) == 0) {
-	fg_root.set(arg + 10);
+	fg_root = SGPath(arg + 10);
     } else if (strncmp(arg, "--fg-scenery=", 13) == 0) {
-	scenery.set(arg + 13);
+	scenery = SGPath(arg + 13);
     } else if (strncmp(arg, "--atlas=", 8) == 0) {
-	atlas.set(arg + 8);
+	atlas = SGPath(arg + 8);
     } else if (strncmp(arg, "--palette=", 10) == 0) {
-	palette.set(arg + 10);
+	palette = SGPath(arg + 10);
     } else if (strcmp(arg, "--png") == 0) {
 	imageType = TileMapper::PNG;
     } else if (strcmp(arg, "--jpeg") == 0) {
@@ -272,23 +272,14 @@
     // Read the FG_ROOT and FG_SCENERY environment variables before
     // processing .atlasmaprc and command args, so that we can
     // override them if necessary.
-    char *env = getenv("FG_ROOT");
-    if (env == NULL) {
-	// EYE - is it possible for this to not be defined?
-	fg_root.set(FGBASE_DIR);
-    } else {
-	fg_root.set(env);
-    }
 
-    env = getenv("FG_SCENERY");
-    if (env == NULL) {
-	fg_scenery.set(fg_root.str() + "/Scenery");
-    } else {
-	fg_scenery.set(env);
-    }
+    // EYE - is it possible for this to not be defined?
+    fg_root = SGPath::fromEnv("FG_ROOT", SGPath(FGBASE_DIR));
+
+    fg_scenery = SGPath::fromEnv("FG_SCENERY", fg_root.str() + "/Scenery");
 
     // Set a default palette.
-    palette.set("default.ap");
+    palette = SGPath("default.ap");
 
     // Process ~/.atlasmaprc.
     char* homedir = getenv("HOME");
@@ -332,10 +323,10 @@
 	// 'scenery'.  We're done.
     } else if (!fg_scenery.str().empty()) {
 	// From FG_SCENERY
-	scenery.set(fg_scenery.str());
+	scenery = SGPath(fg_scenery.str());
     } else if (!fg_root.str().empty()) {
 	// Default: $FG_ROOT/Scenery
-	scenery.set(fg_root.str());
+	scenery = SGPath(fg_root.str());
 	scenery.append("Scenery");
     } else {
 	fprintf(stderr, "%s: No scenery directory specified.", appName);
@@ -356,7 +347,7 @@
     } else if (!fg_root.str().empty()) {
 	// EYE - make default $HOME/Atlas?
 	// Default: $FG_ROOT/Atlas
-	atlas.set(fg_root.str());
+	atlas = SGPath(fg_root.str());
 	atlas.append("Atlas");
     } else {
 	fprintf(stderr, "%s: No map directory specified.", appName);
@@ -394,11 +385,11 @@
     SGPath palettePath;
     palettePath.append(palette.str());
     if ((atlasPalette = loadPalette(palettePath.c_str())) == NULL) {
-	palettePath.set(atlas.str());
+	palettePath = SGPath(atlas.str());
 	palettePath.append("Palettes");
 	palettePath.append(palette.str());
 	if ((atlasPalette = loadPalette(palettePath.c_str())) == NULL) {
-	    palettePath.set(fg_root.str());
+	    palettePath = SGPath(fg_root.str());
 	    palettePath.append("Atlas");
 	    palettePath.append("Palettes");
 	    palettePath.append(palette.str());
diff -r e183e3b3a041 src/Preferences.cxx
--- a/src/Preferences.cxx	Tue Sep 06 22:12:05 2016 -0700
+++ b/src/Preferences.cxx	Sat Mar 18 05:09:04 2017 +0100
@@ -317,7 +317,7 @@
 {
     string buf;
     is >> buf;
-    p.set(buf);
+    p = SGPath(buf);
 
     return is;
 }
@@ -638,7 +638,7 @@
     // EYE - just get()?
     SGPath p(fg_root.get(Pref::FACTORY));
     if (p.isNull()) {
-	p.set(FGBASE_DIR);
+	p = SGPath(FGBASE_DIR);
     }
     p.append("Atlas");
     path.set(p, Pref::FACTORY);
@@ -770,10 +770,10 @@
     char* homedir = getenv("HOME");
     SGPath rcpath;
     if (homedir != NULL) {
-	rcpath.set(homedir);
+	rcpath = SGPath(homedir);
 	rcpath.append(atlasrc);
     } else {
-	rcpath.set(atlasrc);
+	rcpath = SGPath(atlasrc);
     }
 
     ifstream rc(rcpath.c_str());
@@ -946,7 +946,7 @@
     }
     SGPath p;
     while (optind < argc) {
-	p.set(argv[optind++]);
+	p = SGPath(argv[optind++]);
 	flightFiles.push_back(p);
     }
 
diff -r e183e3b3a041 src/Scenery.cxx
--- a/src/Scenery.cxx	Tue Sep 06 22:12:05 2016 -0700
+++ b/src/Scenery.cxx	Sat Mar 18 05:09:04 2017 +0100
@@ -198,7 +198,7 @@
 	data = (GLubyte *)loadJPEG(f.c_str(), &width, &height, &depth, 
 				   maximumElevation);
 	if (!data) {
-	    f.set(f.base());
+	    f = SGPath(f.base());
 	    f.concat(".png");
 	    data = (GLubyte *)loadPNG(f.c_str(), &width, &height, &depth,
 				      maximumElevation);
diff -r e183e3b3a041 src/Subbucket.cxx
--- a/src/Subbucket.cxx	Tue Sep 06 22:12:05 2016 -0700
+++ b/src/Subbucket.cxx	Sat Mar 18 05:09:04 2017 +0100
@@ -346,10 +346,10 @@
     // http://wiki.flightgear.org/index.php/BTG_File_Format
 
     SGBinObject btg;
-    if (!btg.read_bin(_path.c_str())) {
-	// EYE - throw an error?
-	// EYE - will the cache continue to call load() then?
-	return false;
+    if (!btg.read_bin(SGPath(_path))) {
+        // EYE - throw an error?
+        // EYE - will the cache continue to call load() then?
+        return false;
     }
 
     //////////////////////////////////////////////////////////////////////
diff -r e183e3b3a041 src/Tiles.cxx
--- a/src/Tiles.cxx	Tue Sep 06 22:12:05 2016 -0700
+++ b/src/Tiles.cxx	Sat Mar 18 05:09:04 2017 +0100
@@ -464,7 +464,7 @@
 const SGPath& TileManager::mapPath(unsigned int level)
 {
     static SGPath result;
-    result.set(_maps.str());
+    result = SGPath(_maps.str());
 
     char str[3];
     snprintf(str, 3, "%d", level);
@@ -821,7 +821,7 @@
 const SGPath& Tile::sceneryDir()
 {
     if (_sceneryIndex == TileManager::NaPI) {
-	__sceneryPath = "";
+	__sceneryPath = SGPath();
     } else {
 	__sceneryPath = _tm->sceneryPaths()[_sceneryIndex];
 	__sceneryPath.append(chunk()->name());