![]() |
CRM64Pro GDK v0.13.0
A free cross-platform game development kit built on top of SDL 3.0
|
Data definition classes for TileEngine layer management v3.00 (May 2024).
The TileEngine MapData module provides the TE_MapData class that implements all required methods for managing map layer data. This class serves as the foundation for layer updating and rendering within the TileEngine system.
| Purpose | Implements all required methods for managing a map layer |
|---|---|
| Update cycle | Provides data for layer update operations |
| Render cycle | Provides data for layer rendering operations |
| Extensibility | Can be extended via C++ inheritance for custom map data |
| Parent module | TileEngine Core module |
|---|---|
| Usage | Used by TileEngine objects for layer data operations |
Classes | |
| class | CRM64Pro::TE_MapData |
| MapData class. More... | |
Functions | |
| template<typename T> | |
| T ** | CRM64Pro::TE_MapData::create2DArray (Sint32 height, Sint32 width) |
| Template: dynamic 2D array of a given data type. | |
| template<typename T> | |
| Sint32 | CRM64Pro::TE_MapData::free2DArray (T **Array) |
| Template: delete a dynamic 2D array. | |
| CRM64Pro::TE_MapData::TE_MapData (Sint32 height, Sint32 width) | |
| MapData constructor. | |
| Sint32 | CRM64Pro::TE_MapData::getCellWidth () |
| Get cell width. | |
| Sint32 | CRM64Pro::TE_MapData::setCellWidth (Sint32 size) |
| Set cell width. | |
| Sint32 | CRM64Pro::TE_MapData::getCellHeight () |
| Get cell height. | |
| Sint32 | CRM64Pro::TE_MapData::setCellHeight (Sint32 size) |
| Set tile height. | |
| Sint32 | CRM64Pro::TE_MapData::getWidth () |
| Get map width. | |
| Sint32 | CRM64Pro::TE_MapData::getHeight () |
| Get map height. | |
| Sint32 | CRM64Pro::TE_MapData::create (Sint32 height, Sint32 width, Uint32 value=0) |
| Create the 2D array for the tiles allocation. | |
| Sint32 | CRM64Pro::TE_MapData::free () |
| Delete the 2D array. | |
| Sint32 | CRM64Pro::TE_MapData::setValue (Sint32 y, Sint32 x, Uint32 value) |
| Set arbitrary values on 2D array. | |
| Sint32 | CRM64Pro::TE_MapData::clone (TE_MapData *dest) |
| Copy the current values of the 2D array iTilemap to the given MapData. | |
| Sint32 | CRM64Pro::TE_MapData::check () |
| Map validation. | |
| Sint32 | CRM64Pro::TE_MapData::info (Sint8 bTilesetReady, eLogMessageLevel LML) |
| Request MapData object information. | |
| Sint32 | CRM64Pro::TE_MapData::saveToXMLNode (Sint32 idXML) |
| Save the mapdata to a XML node of a Tiled (TMX) file. | |
| Sint32 | CRM64Pro::TE_MapData::loadFromXMLNode (Sint32 idXML) |
| Load the mapdata from a node inside a Tiled (TMX) file. | |
| Sint32 | CRM64Pro::TE_MapData::cellRender (Sint32 x_cell, Sint32 y_cell, Sint32 x_dst, Sint32 y_dst, Sint32 iAlpha, Sint32 idTileset, Uint32 idTile, Sint32 idRes) |
| Render a cell. | |
| Sint32 | CRM64Pro::TE_MapData::A2DtoCSV (Uint32 **Array2D, Sint32 w, Sint32 h, char *&szOutput) |
| Convert a 2D integers array to a CSV formatted string (SerializeOut). | |
| Sint32 | CRM64Pro::TE_MapData::CSVtoA2D (Uint32 **Array2D, Sint32 w, Sint32 h, const string &sInput) |
| Convert a CSV formatted string to a 2D integers array (SerializeIn). | |
| Sint32 | CRM64Pro::TE_MapData::stringtoA2D (Uint32 **Array2D, Sint32 w, Sint32 h, const char *szInput) |
| Convert a string to a 2D integers array (SerializeIn). | |
| T ** CRM64Pro::TE_MapData::create2DArray | ( | Sint32 | height, |
| Sint32 | width ) |
Template: dynamic 2D array of a given data type.
| height | Selected height of your 2D array |
| width | Selected width of your 2D array |
| Sint32 CRM64Pro::TE_MapData::free2DArray | ( | T ** | Array | ) |
Template: delete a dynamic 2D array.
| Array | pointer to 2D array. |
| CRM64Pro::TE_MapData::TE_MapData | ( | Sint32 | height, |
| Sint32 | width ) |
MapData constructor.
Creates a 2D array for cells allocation. Each element is a cell.
| height | Selected height of your map. 0 avoids iTilemap creation. |
| width | Selected width of your map. 0 avoids iTilemap creation. |
| Sint32 CRM64Pro::TE_MapData::getCellWidth | ( | ) |
Get cell width.
| Sint32 CRM64Pro::TE_MapData::setCellWidth | ( | Sint32 | size | ) |
Set cell width.
| size | integer with cell width (in pixels). |
| Sint32 CRM64Pro::TE_MapData::getCellHeight | ( | ) |
Get cell height.
| Sint32 CRM64Pro::TE_MapData::setCellHeight | ( | Sint32 | size | ) |
Set tile height.
| size | integer with cell height (in pixels). |
| Sint32 CRM64Pro::TE_MapData::getWidth | ( | ) |
Get map width.
| Sint32 CRM64Pro::TE_MapData::getHeight | ( | ) |
Get map height.
| Sint32 CRM64Pro::TE_MapData::create | ( | Sint32 | height, |
| Sint32 | width, | ||
| Uint32 | value = 0 ) |
Create the 2D array for the tiles allocation.
Each element on this 2D array is a cell.
| height | Selected height of your map. |
| width | Selected width of your map. |
| value | Default value to be assigned on each cell. |
| Sint32 CRM64Pro::TE_MapData::free | ( | ) |
Delete the 2D array.
| Sint32 CRM64Pro::TE_MapData::setValue | ( | Sint32 | y, |
| Sint32 | x, | ||
| Uint32 | value ) |
Set arbitrary values on 2D array.
It is mainly used for creating maps in a manual way.
| y | Selected Y position. -1 to affect the whole axis. |
| x | Selected X position. -1 to affect the whole axis. |
| value | The value to be set on the given position. |
| Sint32 CRM64Pro::TE_MapData::clone | ( | TE_MapData * | dest | ) |
Copy the current values of the 2D array iTilemap to the given MapData.
The destination must have identical attributes (width and height). If the destination has not an iTilemap, we will create one identical to the source
| dest | Pointer to destination TE_MapBase or derivated object. |
| Sint32 CRM64Pro::TE_MapData::check | ( | ) |
Map validation.
Validates iTilemap 2D array: prints error info for values <0, checks mapdata width/height, and checks cell width/height.
| Sint32 CRM64Pro::TE_MapData::info | ( | Sint8 | bTilesetReady, |
| eLogMessageLevel | LML ) |
Request MapData object information.
Writes information to the default log.
| bTilesetReady | -1 do not display anything, 0 it is not ready and 1 it is ready. |
| LML | importance of the message. Check ::eLogMessageLevel enum for further information. |
| Sint32 CRM64Pro::TE_MapData::saveToXMLNode | ( | Sint32 | idXML | ) |
| Sint32 CRM64Pro::TE_MapData::loadFromXMLNode | ( | Sint32 | idXML | ) |
Load the mapdata from a node inside a Tiled (TMX) file.
| idXML | id of an opened XML with the pointer set to a data subnode. |
| Sint32 CRM64Pro::TE_MapData::cellRender | ( | Sint32 | x_cell, |
| Sint32 | y_cell, | ||
| Sint32 | x_dst, | ||
| Sint32 | y_dst, | ||
| Sint32 | iAlpha, | ||
| Sint32 | idTileset, | ||
| Uint32 | idTile, | ||
| Sint32 | idRes ) |
Render a cell.
| x_cell | Cell X coordinate to be rendered. |
| y_cell | Cell y coordinate to be rendered. |
| x_dst | Destination surface X coordinate to start to render in case you wish to. |
| y_dst | Destination surface Y coordinate to start to render in case you wish to. |
| iAlpha | Alpha modulation for this layer. This value overwrites the own tileset alpha modulation. |
| idTileset | tileset id. |
| idTile | which tile inside the tileset must be rendered. |
| idRes | a valid screen or image handle used as rendering target. |
|
protected |
Convert a 2D integers array to a CSV formatted string (SerializeOut).
| Array2D | 2D array to be parsed. |
| w | width of the 2D array. |
| h | height of the 2D array. |
| szOutput | Pointer to the output string with the integers in CSV format. |
|
protected |
Convert a CSV formatted string to a 2D integers array (SerializeIn).
| Array2D | destination 2D array of the parsed integers. |
| w | width of the 2D array. |
| h | height of the 2D array. |
| sInput | string with the the integers in CSV format. |
|
protected |
Convert a string to a 2D integers array (SerializeIn).
| Array2D | destination 2D array of the parsed integers. |
| w | width of the 2D array. |
| h | height of the 2D array. |
| szInput | Pointer to the input string. |