diff options
-rw-r--r-- | video/avi_decoder.cpp | 24 | ||||
-rw-r--r-- | video/avi_decoder.h | 7 |
2 files changed, 29 insertions, 2 deletions
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp index 7119c72f07..72892534fb 100644 --- a/video/avi_decoder.cpp +++ b/video/avi_decoder.cpp @@ -815,6 +815,30 @@ void AVIDecoder::AVIVideoTrack::forceTrackEnd() { _curFrame = _frameCount - 1; } +const byte *AVIDecoder::AVIVideoTrack::getPalette() const { + if (_videoCodec && _videoCodec->containsPalette()) + return _videoCodec->getPalette(); + + _dirtyPalette = false; + return _palette; +} + +bool AVIDecoder::AVIVideoTrack::hasDirtyPalette() const { + if (_videoCodec && _videoCodec->containsPalette()) + return _videoCodec->hasDirtyPalette(); + + return _dirtyPalette; +} + +bool AVIDecoder::AVIVideoTrack::canDither() const { + return _videoCodec && _videoCodec->canDither(); +} + +void AVIDecoder::AVIVideoTrack::setDither(const byte *palette) { + assert(_videoCodec); + _videoCodec->setDither(palette); +} + AVIDecoder::AVIAudioTrack::AVIAudioTrack(const AVIStreamHeader &streamHeader, const PCMWaveFormat &waveFormat, Audio::Mixer::SoundType soundType) : _audsHeader(streamHeader), _wvInfo(waveFormat), _soundType(soundType), _curChunk(0) { _audStream = createAudioStream(); diff --git a/video/avi_decoder.h b/video/avi_decoder.h index 8941ff4e75..6c1ce1a4b9 100644 --- a/video/avi_decoder.h +++ b/video/avi_decoder.h @@ -179,11 +179,14 @@ protected: int getCurFrame() const { return _curFrame; } int getFrameCount() const { return _frameCount; } const Graphics::Surface *decodeNextFrame() { return _lastFrame; } - const byte *getPalette() const { _dirtyPalette = false; return _palette; } - bool hasDirtyPalette() const { return _dirtyPalette; } + + const byte *getPalette() const; + bool hasDirtyPalette() const; void setCurFrame(int frame) { _curFrame = frame; } void loadPaletteFromChunk(Common::SeekableReadStream *chunk); void useInitialPalette(); + bool canDither() const; + void setDither(const byte *palette); bool isTruemotion1() const; void forceDimensions(uint16 width, uint16 height); |