SCASM 2.88

CFS1 terrain ...

  

command index:
 
back to main index
 
LoadBitmapClass( )
MeshWith1Tex( )
MeshWithTexList( )
BGL_List( ) / EnumBitmaps( )
RegisterBitmapClass( )

The following commands are first found in CFS1. They are reported to work in FS2000 too, but newer scenery SDK's list them as obsolete or reserved. Be carefull when using them.

 

CFS - FS2000
LoadBitmapClass( class )
I_A5( class )
 

This CFS command loads and activates one of the registered tile bitmap classes for the use with MeshWith1Tex().
Note: The bitmap classes are defined in the CFS file CLASSLIST.BGL. In the moment it is not completely tested how this works. It may happen that you cannot select these bitmaps if your scenery is too far away from the default scenery. If the selected bitmap class contains more than one .BMP they are displayed in some sort of "random" order in the following MeshWith1Tex() instruction.
Note: It is possible to use class numbers above 255. But such numbers are not contained in the default CLASSLIST.BGL.

class  Number of the bitmap class (0...255 in the default scenery). A class usually contains 1 to 7 .BMP bitmaps.

TOP 

CFS - FS2000
MeshWith1Tex(nxnyxwid ywidxofsyofs
 bxobyoflg xbpgybpg 
 <list of elevation grid points> )
I_9A( ... )
 

This command works similar to the old TexRelief()command. This is a user defined textured ground tile with an elevation grid map. The texture class has to be loaded with LoadBitmapClass(). Use this command always with Refpoint( abs ... ), otherwise your final elevation is not exactly defined. The actual size of the whole tile depends on the scale factor in the current reference point. In the default scenery the horizontal size of a tile is aproximately 7500 meters (abt. 4 nm).
(total_x_size_in_meters = nx * xwid * scale_factor)

nx  The tile is devided into this number in x (E-W) direction.
ny  The tile is devided into this number in y (N-S) direction. Normally both numbers are equal (1, 2, 4, 8).
xwid  x size of one sub tile (total size is nx*xwid).
ywid  y size of one subtile
xofs  x offset for the left lower corner (south west)
yofs  y offset for the left lower corner. These values are usually the negative number of half of the total tile size.
bxo  bitmap pixel offset in x direction, usually 0
byo  bitmap pixel offset in y direction, usually 0
flg  flags, pupose unknown, normally 1
xbpg  number of bitmaps per grid in x direction. Due to the binary instruction format only values from 0.0625 (=1/16) to 15.9375 (=16 - 1/16) are possible. SCASM does not check these limits.
ybpg  number of bitmaps per grid in y direction. Note: it seems that CFS becomes confused if xbpb and ybpg are not equal.
<list..>  The list of the elevation points. The fist point is in the south west. Only integer are numbers allowed. The number of points is:
 (nx + 1) * (ny + 1)
Example, for nx = 2 and ny = 2
 (2 + 1) * (2 + 1) = 3 * 3 = 9

Typical code sequence:
Area( 5 00:00  00:00  100 )
    PerspectiveCall2( :tile )
    Jump( :end )
    ;
:tile
    Perspective
    RefPoint( abs :tile_end 1 00:00 00:00  v2= ### )
            ; set V2 to a value about the diameter of
            ; the tile
            ;
    LoadBitmapClass( 1 ) ; select bitmap class
    MeshWith1Tex(  2 2  1882 2049  -1882 -2049
        0 0 1   4 4
        ; list of elevation points follows
        37  24  25 ; south row
        37  20  26 ; middle row
        30  18  30 ; north row
    )
:tile_end
    Return
    ;
:end
EndA

TOP 

CFS - FS2000
MeshWithTexList(nxnyxwid ywidxofsyofs
 bxobyoflg xbpgybpg 
 <list of elevation grid points>
 <texture class map>)
I_A3( ... )
 

This command works similar to MeshWith1Tex(). The difference is that no texture needs to be selected before. The texture classes are activated from the texture class list included in this command.
Only texture class numbers from 0 to 255 are possible because of the limited space in this command format (one byte per entry). The first texture is the south west one. the total number of texture classes for the map is:
 nx * xbpg * ny * ybpg
Example: For a tile with
 nx = 2, ny = 2, xbpg = 4, ybpg = 4
we will need
 2 * 4 * 2 * 4 = 64 entries for the texture map.


TOP 

CFS - FS2000
BGL_List( :Lab 0 ... 0 )
EnumBitmaps( :Lab 0 ... 0 )

I_64( )
 

The purpose of this command is not completely known. It has something to do with registering bitmap classes to use with user defined ground tiles. -> RegisterBitmapClass().
There should be as many 0's as LoadBitmap() instructions follow.


TOP 

CFS - FS2000
RegisterBitmapClass( num x :Lab )
I_A1( )
 

This command has something to do with the registering of the bitmaps for the ground tiles. There can be more than one bitmap in one class. This is to avoid regular pattern tiles. In the CFS1 default scenery where the tiles are usually covered by 8 * 8 = 64 bitmaps one class contains up to 7 bitmaps. But a lot of them like 0 = water has only 1 bitmap in it.
It is possible to define classes higher than 255, but they can only be used with LoadBitmapClass/MeshWith1Tex and not with MeshWithTexList.

num  number of the bitmap class to define
Surface type
concrete
grass
water
bumpy grass
asphalt
short grass
long grass
hard turf
10 city
11 forest
12 PSP matting ???

:Lab  points to the BGL_List() instruction just before the LoadBitmap()'s related to this class

A typical pattern example:
Header( 1 47 49  9 11 )
LatRange( 49 47 )
Area( E  48:28  10:12  255 )
:C0
    BGL_List( :C1 0 )
    LoadBitmap( 0 2 FE 128 128 128 water.bmp )
:C1
    BGL_List( :C255 0 0 0 )
    LoadBitmap( 0 5 FE 128 128 128 pattern1.bmp )
    LoadBitmap( 0 5 FE 128 128 128 pattern2.bmp )
    LoadBitmap( 0 5 FE 128 128 128 pattern3.bmp )
    ;
    ; ... more instructions ...
    ;
:C255
    BGL_List( :C_reg 0 0 0 )
    LoadBitmap( 0 5 FE 128 128 128 pattern4.bmp )
    LoadBitmap( 0 5 FE 128 128 128 pattern5.bmp )
    LoadBitmap( 0 5 FE 128 128 128 pattern6.bmp )
    ;
:C_reg
    RegisterBitmapClass(   0 6 :C0 )   ; first class
    RegisterBitmapClass(   1 6 :C1 )
    ; ...
    RegisterBitmapClass( 255 6 :C255 ) ; last class
EndA


    
TOP © Manfred Moldenhauer