• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

VTPPolyCountEx

Messages
5
dear all, I search since long now.

The FS9 Terrain vector scenery SDK refers to an instruction VTPPolyCountEx with three variables. Ths is necessary if you want to have more than 127 vtp polygons per area.

Non of the various versions of BGLC that I have can compile this code, they all interpret it as VTPPolyCount and tell me there is one variable too much. Anybody has an idea about a newer version of BGLC.exe?


Thanks Burkhard
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi Burkhard,

Are you sure you are using the latest version of the TDFMacros? These should have the commands defined correctly. By default BGLC does not know any of the mesh commands at all.
 
Messages
5
Thanks again, I did use the new ones indeed, but it looks like the definitions in there are different to the SDK - I will try out.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,932
Country
us-wisconsin
Here's what was decided:

; --------------------------------------------------------------------------------

VTPPolyCount Macro Count, Reserved

; enum{ MaxCount = 127 };
; UINT8 bCount:7; // From 0 to 127
; UINT8 bReserved:1; // Extra... if set, VTPPolyCountEx must follow
BYTE ( Reserved * 80h ) + Count

EndM

; --------------------------------------------------------------------------------

VTPPolyCountEx Macro ExPointMult

BYTE ExPointMult; // extra multiples of 128 for the total vtp poly count

EndM

; --------------------------------------------------------------------------------

VTPPolyCountExa Macro Count, Reserved

; enum{ MaxCountEx = 32767 };
; UINT8 bCount:7; // From 0 to 127
; UINT8 bReserved:1; // set to 1 for more than 127
; UINT8 bHighByte; // poly count = bCount + (bHighByte * 128)

BYTE ( Reserved * 80h ) + ( Count MOD 128 )
BYTE Count / 128

EndM

; --------------------------------------------------------------------------------

The macros predated the SDK information. To maintain compatibility with previous versions, the SDK explaination was relabeled as "VTPPolyCountExa".

As I look at the above macro, the VTPPolyCountExa looks to be in error, as it needs another variable.

I'm supposing this was never detected, as everyone else has used the older style of using the VTPPolyCount, followed by VTPPolyCountEx.

Dick
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,932
Country
us-wisconsin
Hi Burkhard.

Here's what I tried:

include tdfmacros.inc
VTPPolyCountExa 32766, 1


This produces 2 bytes as required when compiled... so this macro does work.

Dick
 
Top