aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/files.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/xeen/files.h')
-rw-r--r--engines/xeen/files.h45
1 files changed, 42 insertions, 3 deletions
diff --git a/engines/xeen/files.h b/engines/xeen/files.h
index 7ef126e01d..8a028a95c7 100644
--- a/engines/xeen/files.h
+++ b/engines/xeen/files.h
@@ -33,11 +33,11 @@ namespace Xeen {
class XeenEngine;
+/*
+ * Main resource manager
+ */
class FileManager {
public:
- /**
- * Instantiates the resource manager
- */
static void init(XeenEngine *vm);
};
@@ -53,6 +53,45 @@ public:
void openFile(const Common::String &filename);
};
+/**
+* Xeen CC file implementation
+*/
+class CCArchive : public Common::Archive {
+private:
+ /**
+ * Details of a single entry in a CC file index
+ */
+ struct CCEntry {
+ uint16 _id;
+ uint32 _offset;
+ uint16 _size;
+
+ CCEntry() : _id(0), _offset(0), _size(0) {}
+ CCEntry(uint16 id, uint32 offset, uint32 size)
+ : _id(id), _offset(offset), _size(size) {
+ }
+ };
+
+ Common::Array<CCEntry> _index;
+ Common::String _filename;
+ bool _encoded;
+
+ uint16 convertNameToId(const Common::String &resourceName) const;
+
+ void loadIndex(Common::SeekableReadStream *stream);
+
+ bool getHeaderEntry(const Common::String &resourceName, CCEntry &ccEntry) const;
+public:
+ CCArchive(const Common::String &filename, bool encoded = true);
+ virtual ~CCArchive();
+
+ // Archive implementation
+ virtual bool hasFile(const Common::String &name) const;
+ virtual int listMembers(Common::ArchiveMemberList &list) const;
+ virtual const Common::ArchiveMemberPtr getMember(const Common::String &name) const;
+ virtual Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const;
+};
+
} // End of namespace Xeen
#endif /* XEEN_FILES_H */