CRM64Pro GDK v0.11.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CRM64Pro::TileEngine

TileEngine Object class. More...

Inherits CRM64Pro::ObjectBase.

Public Member Functions

Sint32 info (Sint32 iMode=-1)
 Request TileEngine object information.
 
Sint32 getName (string &sName)
 Get the name.
 
Uint32 getID ()
 Get the ID.
 
Sint32 allocateLayers (Sint32 iN=-1)
 Set or get the number of layers.
 
Sint32 freeLayer (Sint32 layer)
 Free a layer.
 
Sint32 freeLevel ()
 Free all resources of current level(layer maps and tilesets).
 
Sint32 logVerbosity (Sint32)
 Log verbosity control.
 
Sint32 setViewport (SDL_Rect *rect)
 Set the desired viewport.
 
SDL_Rect * getViewport ()
 Get the current viewport.
 
Sint32 setBackgroundColor (Uint32 iRGBA)
 Set background color.
 
Uint32 getBackgroundColor ()
 Get background color.
 
Sint32 getModificationDate (string &sDate)
 Get the level modification date (last save level date).
 
Sint32 getCreationDate (string &sDate)
 Get the level creation date (first save level date).
 
Sint32 registerMapDataHandler (TE_MapBase *(*createInstance)(Sint32 y, Sint32 x))
 Register a new mapdata type in our factory.
 
Sint32 addCustomMapData (Sint32 layer, TE_MapBase *map)
 Add a custom mapdata.
 
Sint32 deleteCustomMapData (Sint32 layer)
 Delete the custom mapdata. The base mapdata is left without any modification.
 
Sint32 loadTileset (Sint32 tileID, Sint32 iID=-1)
 Load a tileset.
 
Sint32 loadTileset (const string &sCDCfile, const string &sTileName, Sint32 iID=-1)
 Load a tileset.
 
Sint32 loadTileset (const string &sIMGfile, const string &sTileName, Sint32 iTileWidth, Sint32 iTileHeight, Sint32 iID=-1)
 Load a tileset.
 
Sint32 unloadTileset (Sint32 iTN)
 Unload a given tileset.
 
Sint32 getTileset (Sint32 iTN)
 Get the tileset id.
 
Sint32 getTilesetSource (Sint32 iTN, string &sName)
 Get tileset source.
 
Sint32 setTilesetSource (Sint32 iTN, const string &sSource)
 Set tileset source.
 
Sint32 setLayerFlags (Sint32 layer, Sint32 iFlags, char iState=0)
 Set the layer flags.
 
Sint32 getLayerFlags (Sint32 layer)
 Get the layer flags.
 
Sint32 setLayerResControl (Sint32 layer, eTileEngineResCtrl rescontrol)
 Set layer resource control flag.
 
Sint32 getLayerResControl (Sint32 layer)
 Get layer resource control flag.
 
Sint32 setLayerAlphaMod (Sint32 layer, Sint32 alpha)
 Set layer alpha modulation used for rendering this layer.
 
Sint32 getLayerAlphaMod (Sint32 layer)
 Get layer alpha modulation.
 
Sint32 setLayerParallaxRatio (Sint32 layer, float fPRX, float fPRY)
 Set the layer parallax ratio.
 
Sint32 getLayerParallaxRatio (Sint32 layer, float *fPRX, float *fPRY)
 Get current layer parallax ratio.
 
Sint32 setLayerPosition (Sint32 layer, float xpos=TE_KEEP_VALUE, float ypos=TE_KEEP_VALUE)
 Set the layer absolute position (in pixels).
 
Sint32 getLayerPosition (Sint32 layer, float *xpos, float *ypos)
 Get the current layer position (in pixels).
 
Sint32 setLayerAutoScroll (Sint32 layer, float xspeed=TE_KEEP_VALUE, float yspeed=TE_KEEP_VALUE)
 Set the layer AutoScroll speed (in pixels per second).
 
Sint32 getLayerAutoScroll (Sint32 layer, float *xspeed, float *yspeed)
 Get the layer AutoScroll speed (in pixels per seconds).
 
Sint32 setLayerMapData (Sint32 layer, TE_MapBase *map)
 Assign a mapdata to the given layer.
 
TE_MapBasegetLayerMapData (Sint32 layer)
 Get current mapdata on the layer.
 
Sint32 setLayerOnUpdateEnd (Sint32 layer, TE_OnLayerEnd myfunc)
 Set an event function(onUpdateEnd) to be called when the engine finishes to update the layer.
 
TE_OnLayerEnd * getLayerOnUpdateEnd (Sint32 layer)
 Get current onUpdateEnd event function if any.
 
Sint32 setLayerOnRenderEnd (Sint32 layer, TE_OnLayerEnd myfunc)
 Set an event function(onRenderEnd) to be called when the engine finishes to render the layer.
 
TE_OnLayerEnd * getLayerOnRenderEnd (Sint32 layer)
 Get current onRenderEnd event function if any.
 
Sint32 getLayerName (Sint32 layer, string &sName)
 Get the layer name.
 
Sint32 setLayerName (Sint32 layer, const string &sName)
 Set a new layer name.
 
Sint32 setLayerGridColor (Sint32 layer, Uint32 iColor)
 Set the grid color for the base mapdata.
 
Sint32 screen2LayerCell (Sint32 layer, Sint32 sx, Sint32 sy, Sint32 *cx, Sint32 *cy)
 Convert screen coordinates in to layer cell values.
 
Sint32 screen2LayerAbsolute (Sint32 layer, Sint32 sx, Sint32 sy, Sint32 *px, Sint32 *py)
 Convert screen coordinates to layer absolute values.
 
Sint32 moveLayer (Sint32 layer, float x, float y)
 Move the layer adding of subtracting the given X/Y values.
 
Sint32 update (Sint32 layer=-1)
 Update status of TileEngine.
 
Sint32 render (Sint32 layer=-1, Sint32 idRes=0)
 Render of visible layers.
 
Sint32 importLayerFromFile (Sint32 layer, const string &sFile, Sint32 tileSizeX, Sint32 tileSizeY, float maxDevPercentage=100.0, Sint32 iCK=-1)
 Import an image file(BMP or PNG) into a layer.
 
Sint32 importLayerFromImage (Sint32 layer, Sint32 idImg, Sint32 tileSizeX, Sint32 tileSizeY, float maxDevPercentage=100.0, Sint32 iCK=-1)
 Import an image into a layer.
 
Sint32 exportLayerToFile (Sint32 layer, const string &sFile)
 Export a layer to an external PNG image.
 
Sint32 exportLayerToImage (Sint32 layer, Sint32 idImg)
 Export a layer to an image.
 
Sint32 saveLevel (const string &sLevelFile, const string &sLevelName="", const string &sCDCFile="")
 Save level on native format (TileEngine Level or TEL file).
 
Sint32 exportTMX (const string &sTMXFile, const string &sLevelName="")
 Export level to a Tiled map (TMX).
 

Detailed Description

TileEngine Object class.