aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/compressed_file.h
diff options
context:
space:
mode:
authorPaul Gilbert2016-02-21 21:35:55 -0500
committerPaul Gilbert2016-02-21 21:35:55 -0500
commitf8c6724112d9b6161a0df8ee31d98d13b36d2b40 (patch)
tree6a8130257234330848e8ea30885fbab51f54906d /engines/titanic/compressed_file.h
parented5ae8412dee5cadef806ad83a049ac1bc85ec4d (diff)
downloadscummvm-rg350-f8c6724112d9b6161a0df8ee31d98d13b36d2b40.tar.gz
scummvm-rg350-f8c6724112d9b6161a0df8ee31d98d13b36d2b40.tar.bz2
scummvm-rg350-f8c6724112d9b6161a0df8ee31d98d13b36d2b40.zip
TITANIC: Fleshed out CompressedFile class
Diffstat (limited to 'engines/titanic/compressed_file.h')
-rw-r--r--engines/titanic/compressed_file.h65
1 files changed, 13 insertions, 52 deletions
diff --git a/engines/titanic/compressed_file.h b/engines/titanic/compressed_file.h
index cd9cf8377d..30b925d9b6 100644
--- a/engines/titanic/compressed_file.h
+++ b/engines/titanic/compressed_file.h
@@ -25,66 +25,27 @@
#include "common/scummsys.h"
#include "common/file.h"
-#include "common/queue.h"
+#include "titanic/compression.h"
#include "titanic/simple_file.h"
#include "titanic/string.h"
namespace Titanic {
-class Decompressor;
-class DecompressorData;
-
-typedef DecompressorData *(Decompressor::*DecompressorCreateFn)(int v1, int v2, int v3);
-typedef void(Decompressor::*DecompressorDestroyFn)(DecompressorData *ptr);
-typedef void(Decompressor::*Method3Fn)();
-
-class DecompressorData {
-public:
- int _field0;
- int _field4;
- int _field8;
- int _fieldC;
- int _field10;
- int _field14;
-public:
- DecompressorData();
-};
-
-class Decompressor {
-private:
- DecompressorCreateFn _createFn;
- DecompressorDestroyFn _destroyFn;
- int _field18;
- DecompressorData *_dataPtr;
- int _field28;
-
- DecompressorData *createMethod(int v1, int v2, int v3);
-
- void destroyMethod(DecompressorData *ptr);
-
- void method3() {
- // TODO
- }
-
- int sub1(Method3Fn fn, int v);
-
- void sub2() {}
-public:
- Decompressor();
-
- void load(const char *version = "1.0.4", int v = 15);
-
- void close();
-};
+enum CompressedFileMode { COMPMODE_NONE, COMPMODE_WRITE, COMPMODE_READ };
+/**
+ * Derived file that handles compressed files
+ */
class CompressedFile : public SimpleFile {
private:
- Decompressor _decompressor;
- Common::Queue<byte> _queue;
- int _fileMode;
- int _isReading;
- int _field260;
- int _mode;
+ Compression _compression;
+ CompressedFileMode _fileMode;
+ byte _writeBuffer[516];
+ byte *_dataStartPtr;
+ byte *_dataPtr;
+ int _dataRemaining;
+ int _dataMaxSize;
+ int _dataCount;
/**
* Decompress data from the source file