diff options
author | Paul Gilbert | 2017-09-10 19:32:26 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-09-10 19:32:26 -0400 |
commit | 25ae67b8703cd96e89bf083a06bceca770da1436 (patch) | |
tree | 17ff7f205c81071d9c3c72d9b8610ff50ad62e28 /engines/titanic/support/avi_surface.h | |
parent | 66150ee064ebeb5faf3a941136a8cd7256a89f7a (diff) | |
download | scummvm-rg350-25ae67b8703cd96e89bf083a06bceca770da1436.tar.gz scummvm-rg350-25ae67b8703cd96e89bf083a06bceca770da1436.tar.bz2 scummvm-rg350-25ae67b8703cd96e89bf083a06bceca770da1436.zip |
TITANIC: Created custom stream reader to fix bad y222.avi header
Diffstat (limited to 'engines/titanic/support/avi_surface.h')
-rw-r--r-- | engines/titanic/support/avi_surface.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h index cb2e562d54..03f8f24cfe 100644 --- a/engines/titanic/support/avi_surface.h +++ b/engines/titanic/support/avi_surface.h @@ -23,6 +23,7 @@ #ifndef TITANIC_AVI_SURFACE_H #define TITANIC_AVI_SURFACE_H +#include "common/stream.h" #include "video/avi_decoder.h" #include "graphics/managed_surface.h" #include "titanic/core/resource_key.h" @@ -41,6 +42,37 @@ enum MovieFlag { MOVIE_WAIT_FOR_FINISH = 0x10 // Let finish before playing next movie for object }; +/** + * This implements a special read stream for the y222.avi video + * that fixes that totalFrames field of the header from it's + * incorrect value of 1 to a correct 1085. + */ +class y222 : virtual public Common::SeekableReadStream { +private: + File *_innerStream; +public: + y222(); + virtual ~y222(); + + virtual uint32 read(void *dataPtr, uint32 dataSize); + virtual bool eos() const { return _innerStream->eos(); } + virtual int32 pos() const { return _innerStream->pos(); } + virtual int32 size() const { return _innerStream->size(); } + virtual bool seek(int32 offset, int whence = SEEK_SET) { + return _innerStream->seek(offset, whence); + } + virtual bool skip(uint32 offset) { + return _innerStream->skip(offset); + } + virtual char *readLine(char *s, size_t bufSize) { + return _innerStream->readLine(s, bufSize); + } + virtual Common::String readLine() { + return _innerStream->readLine(); + } +}; + + class AVIDecoder : public Video::AVIDecoder { public: AVIDecoder() {} |