#include <vault.h>
Public Methods | |
bool | LoadDatFile (const char *fileName) |
Load in a .dat file from disk. More... | |
bool | LoadDatFileFromMemory (void *memory, int size) |
Load in a .dat file from disk. More... | |
int | ResourceCount () |
How many resources are in the vault? | |
GlSListIterator< KrResource * > | GetResourceIterator () |
Get an interator that can walk all the resources in this vault. More... | |
void | AddResource (KrResource *resource) |
Add user created resources - generally canvases. Will be owned and deleted by the vault. | |
KrResource * | GetResource (const std::string &type, const std::string &name) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrResource * | GetResource (U32 type, const std::string &name) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrResource * | GetResource (U32 type, U32 resourceId) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrSpriteResource * | GetSpriteResource (const std::string &name) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrSpriteResource * | GetSpriteResource (U32 resourceId) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrTileResource * | GetTileResource (const std::string &name) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrTileResource * | GetTileResource (U32 resourceId) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrFontResource * | GetFontResource (const std::string &name) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrFontResource * | GetFontResource (U32 resourceId) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrTextDataResource * | GetTextDataResource (const std::string &name) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrTextDataResource * | GetTextDataResource (U32 resourceId) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrBinaryDataResource * | GetBinaryDataResource (const std::string &name) |
Return a pointer to a resource. Null if the resource isn't found. | |
KrBinaryDataResource * | GetBinaryDataResource (U32 resourceId) |
Return a pointer to a resource. Null if the resource isn't found. | |
virtual void | CacheScale (GlFixed xScale, GlFixed yScale) |
For cached scaling, cache all the resources in this vault. | |
virtual void | FreeScaleCache () |
For cached scaling, free all the scale caches in this vault. |
The sequence of steps generally followed is:
Note that the engine has a "default vault" Engine()->Vault() that it manages for you. It is usually simpler to use that Vault rather than manage your own.
|
Get an interator that can walk all the resources in this vault. Useful if you want to list resources, for instance if making an editor or allowing the user to choose between available fonts. |
|
Load in a .dat file from disk. Only one dat files can be loaded into a vault; but the engine can use multiple vaults. |
|
Load in a .dat file from disk. Only one dat files can be loaded into a vault; but the engine can use multiple vaults. |