From f017940ca08e32a206982376df0bdc334acdea55 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 21 Sep 2016 00:50:53 +0300 Subject: CHEWY: Initial work on game videos --- engines/chewy/resource.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'engines/chewy/resource.cpp') diff --git a/engines/chewy/resource.cpp b/engines/chewy/resource.cpp index eae3896826..6a1b860d5b 100644 --- a/engines/chewy/resource.cpp +++ b/engines/chewy/resource.cpp @@ -226,4 +226,25 @@ Common::String TextResource::getText(uint num) { return str; } +VideoChunk *VideoResource::getVideoHeader(uint num) { + assert(num < _chunkList.size()); + + Chunk *chunk = &_chunkList[num]; + VideoChunk *vid = new VideoChunk(); + + _stream.seek(chunk->pos, SEEK_SET); + + if (_stream.readUint32BE() != MKTAG('C', 'F', 'O', '\0')) + error("Corrupt video resource"); + + vid->size = _stream.readUint32LE(); // always 0 + vid->frameCount = _stream.readUint16LE(); + vid->width = _stream.readUint16LE(); + vid->height = _stream.readUint16LE(); + vid->frameDelay = _stream.readUint32LE(); + vid->firstFrameOffset = _stream.readUint32LE(); // always 22 + + return vid; +} + } // End of namespace Chewy -- cgit v1.2.3