updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / flightgear-atlas / build-fix.patch
blob5f190d38631d20f65c097938dca8bad16c071317
1 diff -wbBur Atlas-0.3.1/src/Atlas.cxx Atlas-0.3.1.my/src/Atlas.cxx
2 --- Atlas-0.3.1/src/Atlas.cxx 2006-10-28 16:28:32.000000000 +0000
3 +++ Atlas-0.3.1.my/src/Atlas.cxx 2009-03-11 16:33:33.000000000 +0000
4 @@ -29,7 +29,7 @@
5 #include <memory.h>
6 #include <stdio.h>
7 #include <simgear/compiler.h>
8 -#include SG_GLUT_H
9 +#include <GL/glut.h>
10 #include <plib/fnt.h>
11 #include <plib/pu.h>
12 #include <string>
13 @@ -40,6 +40,8 @@
14 #include "Overlays.hxx"
15 #include "FlightTrack.hxx"
17 +#include <iostream>
19 #define SCALECHANGEFACTOR 1.3f
21 SGIOChannel *input_channel;
22 @@ -345,7 +347,7 @@
24 string nav1_freq_str = msg.substr(begin, end - begin);
25 begin = end + 1;
26 - cout << " nav1_freq = " << nav1_freq_str << endl;
27 + std::cout << " nav1_freq = " << nav1_freq_str << std::endl;
29 // nav1 selected radial
30 end = msg.find(",", begin);
31 @@ -355,7 +357,7 @@
33 string nav1_rad_str = msg.substr(begin, end - begin);
34 begin = end + 1;
35 - cout << " nav1_rad = " << nav1_rad_str << endl;
36 + std::cout << " nav1_rad = " << nav1_rad_str << std::endl;
38 // nav2 freq
39 end = msg.find(",", begin);
40 @@ -365,7 +367,7 @@
42 string nav2_freq_str = msg.substr(begin, end - begin);
43 begin = end + 1;
44 - cout << " nav2_freq = " << nav2_freq_str << endl;
45 + std::cout << " nav2_freq = " << nav2_freq_str << std::endl;
47 // nav2 selected radial
48 end = msg.find(",", begin);
49 @@ -375,7 +377,7 @@
51 string nav2_rad_str = msg.substr(begin, end - begin);
52 begin = end + 1;
53 - cout << " nav2_rad = " << nav2_rad_str << endl;
54 + std::cout << " nav2_rad = " << nav2_rad_str << std::endl;
56 // adf freq
57 end = msg.find("*", begin);
58 @@ -385,7 +387,7 @@
60 string adf_freq_str = msg.substr(begin, end - begin);
61 begin = end + 1;
62 - cout << " adf_freq = " << adf_freq_str << endl;
63 + std::cout << " adf_freq = " << adf_freq_str << std::endl;
65 nav1_freq = atof( nav1_freq_str.c_str() );
66 nav1_rad = atof( nav1_rad_str.c_str() ) *
67 diff -wbBur Atlas-0.3.1/src/FlightTrack.cxx Atlas-0.3.1.my/src/FlightTrack.cxx
68 --- Atlas-0.3.1/src/FlightTrack.cxx 2003-01-07 21:51:12.000000000 +0000
69 +++ Atlas-0.3.1.my/src/FlightTrack.cxx 2009-03-11 16:33:33.000000000 +0000
70 @@ -29,7 +29,7 @@
73 FlightTrack::~FlightTrack() {
74 - for (list<FlightData*>::iterator i = track.begin(); i != track.end(); i++) {
75 + for (std::list<FlightData*>::iterator i = track.begin(); i != track.end(); i++) {
76 delete *i;
79 diff -wbBur Atlas-0.3.1/src/FlightTrack.hxx Atlas-0.3.1.my/src/FlightTrack.hxx
80 --- Atlas-0.3.1/src/FlightTrack.hxx 2003-01-07 21:51:12.000000000 +0000
81 +++ Atlas-0.3.1.my/src/FlightTrack.hxx 2009-03-11 16:33:30.000000000 +0000
82 @@ -27,7 +27,7 @@
83 #include <plib/sg.h>
84 #include <simgear/compiler.h>
86 -SG_USING_STD(list);
87 +#include <list>
89 struct FlightData {
90 float lat, lon, alt, hdg, spd;
91 @@ -51,8 +51,8 @@
92 protected:
93 unsigned int max_buffer;
95 - list<FlightData*> track;
96 - list<FlightData*>::iterator track_pos;
97 + std::list<FlightData*> track;
98 + std::list<FlightData*>::iterator track_pos;
102 diff -wbBur Atlas-0.3.1/src/Map.cxx Atlas-0.3.1.my/src/Map.cxx
103 --- Atlas-0.3.1/src/Map.cxx 2006-10-26 21:45:05.000000000 +0000
104 +++ Atlas-0.3.1.my/src/Map.cxx 2009-03-11 16:35:10.000000000 +0000
105 @@ -39,7 +39,7 @@
106 #include <plib/ul.h>
108 #include <simgear/compiler.h>
109 -#include SG_GL_H
110 +#include <GL/gl.h>
111 #ifdef UL_GLX
112 # define GLX_GLXEXT_PROTOTYPES
113 # ifdef __APPLE__
114 @@ -50,7 +50,7 @@
115 #elif defined UL_WIN32
116 # include <windows.h>
117 #endif
118 -#include SG_GLUT_H
119 +#include <GL/glut.h>
120 #include <stdlib.h>
121 #include <stdio.h>
122 #include <sys/stat.h>
123 @@ -65,10 +65,10 @@
124 #include <simgear/screen/RenderTexture.h>
125 #include "Scenery.hxx"
126 #include <vector>
127 -#include STL_STRING
128 +#include <string>
130 -SG_USING_STD(vector);
131 -SG_USING_STD(string);
132 +#include <vector>
133 +#include <iostream>
135 typedef vector<string> string_list;
137 @@ -319,9 +319,9 @@
140 bool ContinueIfNoHeadless() {
141 - cout << "Unable to continue in headless mode - revert to doublebuffer mode? [Y/n] ";
142 + std::cout << "Unable to continue in headless mode - revert to doublebuffer mode? [Y/n] ";
143 char c;
144 - cin >> c;
145 + std::cin >> c;
146 return((c == 'n' || c == 'N') ? false : true);
149 @@ -439,7 +439,7 @@
150 scenerypath = new char[max_path_length + 256];
151 scenery_pos = 0;
152 } else {
153 - cout << "No scenery paths could be found. You need to set either a valid FG_ROOT and/or FG_SCENERY variable, or specify a valid --fg-root and/or --fg-scenery on the command line.\n";
154 + std::cout << "No scenery paths could be found. You need to set either a valid FG_ROOT and/or FG_SCENERY variable, or specify a valid --fg-root and/or --fg-scenery on the command line.\n";
155 exit(-1);
158 @@ -467,7 +467,7 @@
160 dir1 = ulOpenDir(outp);
161 if(NULL == dir1) {
162 - cout << "Unable to create requested Atlas map directory " << outp << "... exiting :-(\n";
163 + std::cout << "Unable to create requested Atlas map directory " << outp << "... exiting :-(\n";
164 exit(-1);
167 @@ -502,17 +502,17 @@
168 if(dir1 != NULL) {
169 path_found = true;
170 scenerypath[sz] = '\0';
171 - //cout << "Scenerypath found, = " << scenerypath << '\n';
172 + //std::cout << "Scenerypath found, = " << scenerypath << '\n';
173 break;
175 - //cout << scenerypath << (dir1 == NULL ? " does not exist..." : " exists!") << '\n';
176 + //std::cout << scenerypath << (dir1 == NULL ? " does not exist..." : " exists!") << '\n';
178 if(!path_found) {
179 - cout << "Unable to find required subdirectory " << dpath1 << '/' << dpath2 << " on the available scenery paths:\n";
180 + std::cout << "Unable to find required subdirectory " << dpath1 << '/' << dpath2 << " on the available scenery paths:\n";
181 for(unsigned int i = 0; i < fg_scenery.size(); ++i) {
182 - cout << fg_scenery[i] << '\n';
183 + std::cout << fg_scenery[i] << '\n';
185 - cout << "... unable to continue - exiting!\n";
186 + std::cout << "... unable to continue - exiting!\n";
187 exit(-1);
190 diff -wbBur Atlas-0.3.1/src/MapBrowser.cxx Atlas-0.3.1.my/src/MapBrowser.cxx
191 --- Atlas-0.3.1/src/MapBrowser.cxx 2005-09-29 19:18:01.000000000 +0000
192 +++ Atlas-0.3.1.my/src/MapBrowser.cxx 2009-03-11 16:33:33.000000000 +0000
193 @@ -112,7 +112,7 @@
195 void MapBrowser::changeResolution(char *path) {
196 MapTile *tile;
197 - list<MapTile*>::iterator i = tiles.end(),
198 + std::list<MapTile*>::iterator i = tiles.end(),
199 itmp;
200 i--;
201 while (tiles.begin() != tiles.end()) {
202 @@ -171,7 +171,7 @@
203 glEnable( GL_TEXTURE_2D );
204 GLfloat tilesize = earth_radius_lat(clat) * SG_DEGREES_TO_RADIANS;
206 - for (list<MapTile*>::iterator i = tiles.begin(); i != tiles.end(); i++) {
207 + for (std::list<MapTile*>::iterator i = tiles.begin(); i != tiles.end(); i++) {
208 MapTile *tile = *i;
209 if ( tile->tex ) {
210 GLfloat dxs = 0.5f;
211 @@ -237,7 +237,7 @@
212 if (max_lat > 90) max_lat = 90;
213 int num_lat = (max_lat - min_lat) + 1, num_lon = (max_lon - min_lon) + 1;
215 - for (list<MapTile*>::iterator it = tiles.begin(); it != tiles.end(); it++) {
216 + for (std::list<MapTile*>::iterator it = tiles.begin(); it != tiles.end(); it++) {
217 MapTile *tile = *it;
219 // remove old tiles
220 @@ -246,7 +246,7 @@
221 tile->c.lon < min_lon - CACHE_LIMIT ||
222 tile->c.lon > max_lon + CACHE_LIMIT) {
224 - list<MapTile*>::iterator tmp = it; tmp++;
225 + std::list<MapTile*>::iterator tmp = it; tmp++;
226 if ( tile->tex ) {
227 glDeleteTextures( 1, &tile->texture_handle );
229 diff -wbBur Atlas-0.3.1/src/MapBrowser.hxx Atlas-0.3.1.my/src/MapBrowser.hxx
230 --- Atlas-0.3.1/src/MapBrowser.hxx 2006-10-28 16:28:32.000000000 +0000
231 +++ Atlas-0.3.1.my/src/MapBrowser.hxx 2009-03-11 16:33:30.000000000 +0000
232 @@ -27,7 +27,7 @@
233 #include "FlightTrack.hxx"
234 #include "Projection.hxx"
235 #include <simgear/compiler.h>
236 -#include SG_GL_H
237 +#include <GL/gl.h>
238 #include <math.h>
239 #include <list>
240 #include <map>
241 @@ -113,9 +113,9 @@
245 - typedef map<Coord, MapTile*, TileLess> TileTable;
246 + typedef std::map<Coord, MapTile*, TileLess> TileTable;
248 - list<MapTile*> tiles;
249 + std::list<MapTile*> tiles;
250 TileTable tiletable;
252 char mpath[512];
253 diff -wbBur Atlas-0.3.1/src/MapMaker.cxx Atlas-0.3.1.my/src/MapMaker.cxx
254 --- Atlas-0.3.1/src/MapMaker.cxx 2005-09-29 19:18:01.000000000 +0000
255 +++ Atlas-0.3.1.my/src/MapMaker.cxx 2009-03-11 16:39:09.000000000 +0000
256 @@ -32,6 +32,8 @@
257 #include <sys/stat.h>
258 #include <plib/ul.h>
260 +#include <iostream>
262 #include "MapMaker.hxx"
263 /*#include <simgear/magvar/magvar.hxx>*/
265 @@ -626,7 +628,7 @@
268 int MapMaker::process_binary_file( char *tile_name, sgVec3 xyz ) {
269 - //cout << "tile name = " << tile_name << '\n';
270 + //std::cout << "tile name = " << tile_name << '\n';
272 //float cr; // reference point (gbs)
273 sgVec3 gbs, tmp;
274 @@ -653,8 +655,8 @@
276 /* convert point_list of wgs84 nodes to a list of points transformed
277 into the maps local coordinate system */
278 - const point_list wgs84_nodes = tile.get_wgs84_nodes();
279 - for ( point_list::const_iterator node = wgs84_nodes . begin();
280 + const std::vector< SGVec3<double> > wgs84_nodes = tile.get_wgs84_nodes();
281 + for ( std::vector< SGVec3<double> >::const_iterator node = wgs84_nodes . begin();
282 node != wgs84_nodes . end();
283 node++ ) {
285 @@ -674,8 +676,8 @@
288 // same as above for normals
289 - const point_list m_norms = tile.get_normals();
290 - for ( point_list::const_iterator normal = m_norms.begin();
291 + const std::vector< SGVec3<float> > m_norms = tile.get_normals();
292 + for ( std::vector< SGVec3<float> >::const_iterator normal = m_norms.begin();
293 normal != m_norms.end();
294 normal++ ) {
295 // Make a new normal
296 @@ -760,8 +762,8 @@
299 if(0) {
300 - cout << "Node_list sizes are nodes: " << wgs84_nodes.size() << " -- normals: " << m_norms.size() << '\n';
301 - cout << "Group_list sizes are tris: " << tris.size() << " -- fans: " << fans.size() << " -- strips: " << strips.size() << '\n';
302 + std::cout << "Node_list sizes are nodes: " << wgs84_nodes.size() << " -- normals: " << m_norms.size() << '\n';
303 + std::cout << "Group_list sizes are tris: " << tris.size() << " -- fans: " << fans.size() << " -- strips: " << strips.size() << '\n';
306 for (i = 0; i < v.size(); i++) {
307 diff -wbBur Atlas-0.3.1/src/MapMaker.hxx Atlas-0.3.1.my/src/MapMaker.hxx
308 --- Atlas-0.3.1/src/MapMaker.hxx 2005-02-26 18:40:36.000000000 +0000
309 +++ Atlas-0.3.1.my/src/MapMaker.hxx 2009-03-11 16:33:30.000000000 +0000
310 @@ -31,14 +31,14 @@
311 #include <vector>
312 #include <list>
313 #include <map>
314 -#include STL_STRING
315 +#include <string>
317 #include "Output.hxx"
318 #include "Overlays.hxx"
319 #include "Geodesy.hxx"
321 -SG_USING_STD(vector);
322 -SG_USING_STD(string);
323 +#include <vector>
324 +#include <string>
326 // Utility function that I needed to put somewhere - this probably isn't the best place for it.
327 // Appends a path separator to a directory path if not present.
328 diff -wbBur Atlas-0.3.1/src/MapPS.cxx Atlas-0.3.1.my/src/MapPS.cxx
329 --- Atlas-0.3.1/src/MapPS.cxx 2005-09-29 19:18:01.000000000 +0000
330 +++ Atlas-0.3.1.my/src/MapPS.cxx 2009-03-11 16:40:31.000000000 +0000
331 @@ -39,8 +39,9 @@
332 #include <plib/ul.h>
333 #include "Scenery.hxx"
335 -SG_USING_STD(vector);
336 -SG_USING_STD(string);
337 +#include <vector>
338 +#include <string>
339 +#include <iostream>
341 typedef vector<string> string_list;
343 @@ -149,7 +150,7 @@
344 scenerypath = new char[max_path_length + 256];
345 scenery_pos = 0;
346 } else {
347 - cout << "No scenery paths could be found. You need to set either a valid FG_ROOT and/or FG_SCENERY variable, or specify a valid --fg-root and/or --fg-scenery on the command line.\n";
348 + std::cout << "No scenery paths could be found. You need to set either a valid FG_ROOT and/or FG_SCENERY variable, or specify a valid --fg-root and/or --fg-scenery on the command line.\n";
349 exit(-1);
352 diff -wbBur Atlas-0.3.1/src/OutputGL.hxx Atlas-0.3.1.my/src/OutputGL.hxx
353 --- Atlas-0.3.1/src/OutputGL.hxx 2005-02-26 18:40:37.000000000 +0000
354 +++ Atlas-0.3.1.my/src/OutputGL.hxx 2009-03-11 16:33:30.000000000 +0000
355 @@ -2,7 +2,7 @@
356 #define __OUTPUTGL_H__
358 #include <simgear/compiler.h>
359 -#include SG_GLUT_H
360 +#include <GL/glut.h>
361 #include <plib/fnt.h>
362 #include <plib/pu.h>
363 #include "Output.hxx"
364 diff -wbBur Atlas-0.3.1/src/Overlays.cxx Atlas-0.3.1.my/src/Overlays.cxx
365 --- Atlas-0.3.1/src/Overlays.cxx 2006-10-26 11:56:25.000000000 +0000
366 +++ Atlas-0.3.1.my/src/Overlays.cxx 2009-03-11 16:33:33.000000000 +0000
367 @@ -27,7 +27,7 @@
368 #include "Overlays.hxx"
369 #include "Geodesy.hxx"
371 -SG_USING_STD(map);
372 +#include <map>
374 #ifdef _MSC_VER
376 @@ -65,8 +65,10 @@
377 bool Overlays::airports_loaded = false;
378 bool Overlays::navaids_loaded = false;
379 bool Overlays::fixes_loaded = false;
380 -vector<Overlays::ARP*> Overlays::airports;
381 -vector<Overlays::NAV*> Overlays::navaids;
382 +std::vector<Overlays::ARP*> Overlays::airports;
383 +std::vector<Overlays::NAV*> Overlays::navaids;
385 +using namespace std;
387 const float Overlays::airport_color1[4] = {0.439, 0.271, 0.420, 0.7};
388 const float Overlays::airport_color2[4] = {0.824, 0.863, 0.824, 0.7};
389 diff -wbBur Atlas-0.3.1/src/Overlays.hxx Atlas-0.3.1.my/src/Overlays.hxx
390 --- Atlas-0.3.1/src/Overlays.hxx 2005-01-10 13:15:53.000000000 +0000
391 +++ Atlas-0.3.1.my/src/Overlays.hxx 2009-03-11 16:33:30.000000000 +0000
392 @@ -121,7 +121,7 @@
393 struct ARP {
394 char name[64], id[5];
395 float lat, lon;
396 - list<RWY*> rwys;
397 + std::list<RWY*> rwys;
400 enum NavType { NAV_VOR, NAV_DME, NAV_NDB, NAV_ILS, NAV_FIX };
401 @@ -142,8 +142,8 @@
403 protected:
405 - static vector<ARP*> airports;
406 - static vector<NAV*> navaids;
407 + static std::vector<ARP*> airports;
408 + static std::vector<NAV*> navaids;
409 static bool airports_loaded, navaids_loaded, fixes_loaded;
410 static const float dummy_normals[][3];
412 diff -wbBur Atlas-0.3.1/src/Scenery.cxx Atlas-0.3.1.my/src/Scenery.cxx
413 --- Atlas-0.3.1/src/Scenery.cxx 2005-02-26 18:39:14.000000000 +0000
414 +++ Atlas-0.3.1.my/src/Scenery.cxx 2009-03-11 16:33:33.000000000 +0000
415 @@ -3,8 +3,8 @@
417 #include "MapMaker.hxx"
419 -SG_USING_STD(vector);
420 -SG_USING_STD(string);
421 +#include <vector>
422 +#include <string>
424 typedef vector<string> string_list;
426 diff -wbBur Atlas-0.3.1/src/buildmaps.sh Atlas-0.3.1.my/src/buildmaps.sh
427 --- Atlas-0.3.1/src/buildmaps.sh 2006-10-29 14:35:49.000000000 +0000
428 +++ Atlas-0.3.1.my/src/buildmaps.sh 2009-03-11 16:17:43.000000000 +0000
429 @@ -1,6 +1,6 @@
430 #!/bin/sh
432 -ROOT=NONE/lib/FlightGear/Scenery
433 +ROOT=/usr/lib/FlightGear/Scenery
434 OUTPUTDIR=./maps
436 mkdir -p $OUTPUTDIR
437 diff -wbBur Atlas-0.3.1/src/fg_mkdir.cxx Atlas-0.3.1.my/src/fg_mkdir.cxx
438 --- Atlas-0.3.1/src/fg_mkdir.cxx 2005-01-28 12:54:12.000000000 +0000
439 +++ Atlas-0.3.1.my/src/fg_mkdir.cxx 2009-03-11 16:40:00.000000000 +0000
440 @@ -28,6 +28,8 @@
442 #include <simgear/compiler.h>
444 +#include <cstdlib>
446 #ifdef _MSC_VER
447 #include <direct.h>
448 #include <io.h>