L3DT documentation
Large 3D terrain generator

format_SetOptionValue

Description

Set the value of an option in a file format, as typically retrieved by the CExtAPI::format_GetOptionValue function.

Function prototype

bool CExtAPI::format_SetOptionValue(ZFORMAT hFormat, const char* lpOptionName, long VarID, void* pValue);

Arguments

Name Type Comment
hFormat ZFORMAT A ZFORMAT handle, an option of which is to be set.
lpOptionName const char* A pointer to a C-style string, containing the option name.
VarID long The integer VarID of the option, such as VarID_int.
pValue void* A pointer (of unknown type) to the option data entity. It is the caller's responsibility to ensure that the appropriate memory has been allocated (see example for usage).

Return value

False if:

  • hFormat is invalid, or does not refer to a variable of type VarID_format.
  • There is no option in the format with a name matching lpOptionName (this is case-sensitive).
  • The option exists, but is of a different type to that given by VarID.
  • The pValue pointer is invalid (null).
  • The data of the variable cannot be retrieved by this method (this is true for classes such as varlist, map, ComboSelector, etc.). In such cases, you should instead use CExtAPI::format_GetOptionList, CExtAPI::list_GetItemA, and then the appropriate native methods for the class. See the example provided for CExtAPI::format_GetOptionList.

True otherwise.

Comments

None.

Example

int TileSize = 64;
bool Overlap = true;
theAPI.format_SetOptionValue(hFormat, "TileSize", VarID_int, &TileSize);
theAPI.format_SetOptionValue(hFormat, "Overlap", VarID_bool, &Overlap);
 
zeolite/functions/format_setoptionvalue.txt · Last modified: 2017/08/31 06:40 (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