1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Some BGL info for you guys...

Discussion in 'Tools programming' started by theisomizer, 27/3/07.

  1. theisomizer

    theisomizer

    Joined:
    15/1/07
    Messages:
    157
    Country:
    us-texas
    Hey all,

    During some of my... ahem... MDL "research" cough cough hacking cough cough... :p

    I have discovered the following BGL info. Yes, it is for FSX. I thought the FSX MDL format got rid of the old BGL-style data, but apparently it is still included in xtomdl for some reason. Time for more research!

    It is in C# code but should be easily convertible into any other language by anyone with half a brain. You must accept the following license to view or use this code.

    License: LGPL 2.1, available at: http://www.gnu.org/licenses/lgpl.html

    Code:
    namespace Microsoft.FlightSimulator
    {
        internal enum BGL_DATA_CLASS
        {
            BGL_DATA_CLASS_UNKNOWN,
            BGL_DATA_CLASS_DIRECT_QMID,
            BGL_DATA_CLASS_INDIRECT_QMID,
            BGL_DATA_CLASS_AIRPORT_NAME_INDEX,
            BGL_DATA_CLASS_ICAO_INDEX,
            BGL_DATA_CLASS_GUID_INDEX,
            BGL_DATA_CLASS_EXCLUSION,
            BGL_DATA_CLASS_TIME_ZONE
        }
    
        internal enum BGL_DATA_TYPE
        {
            BGL_DATA_TYPE_NONE = 0,
            BGL_DATA_TYPE_COPYRIGHT = 1,
            BGL_DATA_TYPE_GUID = 2,
            BGL_DATA_TYPE_AIRPORT = 3,
            BGL_DATA_TYPE_NAV = 19,
            BGL_DATA_TYPE_NDB = 23,
            BGL_DATA_TYPE_MARKER = 24,
            BGL_DATA_TYPE_BOUNDARY = 32,
            BGL_DATA_TYPE_WAYPOINT = 34,
            BGL_DATA_TYPE_GEOPOL = 35,
            BGL_DATA_TYPE_SCENERY_OBJECT = 37,
            BGL_DATA_TYPE_AIRPORT_NAME_INDEX = 39,
            BGL_DATA_TYPE_VOR_ICAO_INDEX = 40,
            BGL_DATA_TYPE_NDB_ICAO_INDEX = 41,
            BGL_DATA_TYPE_WAYPOINT_ICAO_INDEX = 42,
            BGL_DATA_TYPE_MODEL_DATA = 43,
            BGL_DATA_TYPE_AIRPORT_SUMMARY = 44,
            BGL_DATA_TYPE_EXCLUSION = 46,
            BGL_DATA_TYPE_TIME_ZONE = 47,
            BGL_DATA_TYPE_TERRAIN_VECTOR_DB = 101,
            BGL_DATA_TYPE_TERRAIN_ELEVATION = 103,
            BGL_DATA_TYPE_TERRAIN_LAND_CLASS = 104,
            BGL_DATA_TYPE_TERRAIN_WATER_CLASS = 105,
            BGL_DATA_TYPE_TERRAIN_REGION = 106,
            BGL_DATA_TYPE_POPULATION_DENSITY = 108,
            BGL_DATA_TYPE_AUTOGEN_ANNOTATION = 109,
            BGL_DATA_TYPE_TERRAIN_INDEX = 110,
            BGL_DATA_TYPE_TERRAIN_TEXTURE_LOOKUP = 111,
            BGL_DATA_TYPE_TERRAIN_SEASON_JAN = 120,
            BGL_DATA_TYPE_TERRAIN_SEASON_FEB = 121,
            BGL_DATA_TYPE_TERRAIN_SEASON_MAR = 122,
            BGL_DATA_TYPE_TERRAIN_SEASON_APR = 123,
            BGL_DATA_TYPE_TERRAIN_SEASON_MAY = 124,
            BGL_DATA_TYPE_TERRAIN_SEASON_JUN = 125,
            BGL_DATA_TYPE_TERRAIN_SEASON_JUL = 126,
            BGL_DATA_TYPE_TERRAIN_SEASON_AUG = 127,
            BGL_DATA_TYPE_TERRAIN_SEASON_SEP = 128,
            BGL_DATA_TYPE_TERRAIN_SEASON_OCT = 129,
            BGL_DATA_TYPE_TERRAIN_SEASON_NOV = 130,
            BGL_DATA_TYPE_TERRAIN_SEASON_DEC = 131,
            BGL_DATA_TYPE_TERRAIN_PHOTO_JAN = 140,
            BGL_DATA_TYPE_TERRAIN_PHOTO_FEB = 141,
            BGL_DATA_TYPE_TERRAIN_PHOTO_MAR = 142,
            BGL_DATA_TYPE_TERRAIN_PHOTO_APR = 143,
            BGL_DATA_TYPE_TERRAIN_PHOTO_MAY = 144,
            BGL_DATA_TYPE_TERRAIN_PHOTO_JUN = 145,
            BGL_DATA_TYPE_TERRAIN_PHOTO_JUL = 146,
            BGL_DATA_TYPE_TERRAIN_PHOTO_AUG = 147,
            BGL_DATA_TYPE_TERRAIN_PHOTO_SEP = 148,
            BGL_DATA_TYPE_TERRAIN_PHOTO_OCT = 149,
            BGL_DATA_TYPE_TERRAIN_PHOTO_NOV = 150,
            BGL_DATA_TYPE_TERRAIN_PHOTO_DEC = 151,
            BGL_DATA_TYPE_TERRAIN_PHOTO_NIGHT = 152,
            BGL_DATA_TYPE_FAKE_TYPES = 10000,
            BGL_DATA_TYPE_ICAO_RUNWAY = 10001
        }
    
        internal enum BGL_OBJECT_TYPE
        {
            BGL_SCENERY_OBJECT_UNKNOWN = 0,
            BGL_SCENERY_OBJECT_GENERIC_BUILDING = 1,
            BGL_SCENERY_OBJECT_LIBRARY_OBJECT = 2,
            BGL_SCENERY_OBJECT_WINDSOCK = 3,
            BGL_SCENERY_OBJECT_EFFECT = 4,
            BGL_SCENERY_OBJECT_TAXIWAY_SIGNS = 5,
            BGL_SCENERY_OBJECT_MODEL_DATA = 6,
            BGL_SCENERY_OBJECT_TRIGGER = 7,
            BGL_SCENERY_OBJECT_BEACON = 8,
            BGL_SCENERY_OBJECT_PROXY_OBJECT = 9,
            BGL_SCENERY_OBJECT_GENERIC_BUILDING_FSX = 10,
            BGL_SCENERY_OBJECT_LIBRARY_OBJECT_FSX = 11,
            BGL_SCENERY_OBJECT_WINDSOCK_FSX = 12,
            BGL_SCENERY_OBJECT_EFFECT_FSX = 13,
            BGL_SCENERY_OBJECT_TAXIWAY_SIGNS_FSX = 14,
            BGL_SCENERY_OBJECT_MODEL_DATA_FSX = 15,
            BGL_SCENERY_OBJECT_TRIGGER_FSX = 16,
            BGL_SCENERY_OBJECT_BEACON_FSX = 17,
            BGL_SCENERY_OBJECT_EXTRUSION_BRIDGE_FSX = 18,
            BGL_SCENERY_OBJECT_ATTACHED_OBJECT_START = 4096,
            BGL_SCENERY_OBJECT_ATTACHED_OBJECT_END = 4097,
            BGL_SCENERY_OBJECT_ATTACHED_OBJECT_START_FSX = 4098,
            BGL_SCENERY_OBJECT_ATTACHED_OBJECT_END_FSX = 4099
        }
    }
    
    I know it is a bit confusing, but it is really pretty verbatim from the code in xtomdl. I still don't understand parts of it, but feel free to ask any questions.

    Have fun, and remind yourself the same thing my girlfriend is all too happy to remind me daily: FS is only a game. :stirthepo

    Sean
  2. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    23,292
    Country:
    wales
    Hi Sean

    Thanks for the information. You say it comes from xtomdl?

    The ids listed there confirm the ids used in SDE and BglAnalyzeX but also there are some new ones. It also confirms the function of some sections that I am collecting but not making any use of such as the ICAO indexes for Navs, waypoints and Ndbs

    I will go back through SDE and see what extra I can get out now :)
  3. theisomizer

    theisomizer

    Joined:
    15/1/07
    Messages:
    157
    Country:
    us-texas
    Hi Jon,

    Yes, this info does come from xtomdl. I have no clue why, though, as I found it purely by accident. I am in the process of making a tool that will display and convert between .x/.xanim , XML, and MDL formats. My tool (which doesn't have a name as of yet) links directly to xtomdl.exe at runtime and uses several functions contained within during the compilation/decompilation process. It's just easier to use what's already there than just rewriting it myself, and probably a whole lot more legal too :) .

    Well, the other day I was running some tests on my program, and a call I made to xtomdl returned a value I had never seen before. Upon further examination of what the program did with that value, and where it came from in the first place, I found a whole new branch of the program that I never even knew existed. That is where I then found these enums.

    Anyways, I still have no clue why these are in xtomdl. I was almost sure that the FSX format MDL didn't use any BGL opcodes, but since they were in xtomdl they probably must be used somewhere. I have about 50% of the MDL format decoded, so they must be used somewhere in the other 50%.

    I still need to figure out why these were in xtomdl and if/where they are used. Time to crawl back into my little hole and do some more research! :teacher:

    Glad I could help,
    Sean
  4. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    23,292
    Country:
    wales
    Hi Sean

    I will be very interested in your tool. My LOV (for FS9) decompiles an mdl file into a .x file before sending it to DirectX to display. I haven't had time to make a FSX version yet.

    Sometimes programs have bits of unneeded stuff left in them :)

Share This Page