![]() |
CRM64Pro GDK v0.14.0
A free cross-platform game development kit built on top of SDL 3.0
|
Image Manager class.
Public Member Functions | |
| bool | info (Sint32 iMode=0) override |
| Request Image Manager information. | |
| Sint32 | create (const string &sName, Uint32 iVersion=10) override |
| Creates a new image. | |
| bool | close (Sint32 idImg) override |
| Close and destroy an image. | |
| Sint32 | getCount () const override |
| Get number of loaded objects. | |
| Sint32 | setName (Sint32 idImg, const string &sName) override |
| Change the object name. | |
| bool | closeEx (Sint32 idImg, Uint32 iOwner) |
| Close and destroy an image. | |
| Image * | get (Sint32 idImg) |
| Get a pointer to the image using its handler. | |
| Sint32 | duplicate (Sint32 idImg, const string &sName) |
| Duplicate an image creating a new, identical and independent one. | |
| Sint32 | child (Sint32 idImg) |
| Create a child image dependent on the provided one (the parent). | |
| bool | isBMP (const string &sFile) |
| Check if the file is a BMP. | |
| bool | isPNG (const string &sFile) |
| Check if the file is a PNG. | |
| Sint32 | loadFromFile (const string &sFile, const string &sName="") |
| Load an image from an external file (BMP or PNG formats). | |
| Sint32 | load (const string &sCDCFile, const string &sName) |
| Load an image stored in a CDC file. | |
| Sint32 | load (const Sint32 idCDC, const string &sName) |
| Load an image stored in a CDC file. | |
| Sint32 | loadFromBuffer (const void *pBuffer, Sint32 iSize, const string &sName) |
| Load an image (BMP or PNG formats) stored on a memory buffer. | |
| Sint32 | remove (Sint32 idCDC, const string &sName) |
| Remove an image stored in a CDC file. | |
| bool | exist (Sint32 idCDC, const string &sName) |
| Check if an image is stored in a CDC file. | |
| bool | exist (const string &sCDCFile, const string &sName) |
| Check if an image is stored in a CDC file. | |
|
override |
Request Image Manager information.
Writes information to the default log.
| iMode | -1 to display only manager information. 0 (default) to display manager and all objects. Specific object ID to display manager and only that object. |
|
override |
Creates a new image.
Creates an empty image (no source surface). Use Image::assignSurface() to assign the source surface.
| sName | The image name (e.g. 'myImage'). Must be unique, max 64 characters (truncated if longer). Cannot start with '#'. |
| iVersion | Image version. 10 means v1.0 (only version supported). Default v1.0. |
|
override |
Close and destroy an image.
This method can only close images belonging to the default owner (ImageMgr).
| idImg | 0 for closing all images, or specific Image id. Stand-alone and child images can be closed; parent images cannot while they have children. |
|
override |
Get number of loaded objects.
|
override |
Change the object name.
| idImg | Image id. |
| sName | The image name (e.g. 'myImage'). Must be unique, max 64 characters (truncated if longer). Cannot start with '#'. |
| bool CRM64Pro::ImageMgr::closeEx | ( | Sint32 | idImg, |
| Uint32 | iOwner ) |
Close and destroy an image.
Can close images belonging to any owner, but owner must be provided as a security check.
| idImg | 0 for closing all images, or specific Image id. Stand-alone and child images can be closed; parent images cannot while they have children. |
| iOwner | Owner of the image. |
| Image * CRM64Pro::ImageMgr::get | ( | Sint32 | idImg | ) |
Get a pointer to the image using its handler.
| idImg | Image id. |
| Sint32 CRM64Pro::ImageMgr::duplicate | ( | Sint32 | idImg, |
| const string & | sName ) |
Duplicate an image creating a new, identical and independent one.
| idImg | Image id to be duplicated. |
| sName | The image name (e.g. 'myImage'). Must be unique, max 64 characters (truncated if longer). Cannot start with '#'. |
| Sint32 CRM64Pro::ImageMgr::child | ( | Sint32 | idImg | ) |
Create a child image dependent on the provided one (the parent).
A child image uses the parent's source surface and textures but can have different attributes. Useful for saving memory.
| idImg | parent Image id. If the provided image is a child, the request is redirected to its parent. |
| bool CRM64Pro::ImageMgr::isBMP | ( | const string & | sFile | ) |
Check if the file is a BMP.
| sFile | string containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported. |
| bool CRM64Pro::ImageMgr::isPNG | ( | const string & | sFile | ) |
Check if the file is a PNG.
| sFile | string containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported. |
| Sint32 CRM64Pro::ImageMgr::loadFromFile | ( | const string & | sFile, |
| const string & | sName = "" ) |
Load an image from an external file (BMP or PNG formats).
| sFile | string containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported. |
| sName | the image object name. If empty (default), uses filename without extension. Must be unique, max 64 characters. |
| Sint32 CRM64Pro::ImageMgr::load | ( | const string & | sCDCFile, |
| const string & | sName ) |
Load an image stored in a CDC file.
| sCDCFile | string containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported. |
| sName | string with the image name (max 64 characters). If already exists, creates a child instead. |
| Sint32 CRM64Pro::ImageMgr::load | ( | const Sint32 | idCDC, |
| const string & | sName ) |
Load an image stored in a CDC file.
| idCDC | CDC id. |
| sName | string with the image name (max 64 characters). If already exists, creates a child instead. |
| Sint32 CRM64Pro::ImageMgr::loadFromBuffer | ( | const void * | pBuffer, |
| Sint32 | iSize, | ||
| const string & | sName ) |
Load an image (BMP or PNG formats) stored on a memory buffer.
| pBuffer | buffer pointer containing the BMP or PNG raw data. |
| iSize | size in bytes of the buffer. |
| sName | the image object name. Must be unique, max 64 characters. |
| Sint32 CRM64Pro::ImageMgr::remove | ( | Sint32 | idCDC, |
| const string & | sName ) |
Remove an image stored in a CDC file.
| idCDC | CDC id. |
| sName | string with the image name (maximum size of 64 characters). |
| bool CRM64Pro::ImageMgr::exist | ( | Sint32 | idCDC, |
| const string & | sName ) |
Check if an image is stored in a CDC file.
| idCDC | CDC id. |
| sName | string with the image name (maximum size of 64 characters). |
| bool CRM64Pro::ImageMgr::exist | ( | const string & | sCDCFile, |
| const string & | sName ) |
Check if an image is stored in a CDC file.
| sCDCFile | Path to the CDC archive file. |
| sName | string with the image name (maximum size of 64 characters). |