L3DT development blog
Large 3D terrain generator

March 5

Plugin API update (v16.01)

Hi Everyone,

In January of this year L3DT Professional gained the ability to allocate in-RAM maps as non-contiguous arrays of scanlines. This change eliminates memory fragmentation problems, and allows L3DT to operate much closer to system memory exhaustion without allocation errors. Unfortunately, this change also required an update to the 'Zeolite' plugin API:

  • The function zmap_GetDataPtr now fails if the map is non-contiguous.
  • The zmap_IsContiguous function was added to determine if the map is allocated as a contiguous block of RAM, or if it is instead allocated as an array of scanlines.
  • The plugin function zmap_GetScanlinePtr may be used to directly get the memory pointer for an individual scanline in a map.
  • The plugin function zmap_GetScanlineArray may be used to retrieve the array of pointers to all the scanlines in a map.

Likewise, if the map is allocated as a mosaic map, the tiles in each map may also be allocated as non-contiguous scanlines. Hence:

  • The function zmap_tile_GetDataPtr now fails if the mosaic tile is non-contiguous.
  • The zmap_tile_IsContiguous function was added to determine if the mosaic tile is allocated as a contiguous block of RAM, or if it is instead allocated as an array of scanlines.
  • The plugin function zmap_tile_GetScanlinePtr may be used to directly get the memory pointer for an individual scanline in a mosaic tile.
  • The plugin function zmap_tile_GetScanlineArray may be used to retrieve the array of pointers to all the scanlinesin a mosaic tile.

The direct access interface functions in the CzMap and CzMapTile classes have been updated accordingly. Furthermore, the CzMap::AsContiguousMap and CzMapTile::AsContiguousMap functions were added to allow plugins to create contiguous copies of non-contiguous maps or map tiles.

The updated plugin API is available here. Note that the v16.01 plugin API will not work with versions of L3DT older than v16.01, and hence the older plugin API is still available on the downloads page.

Please address all feedback regarding this update to aaron@bundysoft.com, or use the Plugins and scripts forum.

Best regards, Aaron.

2016/03/05 10:33 · aaron
 
blog/2016/03-05.txt · Last modified: 2017/08/31 04:20 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
L3DT Development Blog RSS Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki