diff options
author | Matthew Hoops | 2013-06-23 19:36:27 -0400 |
---|---|---|
committer | Matthew Hoops | 2015-04-11 14:36:26 -0400 |
commit | cfc64157a093bd369432169d069effc9e622ba21 (patch) | |
tree | e4e9143d2a753300ac8ff49c2cc2d41526e8df25 /video | |
parent | f6d7c5e176a08c32702cdfb80ec8a626c25ead67 (diff) | |
download | scummvm-rg350-cfc64157a093bd369432169d069effc9e622ba21.tar.gz scummvm-rg350-cfc64157a093bd369432169d069effc9e622ba21.tar.bz2 scummvm-rg350-cfc64157a093bd369432169d069effc9e622ba21.zip |
VIDEO: Allow AVI tracks to be dithered via the Codec
Video for Windows made the Codec do the dithering work
Diffstat (limited to 'video')
-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); |