Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

LWMPoly2 - LWMPoly3

Featured Replies

HiTrying to figure out the BGL-files, that is to decompile these files to sourcefiles - like LMWiever does it.Its a problem when one has to interpret between LWMPoly2 and LWMPoly3. I dont think there is a clearcut way to do this in?There structures are given like this....struct LWMPoly2{ UINT8 bPointCount:6; // Up to 62 points UINT8 bReserved:1; // Must be 0 UINT8 bAttrib:1; // Polygon fill attribute, 0 = water, 1 = land SINT16 iHeight; // Whole elevation value in meters UINT8 iFraction; // Fractional elevation value in 1/128 meters}; (8-16-8)struct LWMPoly2Ex{ UINT8 bPointCount:6; // Must be 63 UINT8 bReserved:1; // Must be 0 UINT8 bAttrib:1; // Polygon fill attribute, 0 = water, 1 = land SINT16 iHeight; UINT8 iFraction; UINT8 bExPointCount; // Number of polygon points = 63 + bExPointCount}; (8-16-8-8)struct LWMPoly3 { UINT8 bPointCount:6; // up to 62 points a0cccccc UINT8 bReserved:1 // Must be 0 UINT8 bAttribb:1 // Polygen fill attribute, 0 = water, 1 = land UINT16 HeightStart // Whole elevation value in meters UINT8 FractionStart // Fractional elevation values in 1/128 meters UINT16 HeightEnd // Whole elevation value in meters UINT8 FractionEnd // Fractional elevation values in 1/128 meters} (8-16-8-16-8)struct LWMPoly3Ex{ UINT8 bPointCount:6 ; // Must be 63 UINT8 bReserved:1 ; // Must be 0 UINT8 bAttrib:1 ; // Polygon fill attribute, 0 = water, 1 = land UINT16 HeightStart ; // Whole elevation value in meters UINT8 FractionStart ; // Fractional elevation value in 1/128 meters UINT16 HeightEnd ; // Whole elevation value in meters UINT8 FractionEnd ; // Fractional elevation value in 1/128 meters UINT8 ExPointCount ; // Number of polygon points = 63 + bExPointCount} (8-16-8-16-8-8)Can somebody tell me if there is some kind of combinations that usually occur. What about LWMPoly2(Ex) allway followed by LWMPoint? Or LWMPoly3(ex) allways followed by LWMPoint3? Is it possible to clearify this subject a little bit? Or does my program have to take care of every possibility when it is running throung the BGL-file "looking forward" - so to speak - to see where the next LWMPoly is?Kind RegardsLars DK

If I understand your question correctly the procedure is as follows:You need to look the the struct version in the LWMFileHeader.If it is a FS2002 file and the version is 0x201 you need to use the 2 versions, if it is 0x300 which is used in FS9 you need to use the 3 versions. Depending on the size in the initial field you use the regular or the ex version of the structure.I hope this helps,MatthiasLWMFileHeader{ UINT32 ulHeaderSize; // Size of this header (20 bytes) UINT32 ulVersion; // Version (100h is CFS2, 201h is FS2002, 300h is FS9) SINT32 lIndexHeaderOffset; // Relative offset to index SINT32 lDataOffset; // Relative offset to data SINT32 lTotalSize; // Size of all data plus headers};

  • Author

Thanks Matthias!That solved my problem. I was too "deeply" involved in the code and I forgot about the version numbers.Lars :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.