diff options
author | Nipun Garg | 2019-03-13 13:53:47 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:41 +0200 |
commit | 74ff415903df1a93eada3843db1f85831b88d151 (patch) | |
tree | 9e228606daaf90acdc5ca489314bb4ea346e8bfc /engines/hdb/hdb.h | |
parent | 50e2b5b5bf09caa20d2d2088d997fe8991efb93e (diff) | |
download | scummvm-rg350-74ff415903df1a93eada3843db1f85831b88d151.tar.gz scummvm-rg350-74ff415903df1a93eada3843db1f85831b88d151.tar.bz2 scummvm-rg350-74ff415903df1a93eada3843db1f85831b88d151.zip |
HDB: Add decompresser to readMPC()
The .MPC decompression methods are added to readMPC(). The position and
length of each data file in held in the struct DataFile, which are stored in the
Array gameData. To extract a file, you need to access its entry in
gameData and read the file from the given position.
Diffstat (limited to 'engines/hdb/hdb.h')
-rw-r--r-- | engines/hdb/hdb.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h index 8954cc0b01..4fe1156a23 100644 --- a/engines/hdb/hdb.h +++ b/engines/hdb/hdb.h @@ -24,12 +24,16 @@ #define HDB_HDB_H #include "common/scummsys.h" +#include "common/array.h" #include "common/error.h" -#include "common/random.h" #include "common/file.h" -#include "common/array.h" +#include "common/events.h" +#include "common/str.h" + #include "gui/debugger.h" #include "engines/engine.h" +#include "engines/util.h" +#include "console.h" struct ADGameDescription; @@ -53,8 +57,34 @@ public: Common::Platform getPlatform() const; private: + + Console *_console; + Common::File file; + + struct { + byte signature[5]; // 4 Bytes + '\0' + uint32 dirOffset; + uint32 dirSize; + + bool isValid() { + return (signature[0] == 'M') && + (signature[1] == 'P') && + (signature[2] == 'C') && + (signature[3] == 'U') && + (signature[4] == '\0'); + } + + } dataHeader; + + struct DataFile { + byte fileName[65]; // 65 Bytes + '\0' + uint32 filePosition; + uint32 fileLength; + uint32 unknownField1; + uint32 unknownField2; + }; - Common::RandomSource _random; + Common::Array<DataFile*> gameData; void readMPC(const Common::String &fileName); }; |