![]() |
CRM64Pro GDK v0.14.0
A free cross-platform game development kit built on top of SDL 3.0
|
TileEngine Object class. More...
TileEngine Object class.
Public Member Functions | |
| bool | info (Sint32 iMode=-1) override |
| Request detailed TileEngine object information. | |
| const string & | getName () const override |
| Get the name. | |
| Uint32 | getID () const override |
| Get the ID. | |
| Sint32 | getWidth () |
| Get the total width of the level in pixels. | |
| Sint32 | getHeight () |
| Get the total height of the level in pixels. | |
| bool | setLayerCount (Uint32 iNumLayers) |
| Set the number of layers. | |
| Sint32 | getLayerCount () const |
| Get the number of layers. | |
| bool | freeLayer (Sint32 layer) |
| Free a layer. | |
| bool | freeLevel () |
| Free all resources of current level (layer maps and tilesets). | |
| bool | setViewport (SDL_Rect *rect) |
| Set the desired viewport. | |
| SDL_Rect * | getViewport () |
| Get the current viewport. | |
| bool | setBackgroundColor (Uint32 iRGBA) |
| Set background color. | |
| Uint32 | getBackgroundColor () const |
| 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 | loadTileSet (Sint32 idRes, Sint32 globalID=-1) |
| Load a TileSet from a Resource ID (Tile, Image or XML). | |
| Sint32 | loadTileSet (const string &sCDCFile, const string &sResourceName, Sint32 globalID=-1) |
| Load a TileSet from a CDC archive. | |
| Sint32 | loadTileSetFromFile (const string &sPath, Sint32 globalID=-1, Sint32 iTileWidth=-1, Sint32 iTileHeight=-1) |
| Load a TileSet from an external file. | |
| bool | unloadTileSet (Sint32 iTN) |
| Unload a given TileSet. | |
| Sint32 | getTile (Sint32 iTN) |
| Get the Tile id. | |
| eTileEngineTileSetType | getTileSetType (Sint32 iTN) |
| Get the TileSet type. | |
| bool | getTileSetSource (Sint32 iTN, eTileSetStorageMode &eMode, string &sPath, string &sFilename) |
| Get the storage metadata for a TileSet. | |
| bool | setTileSetSource (Sint32 iTN, eTileSetStorageMode eMode, const string &sPath, const string &sFilename) |
| Set the storage metadata for a TileSet. | |
| bool | setLayerFeatures (Sint32 layer, Uint32 iFeatures, bool bEnable) |
| Set the layer features. | |
| Uint32 | getLayerFeatures (Sint32 layer) |
| Get the layer features. | |
| bool | setLayerAlphaMod (Sint32 layer, Sint32 alpha) |
| Set layer alpha modulation used for rendering this layer. | |
| Sint32 | getLayerAlphaMod (Sint32 layer) |
| Get layer alpha modulation. | |
| bool | 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). | |
| bool | 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). | |
| bool | setLayerMapData (Sint32 layer, TE_MapData *map) |
| Assign a mapdata to the given layer. | |
| TE_MapData * | getLayerMapData (Sint32 layer) |
| Get current mapdata on the layer. | |
| bool | setLayerOnUpdateEnd (Sint32 layer, TE_OnLayerEnd myfunc) |
| Set an event function (onUpdateEnd) to be called when the engine finishes updating the layer. | |
| TE_OnLayerEnd * | getLayerOnUpdateEnd (Sint32 layer) |
| Get current onUpdateEnd event function if any. | |
| bool | setLayerOnRenderEnd (Sint32 layer, TE_OnLayerEnd myfunc) |
| Set an event function (onRenderEnd) to be called when the engine finishes rendering the layer. | |
| TE_OnLayerEnd * | getLayerOnRenderEnd (Sint32 layer) |
| Get current onRenderEnd event function if any. | |
| bool | getLayerName (Sint32 layer, string &sName) |
| Get the layer name. | |
| bool | setLayerName (Sint32 layer, const string &sName) |
| Set a new layer name. | |
| bool | setLayerGridColor (Sint32 layer, Uint32 iColor) |
| Set the grid color for the base mapdata. | |
| bool | screen2LayerCell (Sint32 layer, Sint32 sx, Sint32 sy, Sint32 *cx, Sint32 *cy) |
| Convert screen coordinates into layer cell (tile) indices. | |
| bool | screen2LayerAbsolute (Sint32 layer, Sint32 sx, Sint32 sy, Sint32 *px, Sint32 *py) |
| Convert screen coordinates to absolute layer pixel coordinates. | |
| Sint32 | moveLayer (Sint32 layer, float x, float y) |
| Move the layer by adding or subtracting the given X/Y values. | |
| Sint32 | update (Sint32 layer=0) |
| Update status of the TileEngine. | |
| Sint32 | render (Sint32 layer=0, Sint32 idRes=0) |
| Render the visible layers. | |
| Sint32 | importLayerFromFile (Sint32 layer, const string &sFile, const string &sLayerName, 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, const string &sLayerName, 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 | save (const string &sTMXFile, const string &sLevelName="", const string &sCDCFile="", bool bForce=false) |
| Save level to native C64TE format (TMX-based). | |
|
override |
Request detailed TileEngine object information.
Writes information to the default log.
| iMode | -1 for displaying information of all layers or greater than 0 for displaying only information of the give layer id. |
|
override |
Get the name.
|
override |
Get the ID.
| Sint32 CRM64Pro::TileEngine::getWidth | ( | ) |
Get the total width of the level in pixels.
Calculates the maximum width based on the largest layer (map or image).
| Sint32 CRM64Pro::TileEngine::getHeight | ( | ) |
Get the total height of the level in pixels.
Calculates the maximum height based on the largest layer (map or image).
| bool CRM64Pro::TileEngine::setLayerCount | ( | Uint32 | iNumLayers | ) |
Set the number of layers.
| iNumLayers | number of layers to allocate. If current layers are less than iNumLayers, allocates empty new layers. Otherwise removes layers using freeLayer(). |
| Sint32 CRM64Pro::TileEngine::getLayerCount | ( | ) | const |
Get the number of layers.
| bool CRM64Pro::TileEngine::freeLayer | ( | Sint32 | layer | ) |
Free a layer.
Releases the mapdata and resets all layer settings, leaving the slot empty and ready for reuse.
| layer | Selected layer to free (from 1 to number of allocated layers). |
| bool CRM64Pro::TileEngine::freeLevel | ( | ) |
Free all resources of current level (layer maps and tilesets).
Resets the current level. All layers are reset but layer slots are kept. Preserves viewport, level name and number of allocated layers.
| bool CRM64Pro::TileEngine::setViewport | ( | SDL_Rect * | rect | ) |
Set the desired viewport.
You can change the viewport at any time even while you are rendering your application. The width and height of the viewport can not be greater than values of the smallest layer (excluding the ones with looping features), otherwise, it will be automatically adjusted.
| rect | Pointer to SDL_Rect with the desired viewport. If the rect width or height is 0, it will use the whole target (a valid screen or image handle). |
| SDL_Rect * CRM64Pro::TileEngine::getViewport | ( | ) |
Get the current viewport.
| bool CRM64Pro::TileEngine::setBackgroundColor | ( | Uint32 | iRGBA | ) |
Set background color.
| iRGBA | background color to set in the format RGBA. When A is 0 (totally transparent), the background color is disabled. |
| Uint32 CRM64Pro::TileEngine::getBackgroundColor | ( | ) | const |
Get background color.
| Sint32 CRM64Pro::TileEngine::getModificationDate | ( | string & | sDate | ) |
Get the level modification date (last save level date).
| sDate | a string containing the date. |
| Sint32 CRM64Pro::TileEngine::getCreationDate | ( | string & | sDate | ) |
Get the level creation date (first save level date).
| sDate | a string containing the date. |
| Sint32 CRM64Pro::TileEngine::loadTileSet | ( | Sint32 | idRes, |
| Sint32 | globalID = -1 ) |
| Sint32 CRM64Pro::TileEngine::loadTileSet | ( | const string & | sCDCFile, |
| const string & | sResourceName, | ||
| Sint32 | globalID = -1 ) |
Load a TileSet from a CDC archive.
| sCDCFile | string with CDC filename. |
| sResourceName | string with the resource name inside the CDC. |
| globalID | Global ID for this TileSet. Default -1 to find a valid gID. Value 0 not allowed (minimum is 1). |
| Sint32 CRM64Pro::TileEngine::loadTileSetFromFile | ( | const string & | sPath, |
| Sint32 | globalID = -1, | ||
| Sint32 | iTileWidth = -1, | ||
| Sint32 | iTileHeight = -1 ) |
Load a TileSet from an external file.
| sPath | string with the file path (e.g., "maps/tileset.tsx" or "gfx/sheet.png").
|
| globalID | Global ID for this TileSet. Default -1. |
| iTileWidth | Tile width (only for Image loading). -1 for TETT_COLLECTION (single tile). |
| iTileHeight | Tile height (only for Image loading). -1 for TETT_COLLECTION (single tile). |
| bool CRM64Pro::TileEngine::unloadTileSet | ( | Sint32 | iTN | ) |
Unload a given TileSet.
The affected layers (the ones that use any tile of this TileSet) will be disabled.
| iTN | Global ID or any tile of the TileSet to be removed. |
| Sint32 CRM64Pro::TileEngine::getTile | ( | Sint32 | iTN | ) |
| eTileEngineTileSetType CRM64Pro::TileEngine::getTileSetType | ( | Sint32 | iTN | ) |
Get the TileSet type.
| iTN | Global ID or any tile of the TileSet. |
| bool CRM64Pro::TileEngine::getTileSetSource | ( | Sint32 | iTN, |
| eTileSetStorageMode & | eMode, | ||
| string & | sPath, | ||
| string & | sFilename ) |
Get the storage metadata for a TileSet.
| iTN | Global ID of the TileSet. |
| eMode | Output storage mode (Disk, CDC, or Internal). |
| sPath | Output path or CDC archive name. |
| sFilename | Output TSX or image filename. |
| bool CRM64Pro::TileEngine::setTileSetSource | ( | Sint32 | iTN, |
| eTileSetStorageMode | eMode, | ||
| const string & | sPath, | ||
| const string & | sFilename ) |
Set the storage metadata for a TileSet.
Used to specify how the TileSet should be referenced when saving the level.
| iTN | Global ID of the TileSet. |
| eMode | Storage mode (Disk, CDC, or Internal). |
| sPath | Path or CDC archive name. |
| sFilename | TSX or image filename. |
| bool CRM64Pro::TileEngine::setLayerFeatures | ( | Sint32 | layer, |
| Uint32 | iFeatures, | ||
| bool | bEnable ) |
Set the layer features.
| layer | Number of layer(from 1 to number of allocated layers) |
| iFeatures | See TE_LAYERFEATURE_xxx defines for further information. They can be OR'ed |
| bEnable | true for enabling the given iFeatures or false for disabling it. |
| Uint32 CRM64Pro::TileEngine::getLayerFeatures | ( | Sint32 | layer | ) |
Get the layer features.
| layer | Number of layer(from 1 to number of allocated layers) |
| bool CRM64Pro::TileEngine::setLayerAlphaMod | ( | Sint32 | layer, |
| Sint32 | alpha ) |
Set layer alpha modulation used for rendering this layer.
| layer | Selected layer to set the alpha value (from 1 to number of allocated layers). |
| alpha | It ranges from 255 (opaque) to 0 (fully transparent). |
| Sint32 CRM64Pro::TileEngine::getLayerAlphaMod | ( | Sint32 | layer | ) |
Get layer alpha modulation.
| layer | Selected layer to get the alpha value (from 1 to number of allocated layers) |
| bool CRM64Pro::TileEngine::setLayerParallaxRatio | ( | Sint32 | layer, |
| float | fPRX, | ||
| float | fPRY ) |
Set the layer parallax ratio.
Changes the real speed of any layer without affecting the rest.
| layer | Selected layer to set the parallax ratio (from 1 to number of allocated layers). |
| fPRX | Parallax ratio on X axis. 0 makes layer independent on X axis, any other value links it. |
| fPRY | Parallax ratio on Y axis. 0 makes layer independent on Y axis, any other value links it. If any linked layer moves, it affects others using this ratio as base. |
| Sint32 CRM64Pro::TileEngine::getLayerParallaxRatio | ( | Sint32 | layer, |
| float * | fPRX, | ||
| float * | fPRY ) |
Get current layer parallax ratio.
| layer | Selected layer to get the parallax ratio (from 1 to number of allocated layers). |
| fPRX | a float pointer filled in with parallax ratio on X axis. If nullptr is passed, the method ignores the retrieving of this value. |
| fPRY | a float pointer filled in with parallax ratio on Y axis. If nullptr is passed, the method ignores the retrieving of this value. |
| Sint32 CRM64Pro::TileEngine::setLayerPosition | ( | Sint32 | layer, |
| float | xpos = TE_KEEP_VALUE, | ||
| float | ypos = TE_KEEP_VALUE ) |
Set the layer absolute position (in pixels).
Changes position for linked layers according to parallax ratios. Layers with parallax ratio 0.0 are independent. Requires valid base mapdata or image set. Special flags: TE_KEEP_VALUE (keep axis value), TE_LAYERPOSITION_BEGINNING/MIDDLE/END (move layer, skips smoothing), TE_LAYERPOSITION_CENTER (center based on viewport).
| layer | Selected layer to set position (from 1 to number of allocated layers). |
| xpos | Flag or value for X axis position. |
| ypos | Flag or value for Y axis position. |
| Sint32 CRM64Pro::TileEngine::getLayerPosition | ( | Sint32 | layer, |
| float * | xpos, | ||
| float * | ypos ) |
Get the current layer position (in pixels).
| layer | Selected layer to get its current position (from 1 to number of allocated layers). |
| xpos | Pointer to float var to store the position on X axis. nullptr if you dont want to retrieve it. |
| ypos | Pointer to float var to store the position on Y axis. nullptr if you dont want to retrieve it. |
| bool CRM64Pro::TileEngine::setLayerAutoScroll | ( | Sint32 | layer, |
| float | xspeed = TE_KEEP_VALUE, | ||
| float | yspeed = TE_KEEP_VALUE ) |
Set the layer AutoScroll speed (in pixels per second).
Changes AutoScroll speed for linked layers according to parallax ratios.
| layer | Selected layer to set autoscroll speed (from 1 to number of allocated layers). |
| xspeed | TE_KEEP_VALUE keeps current X speed. Any other value sets it. |
| yspeed | TE_KEEP_VALUE keeps current Y speed. Any other value sets it. |
Changing speed of others layers. With ratio=0, independent layer.
| Sint32 CRM64Pro::TileEngine::getLayerAutoScroll | ( | Sint32 | layer, |
| float * | xspeed, | ||
| float * | yspeed ) |
Get the layer AutoScroll speed (in pixels per seconds).
| layer | Selected layer to get its current AutoScroll speed (from 1 to number of allocated layers). |
| xspeed | Pointer to float var to store the speed on X axis. nullptr if you dont want to retrieve it. |
| yspeed | Pointer to float var to store the speed on Y axis. nullptr if you dont want to retrieve it. |
| bool CRM64Pro::TileEngine::setLayerMapData | ( | Sint32 | layer, |
| TE_MapData * | map ) |
Assign a mapdata to the given layer.
If the mapdata is already set, it will remove it following resource control policies (see ::eTileEngineResCtrl for further information)
| layer | Selected layer to try to set a new mapdata (from 1 to number of allocated layers) |
| map | Pointer to a valid mapdata: TE_MapData or a derivated one. nullptr to try to remove the existing mapdata. |
| TE_MapData * CRM64Pro::TileEngine::getLayerMapData | ( | Sint32 | layer | ) |
Get current mapdata on the layer.
| layer | Selected layer to try to get its mapdata (from 1 to number of allocated layers). |
| bool CRM64Pro::TileEngine::setLayerOnUpdateEnd | ( | Sint32 | layer, |
| TE_OnLayerEnd | myfunc ) |
Set an event function (onUpdateEnd) to be called when the engine finishes updating the layer.
Use nullptr to remove a previous onUpdateEnd event function.
| layer | Number of layer to set the event function (from 1 to number of allocated layers). |
| myfunc | pointer to your custom event function. |
| TileEngine::TE_OnLayerEnd * CRM64Pro::TileEngine::getLayerOnUpdateEnd | ( | Sint32 | layer | ) |
Get current onUpdateEnd event function if any.
| layer | Selected layer to get current onUpdateEnd event function (from 1 to number of allocated layers). |
| bool CRM64Pro::TileEngine::setLayerOnRenderEnd | ( | Sint32 | layer, |
| TE_OnLayerEnd | myfunc ) |
Set an event function (onRenderEnd) to be called when the engine finishes rendering the layer.
Use nullptr to remove a previous onRenderEnd event function.
| layer | Number of layer to set the event function (from 1 to number of allocated layers). |
| myfunc | pointer to your custom event function. |
| TileEngine::TE_OnLayerEnd * CRM64Pro::TileEngine::getLayerOnRenderEnd | ( | Sint32 | layer | ) |
Get current onRenderEnd event function if any.
| layer | Selected layer to get current onRenderEnd event function (from 1 to number of allocated layers). |
| bool CRM64Pro::TileEngine::getLayerName | ( | Sint32 | layer, |
| string & | sName ) |
Get the layer name.
| layer | Selected layer to get its name (from 1 to number of allocated layers). |
| sName | a string containing the layer name. |
| bool CRM64Pro::TileEngine::setLayerName | ( | Sint32 | layer, |
| const string & | sName ) |
Set a new layer name.
| layer | Selected layer to set its name (from 1 to number of allocated layers). |
| sName | The name to give to the layer e.g. 'layer0'. |
| bool CRM64Pro::TileEngine::setLayerGridColor | ( | Sint32 | layer, |
| Uint32 | iColor ) |
Set the grid color for the base mapdata.
It is used for debugging purposes
| layer | Selected layer to set the grid color (from 1 to number of allocated layers). |
| iColor | packed unsigned int with the color value (RGBA). |
| bool CRM64Pro::TileEngine::screen2LayerCell | ( | Sint32 | layer, |
| Sint32 | sx, | ||
| Sint32 | sy, | ||
| Sint32 * | cx, | ||
| Sint32 * | cy ) |
Convert screen coordinates into layer cell (tile) indices.
Useful for identifying which specific tile a player is hovering over.
| layer | Selected layer (from 1 to number of allocated layers). |
| sx | Screen X coordinate (e.g., mouse position). |
| sy | Screen Y coordinate (e.g., mouse position). |
| cx | Pointer to integer where the Cell X index will be returned. |
| cy | Pointer to integer where the Cell Y index will be returned. |
| bool CRM64Pro::TileEngine::screen2LayerAbsolute | ( | Sint32 | layer, |
| Sint32 | sx, | ||
| Sint32 | sy, | ||
| Sint32 * | px, | ||
| Sint32 * | py ) |
Convert screen coordinates to absolute layer pixel coordinates.
Useful for mouse picking or identifying world positions.
| layer | Selected layer (from 1 to number of allocated layers). |
| sx | Screen X coordinate (e.g., mouse position). |
| sy | Screen Y coordinate (e.g., mouse position). |
| px | Pointer to integer where the absolute X position will be returned. |
| py | Pointer to integer where the absolute Y position will be returned. |
| Sint32 CRM64Pro::TileEngine::moveLayer | ( | Sint32 | layer, |
| float | x, | ||
| float | y ) |
Move the layer by adding or subtracting the given X/Y values.
Changes position for linked layers according to parallax ratios. Layers with parallax ratio 0.0 are independent.
| layer | Selected layer to move (from 1 to number of allocated layers). |
| x | Float X value, positive or negative. 0 does nothing. |
| y | Float Y value, positive or negative. 0 does nothing. |
| Sint32 CRM64Pro::TileEngine::update | ( | Sint32 | layer = 0 | ) |
Update status of the TileEngine.
Only layers with TE_LAYERFEATURE_UPDATE flag are processed. Calculates autoscroll and pre-calculations for rendering. Call as part of logic code. Optionally update individual layers. Calls onUpdateEnd event function at end of each layer update if it exists.
| layer | Default 0 updates all layers from 1 (background) to foreground. Any other value updates only that layer. |
| Sint32 CRM64Pro::TileEngine::render | ( | Sint32 | layer = 0, |
| Sint32 | idRes = 0 ) |
Render the visible layers.
Only layers with TE_LAYERFEATURE_RENDER flag are processed. Uses positions from update() to render cells. Call as part of graphic update code. Select rendering order by calling with specific layers. Calls onRenderEnd at end of each layer. With TE_LAYERFEATURE_SMOOTHSCROLL, interpolates values for smooth scrolling.
| layer | Default 0 processes all layers. Values 1 (background) to foreground process only that layer. |
| idRes | a valid screen. Default tries the default screen. Does not support rendering to an image. |
| Sint32 CRM64Pro::TileEngine::importLayerFromFile | ( | Sint32 | layer, |
| const string & | sFile, | ||
| const string & | sLayerName, | ||
| Sint32 | tileSizeX, | ||
| Sint32 | tileSizeY, | ||
| float | maxDevPercentage = 100.0, | ||
| Sint32 | iCK = -1 ) |
Import an image file (BMP or PNG) into a layer.
Creates a new base mapdata and tileset. Selected layer must be empty (no mapdata). Level name is used for layer and tileset names.
| layer | Selected layer ID (from 1 to number of allocated layers). |
| sFile | string containing [directory]+filename+[BMP or PNG extension]. Directory separators '\' and '/' are supported. |
| sLayerName | layer name. If empty, file name is used. |
| tileSizeX | Tile width to divide image. 0 creates an imagelayer. |
| tileSizeY | Tile height to divide image. 0 creates an imagelayer. |
| maxDevPercentage | Percentage of differing pixels before tile is unique. Default 100% gets only identical tiles. |
| iCK | For images without alpha, this RGB color is transparent. Default -1 (disabled). |
| Sint32 CRM64Pro::TileEngine::importLayerFromImage | ( | Sint32 | layer, |
| Sint32 | idImg, | ||
| const string & | sLayerName, | ||
| Sint32 | tileSizeX, | ||
| Sint32 | tileSizeY, | ||
| float | maxDevPercentage = 100.0, | ||
| Sint32 | iCK = -1 ) |
Import an image into a layer.
Creates a new base mapdata and tileset. Selected layer must be empty (no mapdata). Level name is used for layer and tileset names.
| layer | Selected layer ID (from 1 to number of allocated layers). |
| idImg | Image ID to import. |
| sLayerName | layer name. If empty, image name is used. |
| tileSizeX | Tile width to divide image. 0 creates an imagelayer. |
| tileSizeY | Tile height to divide image. 0 creates an imagelayer. |
| maxDevPercentage | Percentage of differing pixels before tile is unique. Default 100% gets only identical tiles. |
| iCK | For images without alpha, this RGB color is transparent. Default -1 (disabled). |
| Sint32 CRM64Pro::TileEngine::exportLayerToFile | ( | Sint32 | layer, |
| const string & | sFile ) |
Export a layer to an external PNG image.
| layer | Layer to export, from 1 to number of allocated layers or 0 to export all layers. The layer must has TE_LAYERFEATURE_RENDER flag. |
| sFile | string containing the [directory]+filename+[extension]. |
| Sint32 CRM64Pro::TileEngine::exportLayerToImage | ( | Sint32 | layer, |
| Sint32 | idImg ) |
Export a layer to an image.
| layer | Layer to export, from 1 to number of allocated layers or 0 to export all layers. The layer must has TE_LAYERFEATURE_RENDER flag. |
| idImg | Image ID. The image should not have assigned any surface. |
| Sint32 CRM64Pro::TileEngine::save | ( | const string & | sTMXFile, |
| const string & | sLevelName = "", | ||
| const string & | sCDCFile = "", | ||
| bool | bForce = false ) |
Save level to native C64TE format (TMX-based).
Saves the TileEngine level to the native C64TE format, which is based on Tiled TMX v1.10 (orthogonal, right-down render order). The level can be saved as standalone TMX files on disk or packaged within a CDC archive, with flexible control over TileSet resource locations.
TileSet source handling:
Output modes:
| sTMXFile | string containing [directory]+filename+[extension] for the TMX file. Directory separators '\' and '/' are supported. Extension optional. |
| sLevelName | Optional level name override. If empty, uses current level name. |
| sCDCFile | Optional CDC archive path. If empty, saves as external disk files. If specified, saves to CDC archive (behavior depends on bForce flag). |
| bForce | If true, consolidates all resources to target destination (disk or CDC). If false (default), respects original resource storage modes. |