FlightGear - Late October, 2005

back

The CVS update of SimGear/source, FlightGear/source, and FlightGear/data produced a considerable number of changes in late October ... many FlightGear/source files just had the inclusion of config.h added, but there were also quite a number of code changes ... After the update FlightGear FAILED to run ... aborted during the loading of the default.wav file, so this forced me to also look at the sound library, as well ... PLIB was left unchanged at this time.

This is my first flight in the re-build, at 4000 feet, over Orly, Paris - Note the late afternoon sun in the upper left of the image ...

In addition to the --fg-root=<my scenery path> on the command line, this is with the following commands in my system.fgfsrc file, in the root of the scenery path ... each is on a new line in the file, but have put it in one line here, to save a little space  - --log-level=debug --altitude=4000 --aircraft=ufo --fdm=ufo --prop:/sim/hud/draw-fps=true --enable-hud --visibility=40000 --control=joystick --disable-random-objects --disable-clouds --airport=LFPO --disable-ai-models --fog-disable ...

There is presently an open question as to why the distant scenery is all BLACK ... there seems to only be light directly under the aircraft ... in this case the UFO ... and and especially not directly under the where the sun is ... The following is EXACTLY the same scene, about a half hour later ... you can tell by the sun movement ;=)) ... with the visibility pushed out to 60000 metres -

With this 60000m visibility, you can see that the 'black shadow' has been pushed back a little ... the pool of light, under the aircraft, is a little larger ... This is about the MAXIMUM visibility I can use in windows ... If I use say 100000m, FlightGear will ABORT, with an exception, which I have found, by running it under the MSVC debugger, to be an OUT-OF-MEMORY exception ...

One of the developers, on the FlightGear development board, Andy, found the following Microsoft site - http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx - which gives some detail of the virtual memory in Windows ... It seems each process has a maximum of 2GB of process memory, and 2GB of system memory ... and it is assumed FlightGear is exceeding its 2GB limit during the loading of the distant scenery tiles ... As you can see from the site, it is possible to change this to 3GB/1GB if you modify your Boot.ini file, *AND* mark the EXE file header with a IMAGE_FILE_LARGE_ADDRESS_AWARE flag, using the Editbin.exe tool, but I have NOT tried this yet ...

I also get an ABORT if I add --disable_skyblend ...

And finally, this is the same scene, another half later ... the sun is dropping into the south west ... but with FOG enabled ... still 60000m of visibility ...

The overall scene seems 'brighter' with the fog replacing the 'black shadow' ... unless the 'black shadow' can be lifted, this is certainly the 'best' view I can have while flying in Windows ... but I have digressed from my build story ...

OpenAL Build

As can be read on other pages here, I have been having some trouble with the sound library. Thankfully, around the middle of October, the OpenAL site added some great additions for Windows ... try here - http://www.openal.org/downloads.html - so I decided to abandon my own compile from the CVS source, although I may come back to that at some future time, and downloaded the 'OpenAL 1.1 Installer for Windows', and the
'OpenAL 1.1 SDK for Windows', and installed them BOTH ...

Using the default install path, C:/Program Files/OpenAL 1.1 SDK, which I shall call alroot hereafter, and this placed the three (3) header files in 'alroot/include', namely al.h, alc.h and alut.h, two (2) library files in 'alroot/libs/Win32', ALut.lib and OpenAL32.lib, and two (2) DLL files in 'alroot/dll', and ALSO copied them into C:/WINDOWS/system32, OpenAL32.dll and wrap_oal.dll ... Naturally I had to make SURE I removed my own compiled ALut.dll from the path I had placed it in, and ALL references to the copy of the CVS source download I had done ...

This NEW placement of the header files into 'alroot/include' caused some problems with both the SimGear, and FlightGear compiles ... these source files include the headers as <AL/al.h>, etc, but now they are NOT in an AL folder! Rather than modify the source files, I just made another folder, 'alroot/AL' and copied the three (3) headers into there as well ... not a perfect solution, but it works ... ;=))

SimGear Build

After the CVS update, and copy to my work folder, the build of SimGear failed in fastmath.cxx, with a missing M_LN2 constant ... This has happened before, and in the past I have often just dropped in a definition for it ... But looking further this time, it appears to be due to the order of the included headers ... everything works if the include of "fastmath.hxx" is BEFORE the include of <simgear/constants.h> ...

The header fastmath.hxx correctly defines _USE_MATH_DEFINES, under a _MSC_VER switch, before including <math.h>, whereas, if constants.h is first, it also sucks in math.h, through compiler.h, without this additional define ... and thus the M_LN2 is undefined ... It took a while to work this simple reversal of header includes. One 'trick' I use for tracing this is to drop in some #pragma message ("the message") to exactly see what is happening when ... Of course, you must remember to take them all back out again, and return the headers to their original state, and dates ...

Also, since SimGear uses <AL/al.h> to include the sound library headers, I had to copy the headers in 'alroot/include' to a new folder, 'alroot/AL', as mentioned above ... and had to sort of double up on the Additional Include Paths, with - 'C:/Program Files/OpenAL 1.1 SDK' as well as 'C:\Program Files\OpenAL 1.1 SDK\AL' - since files like ALut.h include just <al.h>, and not <AL/al.h> ... if you see what I mean ...

This time I added openal_test1.cxx and openal_test2.cxx, in separate projects of course, since I wanted to 'test' my new, well different installation of OpenAL ... Of course I had to make a few adjustments to get these to compile under _MSC_VER ... like define sleep(a) as Sleep(a*1000), and incude <windows.h> to get the Sleep(ms) function ... and another adjustment to correctly address the jet.wav sound file loaded ...

Strangely, openal_test1 worked fine ... that is I could here the sound ... but no sound emitted from openal_test2, even though the code in openal_test1 looks very much like the code that is included in the SimGear library ... as sample_openal.cxx/hxx ... ran out of steam researching this 'test2' failure ... it all 'looks' correct, and should work like 'test1', but it didn't! ... can only hope it all works when linked with FlightGear ...

FlightGear Build

To be written up another time ... as you can see the sun is getting very low ... the runway lights, and some other lights  have come on ... and other duties call ... ;=)) You will note, without fog, some lights appear above the horizon ...

With fog, it looks like something, people, objects, marching in front of the sun ...

To be continued ...

back