Public Member Functions | |
| Resources (SherlockEngine *vm) | |
| void | addToCache (const Common::Path &filename) |
| void | addToCache (const Common::Path &filename, const Common::Path &libFilename) |
| void | addToCache (const Common::Path &filename, Common::SeekableReadStream &stream) |
| bool | isInCache (const Common::Path &filename) const |
| void | decompressIfNecessary (Common::SeekableReadStream *&stream) |
| Common::SeekableReadStream * | load (const Common::Path &filename) |
| Common::SeekableReadStream * | load (const Common::Path &filename, const Common::Path &libraryFile, bool suppressErrors=false) |
| bool | exists (const Common::Path &filename) const |
| int | resourceIndex () const |
| void | getResourceNames (const Common::Path &libraryFile, Common::StringArray &names) |
| Common::SeekableReadStream * | decompress (Common::SeekableReadStream &source) |
| Common::SeekableReadStream * | decompress (Common::SeekableReadStream &source, uint32 outSize) |
| void | decompress (Common::SeekableReadStream &source, byte *buffer, uint32 outSize) |
Static Public Member Functions | |
| static Common::SeekableReadStream * | decompressLZ (Common::SeekableReadStream &source, uint32 outSize) |
| static void | decompressLZ (Common::SeekableReadStream &source, byte *outBuffer, int32 outSize, int32 inSize) |
| void Sherlock::Resources::addToCache | ( | const Common::Path & | filename | ) |
Adds the specified file to the cache. If it's a library file, takes care of loading its index for future use
| void Sherlock::Resources::addToCache | ( | const Common::Path & | filename, |
| const Common::Path & | libFilename | ||
| ) |
Adds a resource from a library file to the cache
| void Sherlock::Resources::addToCache | ( | const Common::Path & | filename, |
| Common::SeekableReadStream & | stream | ||
| ) |
Adds a given stream to the cache under the given name
| void Sherlock::Resources::decompressIfNecessary | ( | Common::SeekableReadStream *& | stream | ) |
Checks the passed stream, and if is compressed, deletes it and replaces it with its uncompressed data
| Common::SeekableReadStream* Sherlock::Resources::load | ( | const Common::Path & | filename | ) |
Returns a stream for a given file
| Common::SeekableReadStream* Sherlock::Resources::load | ( | const Common::Path & | filename, |
| const Common::Path & | libraryFile, | ||
| bool | suppressErrors = false |
||
| ) |
Loads a specific resource from a given library file
| bool Sherlock::Resources::exists | ( | const Common::Path & | filename | ) | const |
Returns true if the given file exists on disk or in the cache
| int Sherlock::Resources::resourceIndex | ( | ) | const |
Returns the index of the last loaded resource in its given library file. This will be used primarily when loading talk files, so the engine can update the given conversation number in the journal
| void Sherlock::Resources::getResourceNames | ( | const Common::Path & | libraryFile, |
| Common::StringArray & | names | ||
| ) |
Produces a list of all resource names within a file. Used by the debugger.
| Common::SeekableReadStream* Sherlock::Resources::decompress | ( | Common::SeekableReadStream & | source | ) |
Decompresses LZW compressed data
| Common::SeekableReadStream* Sherlock::Resources::decompress | ( | Common::SeekableReadStream & | source, |
| uint32 | outSize | ||
| ) |
Decompresses LZW compressed data
| void Sherlock::Resources::decompress | ( | Common::SeekableReadStream & | source, |
| byte * | buffer, | ||
| uint32 | outSize | ||
| ) |
Decompresses LZW compressed data
|
static |
Decompresses LZW compressed data
|
static |
Decompresses LZW compressed data