aboutsummaryrefslogtreecommitdiff
path: root/engines/chewy/resource.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/chewy/resource.h')
-rw-r--r--engines/chewy/resource.h38
1 files changed, 35 insertions, 3 deletions
diff --git a/engines/chewy/resource.h b/engines/chewy/resource.h
index d9665ceb4a..b869840975 100644
--- a/engines/chewy/resource.h
+++ b/engines/chewy/resource.h
@@ -65,9 +65,6 @@ enum ResourceType {
kResourceTCF = 26 // error messages, used in err/err_e.tcf (English) and err/err_d.tcf (German)
};
-// 4 + 2 + 2 + 4 + 2 + 2 + 768 = 784 bytes
-#define TBF_CHUNK_HEADER_SIZE 784
-
// Generic chunk header
struct Chunk {
uint32 size;
@@ -89,6 +86,30 @@ struct TBFChunk {
byte *data;
};
+// TAF (sprite) chunk header
+/*struct TAFHeader {
+ // TAF chunk header
+ // ID (TAF, followed by a zero)
+ uint16 screenMode;
+ uint16 spriteCount;
+ uint32 size; // total size (width * height) of all sprites
+ byte palette[3 * 256];
+ uint32 nextSpriteOffset;
+ uint16 correctionTable;
+ // 1 byte padding
+};*/
+
+// TAF (sprite) image data chunk header - 15 bytes
+struct TAFChunk {
+ uint16 compressionFlag;
+ uint16 width;
+ uint16 height;
+ // 4 bytes next sprite offset
+ // 4 bytes sprite image offset
+ // 1 byte padding
+ byte *data;
+};
+
// Sound chunk header
struct SoundChunk {
uint32 size;
@@ -125,6 +146,9 @@ public:
virtual byte *getChunkData(uint num);
protected:
+ void initSprite(Common::String filename);
+ void unpackRLE(byte *buffer, uint32 compressedSize, uint32 uncompressedSize);
+
Common::File _stream;
uint16 _chunkCount;
ResourceType _resType;
@@ -133,6 +157,14 @@ protected:
ChunkList _chunkList;
};
+class SpriteResource : public Resource {
+public:
+ SpriteResource(Common::String filename) : Resource(filename) {}
+ ~SpriteResource() {}
+
+ TAFChunk *getSprite(uint num);
+};
+
class BackgroundResource : public Resource {
public:
BackgroundResource(Common::String filename) : Resource(filename) {}