aboutsummaryrefslogtreecommitdiff
path: root/engines/director/resource.h
diff options
context:
space:
mode:
authorMatthew Hoops2015-03-08 15:34:48 -0400
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commitde61313e949ad2fe8eb076493fd4990f54a69555 (patch)
tree13f4925e0801c599a698d0cbb24e92d6df0ae585 /engines/director/resource.h
parenta9849314e8c6b78029f9ecaab0bce1016d232dd6 (diff)
downloadscummvm-rg350-de61313e949ad2fe8eb076493fd4990f54a69555.tar.gz
scummvm-rg350-de61313e949ad2fe8eb076493fd4990f54a69555.tar.bz2
scummvm-rg350-de61313e949ad2fe8eb076493fd4990f54a69555.zip
DIRECTOR: Fix RIFX support to actually be useful
Diffstat (limited to 'engines/director/resource.h')
-rw-r--r--engines/director/resource.h27
1 files changed, 9 insertions, 18 deletions
diff --git a/engines/director/resource.h b/engines/director/resource.h
index 0068912a23..93b1bd9d1d 100644
--- a/engines/director/resource.h
+++ b/engines/director/resource.h
@@ -44,7 +44,7 @@ public:
virtual ~Archive();
virtual bool openFile(const Common::String &fileName);
- virtual bool openStream(Common::SeekableReadStream *stream) = 0;
+ virtual bool openStream(Common::SeekableReadStream *stream, uint32 offset = 0) = 0;
virtual void close();
bool isOpen() const { return _stream != 0; }
@@ -70,20 +70,8 @@ protected:
Common::String name;
};
- // Have separate hash/equals functions for tags to make them
- // case-insensitive.
- struct HashTag : public Common::UnaryFunction<uint32, uint> { // Insert Twitter joke
- uint operator()(uint32 val) const { return (uint)Archive::convertTagToUppercase(val); }
- };
-
- struct EqualsTag : public Common::BinaryFunction<uint32, uint32, uint> {
- bool operator()(const uint32 &val1, const uint32 &val2) const {
- return Archive::convertTagToUppercase(val1) == Archive::convertTagToUppercase(val2);
- }
- };
-
typedef Common::HashMap<uint16, Resource> ResourceMap;
- typedef Common::HashMap<uint32, ResourceMap, HashTag, EqualsTag> TypeMap;
+ typedef Common::HashMap<uint32, ResourceMap> TypeMap;
TypeMap _types;
};
@@ -94,7 +82,7 @@ public:
void close();
bool openFile(const Common::String &fileName);
- bool openStream(Common::SeekableReadStream *stream);
+ bool openStream(Common::SeekableReadStream *stream, uint32 startOffset = 0);
Common::SeekableReadStream *getResource(uint32 tag, uint16 id);
private:
@@ -106,16 +94,19 @@ public:
RIFFArchive() : Archive() {}
~RIFFArchive() {}
- bool openStream(Common::SeekableReadStream *stream);
+ bool openStream(Common::SeekableReadStream *stream, uint32 startOffset = 0);
Common::SeekableReadStream *getResource(uint32 tag, uint16 id);
};
class RIFXArchive : public Archive {
public:
- RIFXArchive() : Archive() {}
+ RIFXArchive() : Archive(), _isBigEndian(true) {}
~RIFXArchive() {}
- bool openStream(Common::SeekableReadStream *stream);
+ bool openStream(Common::SeekableReadStream *stream, uint32 startOffset = 0);
+
+private:
+ bool _isBigEndian;
};
} // End of namespace Director