diff options
Diffstat (limited to 'engines/kyra/resource.h')
-rw-r--r-- | engines/kyra/resource.h | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 90405690a4..167ccd7943 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -41,15 +41,6 @@ namespace Kyra { -struct InsHofArchive { - Common::String filename; - uint32 firstFile; - uint32 startOffset; - uint32 lastFile; - uint32 endOffset; - uint32 totalSize; -}; - struct ResFileEntry { Common::String parent; uint32 size; @@ -61,20 +52,21 @@ struct ResFileEntry { enum kType { kRaw = 0, kPak = 1, - kInsKyra = 2, - kInsHof = 3, - kInsMal = 4, - kTlk = 5, + kInsMal = 2, + kTlk = 3, kAutoDetect }; kType type; uint32 offset; +}; - int fileIndex; - uint32 compressedSize; +struct CompFileEntry { + uint32 size; + uint8 *data; }; typedef Common::HashMap<Common::String, ResFileEntry, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> ResFileMap; +typedef Common::HashMap<Common::String, CompFileEntry, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> CompFileMap; class Resource; class ResArchiveLoader { @@ -100,6 +92,14 @@ public: protected: }; +class CompArchiveLoader { +public: + virtual ~CompArchiveLoader() {} + + virtual bool checkForFiles() const = 0; + virtual bool loadFile(CompFileMap &loadTo) const = 0; +}; + class Resource { public: Resource(KyraEngine_v1 *vm); @@ -136,6 +136,15 @@ protected: LoaderList _loaders; ResFileMap _map; + typedef Common::List<Common::SharedPtr<CompArchiveLoader> > CompLoaderList; + typedef CompLoaderList::iterator CompLoaderIterator; + typedef CompLoaderList::const_iterator CCompLoaderIterator; + CompLoaderList _compLoaders; + CompFileMap _compFiles; + + void tryLoadCompFiles(); + void clearCompFileList(); + KyraEngine_v1 *_vm; }; @@ -376,3 +385,4 @@ private: + |