Main Page   Class Hierarchy   Compound List   File List   Compound Members  

KrResourceVault Class Reference

The vault is a container for resources. More...

#include <vault.h>

List of all members.

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.

KrResourceGetResource (const std::string &type, const std::string &name)
 Return a pointer to a resource. Null if the resource isn't found.

KrResourceGetResource (U32 type, const std::string &name)
 Return a pointer to a resource. Null if the resource isn't found.

KrResourceGetResource (U32 type, U32 resourceId)
 Return a pointer to a resource. Null if the resource isn't found.

KrSpriteResourceGetSpriteResource (const std::string &name)
 Return a pointer to a resource. Null if the resource isn't found.

KrSpriteResourceGetSpriteResource (U32 resourceId)
 Return a pointer to a resource. Null if the resource isn't found.

KrTileResourceGetTileResource (const std::string &name)
 Return a pointer to a resource. Null if the resource isn't found.

KrTileResourceGetTileResource (U32 resourceId)
 Return a pointer to a resource. Null if the resource isn't found.

KrFontResourceGetFontResource (const std::string &name)
 Return a pointer to a resource. Null if the resource isn't found.

KrFontResourceGetFontResource (U32 resourceId)
 Return a pointer to a resource. Null if the resource isn't found.

KrTextDataResourceGetTextDataResource (const std::string &name)
 Return a pointer to a resource. Null if the resource isn't found.

KrTextDataResourceGetTextDataResource (U32 resourceId)
 Return a pointer to a resource. Null if the resource isn't found.

KrBinaryDataResourceGetBinaryDataResource (const std::string &name)
 Return a pointer to a resource. Null if the resource isn't found.

KrBinaryDataResourceGetBinaryDataResource (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.


Detailed Description

The vault is a container for resources.

The sequence of steps generally followed is:

It would be bad to delete resources the engine is using.

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.


Member Function Documentation

GlSListIterator< KrResource* > KrResourceVault::GetResourceIterator  
 

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.

bool KrResourceVault::LoadDatFile const char *    fileName
 

Load in a .dat file from disk.

Only one dat files can be loaded into a vault; but the engine can use multiple vaults.

bool KrResourceVault::LoadDatFileFromMemory void *    memory,
int    size
 

Load in a .dat file from disk.

Only one dat files can be loaded into a vault; but the engine can use multiple vaults.


The documentation for this class was generated from the following file:
Generated on Mon Sep 15 12:01:11 2003 for Kyra by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001