diff options
author | Max Horn | 2010-08-04 08:25:05 +0000 |
---|---|---|
committer | Max Horn | 2010-08-04 08:25:05 +0000 |
commit | 0e2807dc27af89c46a191834e5e623a9e77e9187 (patch) | |
tree | a105f2e5207a5aad449d42bf19740668b1716739 /graphics/video | |
parent | 154c589f188914e79ba10da1de947a5ae2c0427e (diff) | |
download | scummvm-rg350-0e2807dc27af89c46a191834e5e623a9e77e9187.tar.gz scummvm-rg350-0e2807dc27af89c46a191834e5e623a9e77e9187.tar.bz2 scummvm-rg350-0e2807dc27af89c46a191834e5e623a9e77e9187.zip |
GRAPHICS: Change signature of VideoDecoder::load()
Now takes a pointer to a stream, instead of a reference.
The rational is that in all instances, callers have a pointer
(and dereference it to call load), and all load implementations
turn the reference back into a pointer.
svn-id: r51725
Diffstat (limited to 'graphics/video')
-rw-r--r-- | graphics/video/avi_decoder.cpp | 4 | ||||
-rw-r--r-- | graphics/video/avi_decoder.h | 2 | ||||
-rw-r--r-- | graphics/video/coktelvideo/coktelvideo.cpp | 12 | ||||
-rw-r--r-- | graphics/video/coktelvideo/coktelvideo.h | 16 | ||||
-rw-r--r-- | graphics/video/dxa_decoder.cpp | 4 | ||||
-rw-r--r-- | graphics/video/dxa_decoder.h | 2 | ||||
-rw-r--r-- | graphics/video/flic_decoder.cpp | 4 | ||||
-rw-r--r-- | graphics/video/flic_decoder.h | 2 | ||||
-rw-r--r-- | graphics/video/qt_decoder.cpp | 4 | ||||
-rw-r--r-- | graphics/video/qt_decoder.h | 2 | ||||
-rw-r--r-- | graphics/video/smk_decoder.cpp | 4 | ||||
-rw-r--r-- | graphics/video/smk_decoder.h | 2 | ||||
-rw-r--r-- | graphics/video/video_decoder.cpp | 2 | ||||
-rw-r--r-- | graphics/video/video_decoder.h | 2 |
14 files changed, 29 insertions, 33 deletions
diff --git a/graphics/video/avi_decoder.cpp b/graphics/video/avi_decoder.cpp index 4c3c770c60..06589d99b0 100644 --- a/graphics/video/avi_decoder.cpp +++ b/graphics/video/avi_decoder.cpp @@ -211,10 +211,10 @@ void AviDecoder::handleStreamHeader() { } } -bool AviDecoder::load(Common::SeekableReadStream &stream) { +bool AviDecoder::load(Common::SeekableReadStream *stream) { close(); - _fileStream = &stream; + _fileStream = stream; _decodedHeader = false; // Read chunks until we have decoded the header diff --git a/graphics/video/avi_decoder.h b/graphics/video/avi_decoder.h index 5f09992647..72cf2d7ef5 100644 --- a/graphics/video/avi_decoder.h +++ b/graphics/video/avi_decoder.h @@ -178,7 +178,7 @@ public: Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType); virtual ~AviDecoder(); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void close(); bool isVideoLoaded() const { return _fileStream != 0; } diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp index 4d93815b44..9ee9fd68d0 100644 --- a/graphics/video/coktelvideo/coktelvideo.cpp +++ b/graphics/video/coktelvideo/coktelvideo.cpp @@ -127,14 +127,14 @@ Common::MemoryReadStream *PreImd::getExtraData(const char *fileName) { return 0; } -bool PreImd::load(Common::SeekableReadStream &stream) { +bool PreImd::load(Common::SeekableReadStream *stream) { // Since PreIMDs don't have any width and height values stored, // we need them to be specified in the constructor assert((_forcedWidth > 0) && (_forcedHeight > 0)); unload(); - _stream = &stream; + _stream = stream; _stream->seek(0); @@ -564,10 +564,10 @@ bool Imd::loadFrameTables(uint32 framesPosPos, uint32 framesCoordsPos) { return true; } -bool Imd::load(Common::SeekableReadStream &stream) { +bool Imd::load(Common::SeekableReadStream *stream) { unload(); - _stream = &stream; + _stream = stream; uint16 handle; @@ -1656,10 +1656,10 @@ void Vmd::readExtraData() { } } -bool Vmd::load(Common::SeekableReadStream &stream) { +bool Vmd::load(Common::SeekableReadStream *stream) { unload(); - _stream = &stream; + _stream = stream; uint16 headerLength; uint16 handle; diff --git a/graphics/video/coktelvideo/coktelvideo.h b/graphics/video/coktelvideo/coktelvideo.h index 8fbd861e82..f8b1965f41 100644 --- a/graphics/video/coktelvideo/coktelvideo.h +++ b/graphics/video/coktelvideo/coktelvideo.h @@ -23,12 +23,8 @@ * */ -// Currently, only GOB and SCI32 games play IMDs and VMDs, so skip compiling if GOB and SCI32 is disabled. -#if !(defined(ENABLE_GOB) || defined(ENABLE_SCI32) || defined(DYNAMIC_MODULES)) - -// Do not compile the CoktelVideo code - -#else +// Currently, only GOB and SCI32 games play IMDs and VMDs +#if defined(ENABLE_GOB) || defined(ENABLE_SCI32) || defined(DYNAMIC_MODULES) #ifndef GRAPHICS_VIDEO_COKTELVIDEO_H #define GRAPHICS_VIDEO_COKTELVIDEO_H @@ -153,7 +149,7 @@ public: virtual Common::MemoryReadStream *getExtraData(const char *fileName) = 0; /** Load a video out of a stream. */ - virtual bool load(Common::SeekableReadStream &stream) = 0; + virtual bool load(Common::SeekableReadStream *stream) = 0; /** Unload the currently loaded video. */ virtual void unload() = 0; @@ -243,7 +239,7 @@ public: bool hasExtraData(const char *fileName) const; Common::MemoryReadStream *getExtraData(const char *fileName); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void unload(); void setXY(int16 x, int16 y); @@ -322,7 +318,7 @@ public: uint32 getSyncLag() const; - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void unload(); void setXY(int16 x, int16 y); @@ -451,7 +447,7 @@ public: bool hasExtraData(const char *fileName) const; Common::MemoryReadStream *getExtraData(const char *fileName); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void unload(); int16 getWidth() const; diff --git a/graphics/video/dxa_decoder.cpp b/graphics/video/dxa_decoder.cpp index 3f26012f5e..5066e8cf37 100644 --- a/graphics/video/dxa_decoder.cpp +++ b/graphics/video/dxa_decoder.cpp @@ -66,10 +66,10 @@ DXADecoder::~DXADecoder() { close(); } -bool DXADecoder::load(Common::SeekableReadStream &stream) { +bool DXADecoder::load(Common::SeekableReadStream *stream) { close(); - _fileStream = &stream; + _fileStream = stream; uint32 tag = _fileStream->readUint32BE(); assert(tag == MKID_BE('DEXA')); diff --git a/graphics/video/dxa_decoder.h b/graphics/video/dxa_decoder.h index d61346324f..eb4426dbbc 100644 --- a/graphics/video/dxa_decoder.h +++ b/graphics/video/dxa_decoder.h @@ -43,7 +43,7 @@ public: DXADecoder(); virtual ~DXADecoder(); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void close(); bool isVideoLoaded() const { return _fileStream != 0; } diff --git a/graphics/video/flic_decoder.cpp b/graphics/video/flic_decoder.cpp index 524e157269..843d3ee093 100644 --- a/graphics/video/flic_decoder.cpp +++ b/graphics/video/flic_decoder.cpp @@ -41,10 +41,10 @@ FlicDecoder::~FlicDecoder() { close(); } -bool FlicDecoder::load(Common::SeekableReadStream &stream) { +bool FlicDecoder::load(Common::SeekableReadStream *stream) { close(); - _fileStream = &stream; + _fileStream = stream; /* uint32 frameSize = */ _fileStream->readUint32LE(); uint16 frameType = _fileStream->readUint16LE(); diff --git a/graphics/video/flic_decoder.h b/graphics/video/flic_decoder.h index 249d3ba4bc..bba1403c22 100644 --- a/graphics/video/flic_decoder.h +++ b/graphics/video/flic_decoder.h @@ -51,7 +51,7 @@ public: * Load a video file * @param stream the stream to load */ - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void close(); /** diff --git a/graphics/video/qt_decoder.cpp b/graphics/video/qt_decoder.cpp index 61b0f5166d..470441dab8 100644 --- a/graphics/video/qt_decoder.cpp +++ b/graphics/video/qt_decoder.cpp @@ -308,8 +308,8 @@ bool QuickTimeDecoder::loadFile(const Common::String &filename) { return true; } -bool QuickTimeDecoder::load(Common::SeekableReadStream &stream) { - _fd = &stream; +bool QuickTimeDecoder::load(Common::SeekableReadStream *stream) { + _fd = stream; _foundMOOV = _foundMDAT = false; _numStreams = 0; _partial = 0; diff --git a/graphics/video/qt_decoder.h b/graphics/video/qt_decoder.h index db4ff8180b..196d4c02cb 100644 --- a/graphics/video/qt_decoder.h +++ b/graphics/video/qt_decoder.h @@ -89,7 +89,7 @@ public: * Load a QuickTime video file from a SeekableReadStream * @param stream the stream to load */ - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); /** * Close a QuickTime encoded video file diff --git a/graphics/video/smk_decoder.cpp b/graphics/video/smk_decoder.cpp index 0b7de774eb..4d03305cce 100644 --- a/graphics/video/smk_decoder.cpp +++ b/graphics/video/smk_decoder.cpp @@ -367,10 +367,10 @@ uint32 SmackerDecoder::getElapsedTime() const { return VideoDecoder::getElapsedTime(); } -bool SmackerDecoder::load(Common::SeekableReadStream &stream) { +bool SmackerDecoder::load(Common::SeekableReadStream *stream) { close(); - _fileStream = &stream; + _fileStream = stream; // Seek to the first frame _header.signature = _fileStream->readUint32BE(); diff --git a/graphics/video/smk_decoder.h b/graphics/video/smk_decoder.h index 6bf671f318..43bb84a4f8 100644 --- a/graphics/video/smk_decoder.h +++ b/graphics/video/smk_decoder.h @@ -57,7 +57,7 @@ public: Audio::Mixer::SoundType soundType = Audio::Mixer::kSFXSoundType); virtual ~SmackerDecoder(); - bool load(Common::SeekableReadStream &stream); + bool load(Common::SeekableReadStream *stream); void close(); bool isVideoLoaded() const { return _fileStream != 0; } diff --git a/graphics/video/video_decoder.cpp b/graphics/video/video_decoder.cpp index 53a5887e4f..081f47bf78 100644 --- a/graphics/video/video_decoder.cpp +++ b/graphics/video/video_decoder.cpp @@ -42,7 +42,7 @@ bool VideoDecoder::loadFile(const Common::String &filename) { return false; } - return load(*file); + return load(file); } uint32 VideoDecoder::getElapsedTime() const { diff --git a/graphics/video/video_decoder.h b/graphics/video/video_decoder.h index d96545d2c1..a398a62009 100644 --- a/graphics/video/video_decoder.h +++ b/graphics/video/video_decoder.h @@ -93,7 +93,7 @@ public: * Load a video file * @param stream the stream to load */ - virtual bool load(Common::SeekableReadStream &stream) = 0; + virtual bool load(Common::SeekableReadStream *stream) = 0; /** * Close a video file |