diff options
author | Paul Gilbert | 2017-06-30 21:33:09 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-06-30 21:33:09 -0400 |
commit | e4ba3fccc3b3c231849e1304dd8ab2c9a37d8ee6 (patch) | |
tree | 9ca824272bd77c276c5bbeaf51746a8cad036265 /engines/titanic/support | |
parent | 2838776c4bf60556b73e74c7d481d9e4af718fbb (diff) | |
download | scummvm-rg350-e4ba3fccc3b3c231849e1304dd8ab2c9a37d8ee6.tar.gz scummvm-rg350-e4ba3fccc3b3c231849e1304dd8ab2c9a37d8ee6.tar.bz2 scummvm-rg350-e4ba3fccc3b3c231849e1304dd8ab2c9a37d8ee6.zip |
TITANIC: Update AVISurface to use refactored AVIDecoder
Diffstat (limited to 'engines/titanic/support')
-rw-r--r-- | engines/titanic/support/avi_surface.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/support/avi_surface.h | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp index 85b98e9e22..0308465bc6 100644 --- a/engines/titanic/support/avi_surface.cpp +++ b/engines/titanic/support/avi_surface.cpp @@ -55,7 +55,7 @@ AVISurface::AVISurface(const CResourceKey &key) : _movieName(key.getString()) { if (!_decoder->loadFile(_movieName)) error("Could not open video - %s", key.getString().c_str()); - _streamCount = _decoder->videoTrackCount(); + _streamCount = _decoder->getTransparencyTrack() ? 2 : 1; _soundManager = nullptr; _hasAudio = false; @@ -222,7 +222,7 @@ void AVISurface::setVideoSurface(CVideoSurface *surface) { // Handling for secondary video stream if (_streamCount == 2) { - const Common::String &streamName = _decoder->getVideoTrack(1).getName(); + const Common::String &streamName = _decoder->getTransparencyTrack()->getName(); if (streamName == "mask0") { _videoSurface->_transparencyMode = TRANS_MASK0; @@ -243,7 +243,9 @@ void AVISurface::setupDecompressor() { return; for (int idx = 0; idx < _streamCount; ++idx) { - Graphics::PixelFormat format = _decoder->getVideoTrack(idx).getPixelFormat(); + Graphics::PixelFormat format = (idx == 0) ? + _decoder->getVideoTrack(0).getPixelFormat() : + _decoder->getTransparencyTrack()->getPixelFormat(); int decoderPitch = _decoder->getWidth() * format.bytesPerPixel; bool flag = false; diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h index d3442a12f7..5e7e5d4bc1 100644 --- a/engines/titanic/support/avi_surface.h +++ b/engines/titanic/support/avi_surface.h @@ -57,6 +57,13 @@ public: * Returns the specified video track */ Video::AVIDecoder::AVIVideoTrack &getVideoTrack(uint idx); + + /** + * Returns the transparency video track, if present + */ + AVIVideoTrack *getTransparencyTrack() { + return static_cast<AVIVideoTrack *>(_transparencyTrack.track); + } }; class AVISurface { |