CRM64Pro GDK v0.14.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches

MapData class. More...

Detailed Description

MapData class.

Public Member Functions

template<typename T>
T ** create2DArray (Sint32 height, Sint32 width)
 Template: dynamic 2D array of a given data type.
template<typename T>
Sint32 free2DArray (T **Array)
 Template: delete a dynamic 2D array.
 TE_MapData (Sint32 height, Sint32 width)
 MapData constructor.
Sint32 getCellWidth () const
 Get cell width.
bool setCellWidth (Sint32 size)
 Set cell width.
Sint32 getCellHeight () const
 Get cell height.
bool setCellHeight (Sint32 size)
 Set tile height.
Sint32 getWidth () const
 Get map width.
Sint32 getHeight () const
 Get map height.
bool create (Sint32 height, Sint32 width, Uint32 value=0)
 Create the 2D array for the tiles allocation.
bool free ()
 Delete the 2D array.
bool setValue (Sint32 y, Sint32 x, Uint32 value)
 Set arbitrary values on 2D array.
bool clone (TE_MapData *dest)
 Copy the current values of the 2D array iTilemap to the given MapData.
bool check ()
 Map validation.
Sint32 info (Sint8 bTilesetReady, eLogLevel eLL)
 Request MapData object information.
Sint32 saveToXMLNode (Sint32 idXML)
 Save the mapdata to a XML node of a Tiled (TMX) file.
Sint32 loadFromXMLNode (Sint32 idXML)
 Load the mapdata from a node inside a Tiled (TMX) file.
Sint32 cellRender (Sint32 x_cell, Sint32 y_cell, Sint32 x_dst, Sint32 y_dst, Sint32 iAlpha, Sint32 idTileset, Uint32 idTile, Sint32 idRes)
 Render a cell.

Protected Member Functions

bool A2DtoCSV (Uint32 **Array2D, Sint32 w, Sint32 h, char *&szOutput)
 Convert a 2D integers array to a CSV formatted string (SerializeOut).
bool CSVtoA2D (Uint32 **Array2D, Sint32 w, Sint32 h, const string &sInput)
 Convert a CSV formatted string to a 2D integers array (SerializeIn).
bool stringtoA2D (Uint32 **Array2D, Sint32 w, Sint32 h, const char *szInput)
 Convert a string to a 2D integers array (SerializeIn).