TileEngine Manager class.
More...
TileEngine Manager class.
|
| bool | info (Sint32 iMode=0) override |
| | Request TileEngine Manager information.
|
| Sint32 | create (const string &sName, Uint32 iNumLayers=3) override |
| | Create a new TileEngine.
|
| bool | close (Sint32 idTE) override |
| | Close and destroy a TileEngine.
|
| Sint32 | getCount () const override |
| | Get number of loaded objects.
|
| Sint32 | setName (Sint32 idTE, const string &sName) override |
| | Change the object name.
|
| TileEngine * | get (Sint32 idTE=0) |
| | Get a pointer to the TileEngine using its handler.
|
| Sint32 | loadFromFile (const string &sTMXFile) |
| | Import a Tiled map (TMX) from a file.
|
| Sint32 | load (const string &sCDCFile, const string &sTMXFile) |
| | Import a Tiled map (TMX) from a CDC file.
|
| Sint32 | load (const Sint32 idCDC, const string &sTMXFile) |
| | Import a Tiled map (TMX) from a CDC file.
|
◆ info()
| bool CRM64Pro::TileEngineMgr::info |
( |
Sint32 | iMode = 0 | ) |
|
|
override |
Request TileEngine Manager information.
Writes information to the default log.
- Parameters
-
| iMode | -1 for Manager info only. 0 (default) for Manager and all Objects. A positive TE id for Manager and that specific TileEngine. |
- Returns
- true on success, or false on failure.
◆ create()
| Sint32 CRM64Pro::TileEngineMgr::create |
( |
const string & | sName, |
|
|
Uint32 | iNumLayers = 3 ) |
|
override |
Create a new TileEngine.
Default viewport is 320x200 starting at (0,0).
- Parameters
-
| sName | The level name (e.g. 'myLevel'), also used for TileEngine object name. Must be unique and max 64 characters (truncated if longer). |
| iNumLayers | layers to allocate. Default 3. Use setLayerCount() to dynamically change this. |
- Returns
- greater than 0 on success (the TileEngine id) or a negative error code on failure.
◆ close()
| bool CRM64Pro::TileEngineMgr::close |
( |
Sint32 | idTE | ) |
|
|
override |
Close and destroy a TileEngine.
- Parameters
-
- Returns
- true on success or false on failure.
- Note
- Unclosed TileEngines are automatically closed when GDK terminates. Tilesets/mapdata with TERC_USER resource control must be freed manually after calling this method.
◆ getCount()
| Sint32 CRM64Pro::TileEngineMgr::getCount |
( |
| ) |
const |
|
override |
Get number of loaded objects.
- Returns
- the number of TileEngine objects.
◆ setName()
| Sint32 CRM64Pro::TileEngineMgr::setName |
( |
Sint32 | idTE, |
|
|
const string & | sName ) |
|
override |
Change the object name.
- Parameters
-
| idTE | TileEngine id. |
| sName | The name (e.g. 'myTE'). Must be unique and max 64 characters (truncated if longer). |
- Returns
- 0 on success, or a negative error code on failure.
◆ get()
| TileEngine * CRM64Pro::TileEngineMgr::get |
( |
Sint32 | idTE = 0 | ) |
|
◆ loadFromFile()
| Sint32 CRM64Pro::TileEngineMgr::loadFromFile |
( |
const string & | sTMXFile | ) |
|
Import a Tiled map (TMX) from a file.
Supports TMX v1.10 files, orthogonal view. Detects and loads embedded C64TE map format.
- Parameters
-
| sTMXFile | string containing [directory]+filename+[extension] of TMX file. Directory separators '\' and '/' are supported. |
- Returns
- greater than 0 on success (the TileEngine id) or a negative error code on failure.
- Note
- Loads tilesets with spacing!=0 and/or margin!=0 by internally converting them to spacing=0 and margin=0.
◆ load() [1/2]
| Sint32 CRM64Pro::TileEngineMgr::load |
( |
const string & | sCDCFile, |
|
|
const string & | sTMXFile ) |
Import a Tiled map (TMX) from a CDC file.
Supports TMX v1.10 files, orthogonal view. Detects and loads embedded C64TE map format.
- Parameters
-
| sCDCFile | string containing [directory]+filename+[extension] of CDC file for tileset images. Directory separators '\' and '/' are supported. |
| sTMXFile | string containing name of TMX file inside the CDC. |
- Returns
- greater than 0 on success (the TileEngine id) or a negative error code on failure.
- Note
- Loads tilesets with spacing!=0 and/or margin!=0 by internally converting them to spacing=0 and margin=0.
◆ load() [2/2]
| Sint32 CRM64Pro::TileEngineMgr::load |
( |
const Sint32 | idCDC, |
|
|
const string & | sTMXFile ) |
Import a Tiled map (TMX) from a CDC file.
Supports TMX v1.10 files, orthogonal view. Detects and loads embedded C64TE map format.
- Parameters
-
| idCDC | CDC id of an open CDC file. |
| sTMXFile | string containing name of TMX file inside the CDC. |
- Returns
- greater than 0 on success (the TileEngine id) or a negative error code on failure.
- Note
- Loads tilesets with spacing!=0 and/or margin!=0 by internally converting them to spacing=0 and margin=0.