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

Scene Manager class. More...

Detailed Description

Scene Manager class.

Public Member Functions

bool info (Sint32 iMode=0) override
 Request Scene Manager information.
Sint32 create (const string &sName, Uint32 iNumLayers=3) override
 Create a new Scene.
Sint32 close (Sint32 idScene) override
 Close and destroy a Scene.
Sint32 getCount () const override
 Get number of loaded objects.
Sint32 setName (Sint32 idScene, const string &sName) override
 Change the object name.
Sceneget (Sint32 idScene)
 Get a pointer to the Scene using its handle.
Sint32 loadFromFile (const string &sTMXFile, ISceneObjectFactory *pFactory=nullptr)
 Load a level from a TMX file.
Sint32 load (const string &sCDCFile, const string &sTMXFile, ISceneObjectFactory *pFactory=nullptr)
 Load a level from a TMX file stored in a CDC file.
Sint32 load (Sint32 idCDC, const string &sTMXFile, ISceneObjectFactory *pFactory=nullptr)
 Load a level from a TMX file stored in a CDC file.
Sint32 loadFromBuffer (const void *pBuffer, Sint32 iSize, const string &sTMXFile, const string &sCDCFile="", ISceneObjectFactory *pFactory=nullptr)
 Load a level from a TMX memory buffer.

Member Function Documentation

◆ loadFromFile()

Sint32 CRM64Pro::SceneMgr::loadFromFile ( const string & sTMXFile,
ISceneObjectFactory * pFactory = nullptr )

Load a level from a TMX file.

Parameters
sTMXFilestring containing [directory]+filename+[extension] of the TMX file. Directory separators '\' and '/' are supported.
pFactoryOptional pointer to a custom object factory for creating objects during load.
Returns
Greater than 0 on success (the Scene id), or a negative error code on failure.

◆ load() [1/2]

Sint32 CRM64Pro::SceneMgr::load ( const string & sCDCFile,
const string & sTMXFile,
ISceneObjectFactory * pFactory = nullptr )

Load a level from a TMX file stored in a CDC file.

Parameters
sCDCFilestring containing [directory]+filename+[extension] of a CDC file.
sTMXFilestring containing the name of the TMX file inside the CDC.
pFactoryOptional pointer to a custom object factory for creating objects during load.
Returns
Greater than 0 on success (the Scene id), or a negative error code on failure.

◆ load() [2/2]

Sint32 CRM64Pro::SceneMgr::load ( Sint32 idCDC,
const string & sTMXFile,
ISceneObjectFactory * pFactory = nullptr )

Load a level from a TMX file stored in a CDC file.

Parameters
idCDCCDC id of an open CDC file.
sTMXFilestring containing the name of the TMX file inside the CDC.
pFactoryOptional pointer to a custom object factory for creating objects during load.
Returns
Greater than 0 on success (the Scene id), or a negative error code on failure.

◆ loadFromBuffer()

Sint32 CRM64Pro::SceneMgr::loadFromBuffer ( const void * pBuffer,
Sint32 iSize,
const string & sTMXFile,
const string & sCDCFile = "",
ISceneObjectFactory * pFactory = nullptr )

Load a level from a TMX memory buffer.

Parameters
pBufferpointer to buffer data containing the TMX XML.
iSizesize in bytes of the buffer data.
sTMXFilestring containing the TMX name used to resolve relative resources.
sCDCFileOptional CDC archive path used to resolve CDC resources.
pFactoryOptional pointer to a custom object factory for creating objects during load.
Returns
Greater than 0 on success (the Scene id), or a negative error code on failure.