Slopey
15 May 2007, 18:23
Greetings All!
Possibly a simple one for you - I'm trying to write a little program to parse FSX bgl airport information for a little mission builder program I'm having a go at.
I've got the FSX file structure pdf and looked at the various code posted to do with extracting ICAO codes which has been an enormous help - I can now extract the relevant info from a specfic position in the bgl file.
However, if I look at the BGL file header and more specifically the section pointers which come after the header, I'm not able to get the section starting positions to match with whats in the header.
For example, in my FSX folder in scenery\0000\scenery\APX03070.bgl - if I open that file with a hex editor, I can see the section pointers - I know there are 5 from the main file header at offset 4, and I can see the data therein.
If I look at the section pointers for that file, theres an airport which starts at offset &9c (156), additional airport info, waypoints and a name list. But the problem is that the airport section actually starts at 284 - SDE and the Hexeditor confirm this.
Further more, there's only one airport section listed in the pointer section of the file, but there are 2 airports in that file as confirmed by SDE which seems to open the file without any issues.
I can't parse the entire file for the airport identifier (&003c) as this occurs naturally as data in other places.
Is the file spec pdf out of date or incorrect? Or am I missing something fundamental? The pointer location is 128 out which is always incredibly suspicious - but although I can find the other airport in the hex file manually, there doesn't seem to be a pointer to it in the header of the BGL??
Any illumination would be gratefully receieved!
Kind Regards,
Slopey
Possibly a simple one for you - I'm trying to write a little program to parse FSX bgl airport information for a little mission builder program I'm having a go at.
I've got the FSX file structure pdf and looked at the various code posted to do with extracting ICAO codes which has been an enormous help - I can now extract the relevant info from a specfic position in the bgl file.
However, if I look at the BGL file header and more specifically the section pointers which come after the header, I'm not able to get the section starting positions to match with whats in the header.
For example, in my FSX folder in scenery\0000\scenery\APX03070.bgl - if I open that file with a hex editor, I can see the section pointers - I know there are 5 from the main file header at offset 4, and I can see the data therein.
If I look at the section pointers for that file, theres an airport which starts at offset &9c (156), additional airport info, waypoints and a name list. But the problem is that the airport section actually starts at 284 - SDE and the Hexeditor confirm this.
Further more, there's only one airport section listed in the pointer section of the file, but there are 2 airports in that file as confirmed by SDE which seems to open the file without any issues.
I can't parse the entire file for the airport identifier (&003c) as this occurs naturally as data in other places.
Is the file spec pdf out of date or incorrect? Or am I missing something fundamental? The pointer location is 128 out which is always incredibly suspicious - but although I can find the other airport in the hex file manually, there doesn't seem to be a pointer to it in the header of the BGL??
Any illumination would be gratefully receieved!
Kind Regards,
Slopey