Creating Your Own Terrain Handler

If you need to use terrain in a data format that is not supported by TMM, you can add a custom terrain handler for it.

To develop a custom terrain handler, create a C/C++ source file that defines the needed procedures, loads any additional third-party libraries used to access the terrain type, and creates any terrain-specific preferences (custom settings). A custom terrain handler must include an entry point with the following signature:

TmmT_Terrain_Type * tmm_terrain_handler(const char * library_base_name);

This entry point is called when terrain of the corresponding type is to be accessed. For a description of this procedure and the TmmT_Terrain_Type object that is returned, see “TmmT_Terrain_Reader_Init_Proc()” on page 53.

The terrain handler code should be compiled with op_mko and linked with op_mkso, using the new type “terrain”. The commands should be similar to these:

op_mko -m32 -type ex -comp_trace_info kernel_based -m <library_base_name> -gui -comp_flags_common " -I<reldir>/sys/include"

object file produced:

<library_base_name>.gui32.i1.ex.o
op_mkso -m32 -type terrain -f <library_base_name>.gui32.i1.ex.o -m <library_base_name> -gui

terrain handler produced:

<library_base_name>.gui32.i1.terrain.so