aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/barchive.h
diff options
context:
space:
mode:
authorDenis Kasak2009-06-15 03:48:16 +0000
committerDenis Kasak2009-06-15 03:48:16 +0000
commit326cf7e735062d399f6fe5f2ae79ac8f34e8b61b (patch)
treed982b7b1066e70240d8af7f29760da532da872ab /engines/draci/barchive.h
parenta3a9f5c790a8b669597b087b761f887fc5a77228 (diff)
downloadscummvm-rg350-326cf7e735062d399f6fe5f2ae79ac8f34e8b61b.tar.gz
scummvm-rg350-326cf7e735062d399f6fe5f2ae79ac8f34e8b61b.tar.bz2
scummvm-rg350-326cf7e735062d399f6fe5f2ae79ac8f34e8b61b.zip
Added support for DFW format archives. Rewrote some BArchive methods to be able to seamlessly handle both BAR and DFW archives. Modified the BAFile struct to support both types of files. Tested it by enabling the mouse in the event loop (the cursor was stored in a DFW file). Added and rewrote docs to reflect the changes.
svn-id: r41533
Diffstat (limited to 'engines/draci/barchive.h')
-rw-r--r--engines/draci/barchive.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/draci/barchive.h b/engines/draci/barchive.h
index 683ec50a67..0971375c7b 100644
--- a/engines/draci/barchive.h
+++ b/engines/draci/barchive.h
@@ -35,10 +35,12 @@ namespace Draci {
*/
struct BAFile {
- uint16 _length;
- uint32 _offset; //!< Offset of file inside archive
+ uint16 _compLength; //!< Compressed length (the same as _length if the file is uncompressed)
+ uint16 _length; //!< Uncompressed length
+ uint32 _offset; //!< Offset of file inside archive
byte *_data;
byte _crc;
+ byte _stopper; //!< Not used in BAR files, needed for DFW
/** Releases the file data (for memory considerations) */
void closeFile(void) {
@@ -62,6 +64,7 @@ public:
private:
// Archive header data
static const char _magicNumber[];
+ static const char _dfwMagicNumber[];
static const unsigned int _archiveHeaderSize = 10;
// File stream header data
@@ -70,6 +73,11 @@ private:
Common::String _path; //!< Path to file
BAFile *_files; //!< Internal array of files
uint16 _fileCount; //!< Number of files in archive
+ bool _isDFW; //!< True if the archive is in DFW format, false otherwise
+
+ void openDFW(const Common::String &path);
+ BAFile *loadFileDFW(unsigned int i) const;
+ BAFile *loadFileBAR(unsigned int i) const;
};
} // End of namespace Draci