#include <resourceprovider.h>
Public Member Functions | |
ResourceProvider (ArchiveLoader *archiveLoader, StateProvider *stateProvider, Global *global) | |
void | initGlobal () |
void | requestLocationChange (uint16 level, uint16 location) |
bool | hasLocationChangeRequest () const |
void | setShouldRestoreCurrentState () |
void | pushAndChangeLocation (int16 level, int16 location) |
void | returnToPushedLocation () |
void | readLocationStack (Common::SeekableReadStream *stream, uint32 version) |
void | writeLocationStack (Common::WriteStream *stream) |
void | performLocationChange () |
void | setNextLocationPosition (const ResourceReference &bookmark, int32 direction) |
void | commitActiveLocationsState () |
void | shutdown () |
Resources::Level * | getLevel (uint16 level) const |
Resources::Location * | getLocation (uint16 level, uint16 location) const |
Resources::Level * | getLevelFromLocation (Resources::Location *location) const |
Game Resource provider.
Maintains a list of resource trees. Maintained trees are the global and the current ones.
void Stark::ResourceProvider::initGlobal | ( | ) |
Load the global archives and fill the global object
void Stark::ResourceProvider::requestLocationChange | ( | uint16 | level, |
uint16 | location | ||
) |
Load the resources for the specified location
|
inline |
Is a location change pending?
void Stark::ResourceProvider::readLocationStack | ( | Common::SeekableReadStream * | stream, |
uint32 | version | ||
) |
Save and restore the previous location stack
void Stark::ResourceProvider::performLocationChange | ( | ) |
Apply a location change request.
Update the global object with the new location. Perform the necessary resource lifecycle updates
void Stark::ResourceProvider::setNextLocationPosition | ( | const ResourceReference & | bookmark, |
int32 | direction | ||
) |
Set the initial position and direction for the next location change
void Stark::ResourceProvider::commitActiveLocationsState | ( | ) |
Save the current location state to the state store.
void Stark::ResourceProvider::shutdown | ( | ) |
Release the global and current resources
Resources::Level* Stark::ResourceProvider::getLevel | ( | uint16 | level | ) | const |
Obtain the root resource for a loaded level
Resources::Location* Stark::ResourceProvider::getLocation | ( | uint16 | level, |
uint16 | location | ||
) | const |
Obtain the root resource for a loaded location
Resources::Level* Stark::ResourceProvider::getLevelFromLocation | ( | Resources::Location * | location | ) | const |
Get the parent level from a currently loaded location