UAW is callback-based; terrain extensions pass their functions to UAW by implementing the UAW_Extension_Terrain_API interface.
Extensions must implement the functions of this interface.
The callbacks must remain available to UAW throughout the entire runtime of the process! If you use a garbage-collected or interpreted language, mind memory pinning!
This chapter gives a quick overview; detailled examples follow.
Called exactly once by UAW when the scenario initializes. Gives extensions the opportunity to place buildings by using the context-sensitive API that is being passed.
Since a terrain may be used in different scenarios, place only buildings which are independent of specific scenarios!
Called at most once by UAW when the scenario exits and the terrain is no longer used. If you have any resources to release, do it here.
Terrain extensions can manage per-tile information via UAW_Extension_TerrainTile pointers. This type is opaque to UAW – it is fully under control over the extension; UAW never accesses it. Use it for whatever you like.
Create the extension’s data for the specified tile. Return NULL if there is no tile in this specific place, or if the extensions does not have any data for this tile.
The indices may be beyond terrain bounds! Check them if you cannot handle that!
Release the extension’s data for this tile.
Terrain extensions can manage per-view information via UAW_Extension_TerrainView pointers. This type is opaque to UAW – it is fully under control over the extension; UAW never accesses it. Use it for whatever you like.
Create the extension’s data for a new view. The viewer is placed at the given tile indices. The viewing range is given in tiles, too. Return NULL if there is nothing to manage.
Either the viewer has moved to a different tile (as specified by the given tile indices) or the viewing range has changed.
The specified view has ceased to exist. Release all data associated with it.
TODO
UAW can use terrain maps for several reasons: For display on flight control systems, or for enhancing the GUI.
Maps are handled very similar to terrain views: Through an opaque pointer type UAW_Extension_TerrainMapView that is filled by extensions with whatever they need to manage maps.
TODO
TODO
TODO
Terrain extensions provide a small set of collision detection functions to UAW. This set is used to perform complex physics interactions with vehicles and bullets.
TODO
TODO
TODO
TODO
TODO