FG Index -|- ATLAS Index -|- End
What to do next? Assuming you have 'flown' around in FlightGear, tried a few aircraft, downloaded some additional scenery, you have some choices ... continuing the build using Microsoft Visual C/C++, Version 6, (MSVC6) ...
Atlas [ atlas.sourceforge.net ] - A moving map ... see where you are flying ... FlightGear's position can be dispatched in 'packets', and Atlas will display the aircraft position on the current terrain...
Atlas Build using MSVC6 below, but be warned as of about early 2008, SimGear no longer builds with this MSVC version. Atlas Build using MSVC7, or with MSVC8
Atlas Build using MSVC6 Atlas - A 'moving' map, while you are flying FlightGear ... the Map.exe component 'generates' a map images, default map.png, in your FG-ROOT\Atlas folder, of the information from your FlightGear data folder (FG_ROOT) ... Below is a 2 step batch file to download Atlas ... on examining the source, you should note the atlas.sln, and the 3 project files, atlas\atlas.vcproj, map\Map.vcproj, and mapps\MapPS.vcproj files. These are the MSVC7's 'build' files ... if you have ever tried to 'understand' your MSVC6 DSW/DSP files, then you will 'recognise' lots of things ... like 'Name="Source Files"' entries, etc ... Just start a new Project tab, selecting 'Win32 Console Application' ... Some care needs to be taken with the 'Project Name:' ... those familiar with MSVC6 'know' the IDE will create a Path out of the name you use, and this is not ideal in all cases ... so when you 'create' the first project, ensure it is in Altas\atlas path ... OK ... check 'An Empty Project:' ... Finish, and Ok ...
In the FileView tab, expand the Atlas Files ... and right click on 'Source Files', and
choose 'Add Files to Folder' ... back out of the 'Atlas' folder, and into the 'src' folder,
and select the list per atlas.vcproj file ... The current list is -
Select menu, Project Setting ..., select the 'Atlas' project, on the C/C++ tab, do at least
the following category checks :-
Jumping ahead to the Link stage, I also note the additional library line of -
I also 'know', because I have done this before, may times, ;=)) to have downloaded, and compiled fltk-1.1.6, which has a 'libpng.lib' ... actually the set of fltk Debug static libraries are - fltkd.lib, fltkgld.lib, fltkjpegd.lib, fltkpngd.lib ... so the above 'list' will need adjustment, but for the moment, continue with the compile ...
Try my first compile ... F7 (Build) ... and quickly stops on the line, in projection.hxx, of
-
I quickly come to what can be for me, a show stopper ... that is I have not yet 'found' a
'good' work around ... and have to choose a very 'sloppy' 'MSVC6 fix' ... and this is use
'enum', under a MSVC6 label, which I place in the Preprocessor defines ... the next is a
'missing' ...
Line -
The 'missing' png.h shows up ... As mentioned I have already downloaded and compiled fltk-1.1.6, so I can just add the relative path '..\..\fltk-1.1.6\png' to the Additional Include paths ...
Next 'missing' item is -
Again, a little 'modification' to accommodate the compile ... this time it is -
I can see this is going to 'cost' some effort ... is it worth it? Yes ... so I build a macro to add my MSVC6 switch, easily, and efficiently ... just cut, and paste the following to your mymacros file -
Function GetCompSwitch2( sBlk )
Sub AddCompSwitch()
This allows you to select the 'troublesome' line, or lines, and 'encase' it all in a compiler 'switch' code ... then you modify the first version, until MSVC6 trundles on ...
This is the final Debug configuration, 'Preprocessor definitions:' -
This is the final 'Additional include directories:' -
The 'Object/library modules: -
and the important 'Additional library path:' -
This 'combination' get my MSVC6 Atlas to compile, and link ... quite a few 'warnings' have been ignored ... The next step is the Map project. Again, in this source, you can find a Map\Map.vcproj file, and this will give you the list of 'source' files, but if you are going to get into cross platform, open source, projects, then you really will do yourself a favour by reading, and understanding, to some degree, the ever present makefile.am files ... If you load src/makefile.am, and scan around a bit, you will find, the like of -
Map_SOURCES = \
Map_LDADD = \
From this you get the 'source' list, in MSVC6 cut & paste format, of -
Your can initially 'ignore' the header file, the .hxx. As you get to know MSVC6, you will see 'it' prefers header files to be put under their own pseudo folder 'Header files...' ... Actually, it does not make any difference. When you complete a project ... that is get through to the completed link, without error, then the IDE does a full 'dependancy' update, and put just about 'every' header, included anywhere in the source, in the pseudo-folder, 'External Dependancies' ...
And, depending on our mood, it might be the time to also create the third project, in this
atals workspace ... again, the makefile.am provides the 'source' list ...
When you elect menu, Project Setting ..., you can now 'configure' the 3 projects, similarly,
on the C/C++ tab, do at least the following category checks :-
Now that the Debug compile, and link, have completed, it may be time to do the Release version ... again it is easy to cut and paste from project to project ... then select menu, Batch Build, check all projects, and click Re-Build All ... In this case, I was unable to get the Release version linked, but in 'tools' like this, the Debug version will do .... Sometimes, at this stage I go back and 'quieten' some the compiler warnings. The default is warning level 3 (-W3), so one way is to lower the 'warning' level ... One pesky one is warning: C4786 : '...big block..' : debug truncated label to 256 - Oftem I will just drop the following code into, in this case Overlays.hxx ...
#ifdef MSVC6
Running Map/MapPS and Atlas: Of course you can just set a project active, select the configuration desired, in this case the Debug version, and press F5 ... but it is usually worth reading a little of the available documentation first ... or, 'cheat', like me, and 'read' the source ...
From Map.cxx, we have a great HELP script -
Really, what more HELP do you need ... Of course, if you have ONLY downloaded, the 'core' FlightGear data, then your choices here are quite limited. I have downloaded several of the many Australia 'slabs', so I want to choose around Sydney, which I 'know' is in 'chunk' (10x10 deg) e150s40, so what lat, lon should I give this 'mapper'? It says, start at, and assume it will progress up, and to the right ... that is, the reference is the lower left 'corner' ... let's try ... I later 'see' Map uses the top-right!
So I construct my command line -
Ok, look into 'what happened' ... In Map.cxx, in 'main', is the line -
In trapping, and tracing for a while, I realise the default 'verbosity' is 'nothing', and that is why I am not seeing anything in the console window ... so I add --verbose to the command, to be able to 'see' a little more of what is happening, or not, as the case may be ... I hadd been tracing through so directory/file processing, so I drop a break there, so I can come back immediately to here ... but hopefully with more output in the console window ...
But, in this case, this not help a lot ... I got 100's of output of the form -
The text console output is done mainly using printf("..."), but watch for the occasional 'putc('\n', stdout);', and fprintf( stderr, "..."); as 'alternate' output 'styles' ... So I add a few messages in the file processing loop ... and to 'quieten' the current mutiple output, put in a string map_missed, and only put out missed material names once ... from this additional output, and reduction of common output, I can 'see' the processing ...
Processing: e140s40/e149s35: directory ...
Ok, that is interesting. It is not decoding the FlightGear STG file ... says it is unknown
format, tried it twice, as binary, and ascii before it FAILED with the above message ... why
not 'skip' these files, if they are not being 'read' ... so drop in some code -
This is only one iteration into the range shown at the top ... Map area: lat s35 / s34, lon e149 / e150 ... so one can see why the author of the code left out all this output ... remember in unix, stdout, and stderr can be directed to different files, thus the 'errors' do not get mixed up with the 'standard' ... and the only output are dots ... but, it really shows more of 'what is happening' ... the FlightGear files being loaded ... now the total verts, norms, and fans ...
At the end of the 1x1 degree scan, the stats are -
Of course, only in this IDE Debug 'stepping' mode can we 'see' the console window output,
especially when the program ends with a simple -
I load my 'trusty' XnView to view the png, and export it as a jpeg, to include here ... why the conversion ... well the png is only 58KB, the jpeg, for demo purposes, is just 9KB ...
If you know your Blue Mountains, you will see this has 'YKAT', which is Katoomba - from apt.dat.gz, it says -1 3280 0 0 YKAT Katoomba, then 10 -33.666672 150.316666 06x 72.00 2952 0.0000 0.0000 98 111111 05 0 0 0.25 0 ... so input --lon=150.0 --lat=-34.0 got me the area lat s34 to s35, lon e150 to e149 ... I want YSSY, Sydney, which from apt.dat is 1 21 1 0 YSSY Sydney Intl, then first line10 -33.940645 151.176808 07x 74.14 8285 0.0332 0.0000 148 231221 01 2 1 0.25 1 - I decide I want to see all the 1x1 'map' blocks to the coast, so I next try --lon=151.0 --lat=-34.0 ... it should also get 'after' YKAT ... that is give the top-right coordinates ... and add some more 'artefacts' to the image ...
The new run ends with -
Rewarded with the image, now converted for here, to a little JPEG -
This is the 1x1 map block I was looking for ... beautiful Sydney harbour ... what great software ... Ok, that is map creating ... now for the Atlas part ... still working on this ... more to come ...
Geoff R. McLane
Attachment:
Contents of my loadatlas.bat
:LOGIN
:LOAD
:SETROOT
:NOROOT
:End
|
Previous -|- FG Index -|- ATLAS Index -|- Top -|- Next