L3DT users' wiki
Large 3D terrain generator

atFuncBrowser

Plugin information

Author Aaron
Description atFuncBrowser is a simple plugin that lets you view the available zeofunc extension functions, which may by called by other plugins using zeofunc_Execute.
Menu option 'Extensions→atFuncBrowser→Function browser'
Download link Included with L3DT.
Source code Over here.

About atFuncBrowser

The functions provided in the Zeolite API (see here) are the low-level 'core' functions used to manipulate maps and other data. Complex calculations such as heightfield erosion or texture generation are not included in the core API functions, but may be accessed using the zeofunc_GetFunc and zeofunc_Execute/zeofunc_ExecuteThreaded API functions. These 'zeofunc' extension functions may be provided by L3DT, or they may be provided by other plugins.

However, whilst the core API functions are listed in the documentation wiki, there is currently no list of available zeofunc extension functions. Fortunately, the atFuncBrowser plugin can help here. Selecting the 'Extensions→atFuncBrowser→Function browser' menu option will open the function browser dialog, shown below:

:plugins:general:atfuncbrowser:funcbrowser.png

In this dialog you can see the prototypes of all the available zeofunc extension functions. Note that the functions are nested in a tree, which represent the namespaces used to categorize zeofunc extension functions.

For example, the highlighted function:

string GetBaseTextureNameByID(short InputCode);

…is nested in the 'classes.landtype' namespace, indicating that it is a member function of the class 'landtype'. To get the function handle for this function, you can do the following:

ZFUNC hFunc = zfunc_GetFunc("classes.landtype.GetBaseTextureNameByID");

or, using the CzFunc wrapper:

CzFunc myfunc;
myfunc.GetFunc("classes.landtype.GetBaseTextureNameByID");

The argument and return types are given in the function prototype shown in the dialog. In this particular example, the function takes as an argument a 16-bit short integer (an attributes map pixel) and returns a string (containing the full filename of the base texture for the corresponding land type). This function is used in the atFilterAM plugin, and following this link will take you to the source code. File in which the function is used is 'atFilterAM.cpp', and the function is 'ExtAlphaExpress'. That plugin shows how the function is called, but below I will provide a rough example:

// getting a pixel from the attributes map (x=5,y=10 in this example)
CzMap AM;
unsigned short tempshort;
AM.Attach(zproj_GetMap("AM"));
AM.GetPixel(5, 10, &tempshort); 
 
// getting the function handle
CzFunc landtype_GetBaseTextureNameByID;
landtype_GetBaseTextureNameByID.GetFunc("classes.landtype.GetBaseTextureNameByID");
 
// declare a string to hold the return value of the function
CzStr Filename;
 
// setting the argument value
landtype_GetBaseTextureNameByID.SetArgI(0, VarID_ushort, &tempshort);
 
// calling the function (see 'Execute()'), and attaching Filename to the return value
Filename.Attach(landtype_GetBaseTextureNameByID.Execute());
 
// showing the return value in a dialog box
AfxMessageBox((LPCSTR)FileName);

Changes

2010/06/01

  • Alpha-sorted function list.

2007/10/09

  • Added function counter.

2007/07/01

  • Updated to use L3DT icon.
  • Changed extension to '.zeo'.

2007/01/01

  • Initial release.
 
plugins/general/atfuncbrowser.txt · Last modified: 2017/08/31 04:24 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki