diff options
author | Eugene Sandulenko | 2009-08-29 19:48:01 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-08-29 19:48:01 +0000 |
commit | 5f8fafcc1394225bdf0325f0796527a8fa946424 (patch) | |
tree | ffa92e08e0c84ba34b7a69aa60a41efb66c985bc /graphics/video | |
parent | e8a5cf29d4f6780310332d94dbff4972f12fc14b (diff) | |
download | scummvm-rg350-5f8fafcc1394225bdf0325f0796527a8fa946424.tar.gz scummvm-rg350-5f8fafcc1394225bdf0325f0796527a8fa946424.tar.bz2 scummvm-rg350-5f8fafcc1394225bdf0325f0796527a8fa946424.zip |
Patch #2836424: "Optional compilation of CoktelVideo and Indeo3"
svn-id: r43807
Diffstat (limited to 'graphics/video')
-rw-r--r-- | graphics/video/coktelvideo/coktelvideo.cpp | 31 | ||||
-rw-r--r-- | graphics/video/coktelvideo/coktelvideo.h | 15 | ||||
-rw-r--r-- | graphics/video/coktelvideo/indeo3.cpp | 6 | ||||
-rw-r--r-- | graphics/video/coktelvideo/indeo3.h | 6 |
4 files changed, 56 insertions, 2 deletions
diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp index b69315cbae..78404eb89a 100644 --- a/graphics/video/coktelvideo/coktelvideo.cpp +++ b/graphics/video/coktelvideo/coktelvideo.cpp @@ -23,11 +23,14 @@ * */ +#include "graphics/video/coktelvideo/coktelvideo.h" + +#ifdef GRAPHICS_VIDEO_COKTELVIDEO_H + #include "common/endian.h" #include "common/system.h" #include "graphics/dither.h" -#include "graphics/video/coktelvideo/coktelvideo.h" #include "graphics/video/coktelvideo/indeo3.h" namespace Graphics { @@ -1131,9 +1134,13 @@ bool Vmd::assessVideoProperties() { if (_externalCodec) { if (_videoCodec == MKID_BE('iv32')) { +#ifdef USE_INDEO3 _features &= ~kFeaturesPalette; _features |= kFeaturesFullColor; _codecIndeo3 = new Indeo3(_width, _height, _palLUT); +#else + warning("Vmd::assessVideoProperties(): Indeo3 decoder not compiled in"); +#endif } else { char *fourcc = (char *) &_videoCodec; @@ -1190,8 +1197,10 @@ bool Vmd::assessVideoProperties() { } } +#ifdef USE_INDEO3 if (_externalCodec && _codecIndeo3) _features |= kFeaturesSupportsDouble; +#endif return true; } @@ -1506,12 +1515,14 @@ void Vmd::setDoubleMode(bool doubleMode) { } +#ifdef USE_INDEO3 if (_codecIndeo3) { delete _codecIndeo3; _codecIndeo3 = new Indeo3(_width * (doubleMode ? 2 : 1), _height * (doubleMode ? 2 : 1), _palLUT); } +#endif _doubleMode = doubleMode; } @@ -1557,7 +1568,9 @@ void Vmd::clear(bool del) { Imd::clear(del); if (del) { +#ifdef USE_INDEO3 delete _codecIndeo3; +#endif delete[] _frames; delete[] _vidMemBuffer; } @@ -1565,7 +1578,9 @@ void Vmd::clear(bool del) { _hasVideo = true; _videoCodec = 0; +#ifdef USE_INDEO3 _codecIndeo3 = 0; +#endif _partsPerFrame = 0; _frames = 0; @@ -1802,7 +1817,6 @@ uint32 Vmd::renderFrame(int16 &left, int16 &top, int16 &right, int16 &bottom) { int16 height = bottom - top + 1; int16 sW = _vidMemWidth; int16 sH = _vidMemHeight; - uint32 dataLen = _frameDataLen; byte *dataPtr = _frameData; byte *imdVidMem = _vidMem + sW * top + left; @@ -1816,6 +1830,9 @@ uint32 Vmd::renderFrame(int16 &left, int16 &top, int16 &right, int16 &bottom) { uint8 type; byte *dest = imdVidMem; +#ifdef USE_INDEO3 + uint32 dataLen = _frameDataLen; + if (Indeo3::isIndeo3(dataPtr, dataLen)) { if (!_codecIndeo3) return 0; @@ -1838,6 +1855,14 @@ uint32 Vmd::renderFrame(int16 &left, int16 &top, int16 &right, int16 &bottom) { return 0; } +#else + + if (_externalCodec) { + return 0; + } else { + +#endif + type = *dataPtr++; srcPtr = dataPtr; @@ -2284,3 +2309,5 @@ Common::MemoryReadStream *Vmd::getExtraData(const char *fileName) { } } // End of namespace Graphics + +#endif // GRAPHICS_VIDEO_COKTELVIDEO_H diff --git a/graphics/video/coktelvideo/coktelvideo.h b/graphics/video/coktelvideo/coktelvideo.h index db80b4c43d..b24195d110 100644 --- a/graphics/video/coktelvideo/coktelvideo.h +++ b/graphics/video/coktelvideo/coktelvideo.h @@ -23,9 +23,17 @@ * */ +// Currently, only GOB plays IMDs and VMDs, so skip compiling if GOB is disabled. +#if !(defined(ENABLE_GOB) || defined(DYNAMIC_MODULES)) + +// Do not compile the CoktelVideo code + +#else + #ifndef GRAPHICS_VIDEO_COKTELVIDEO_H #define GRAPHICS_VIDEO_COKTELVIDEO_H +#include "common/scummsys.h" #include "common/stream.h" #include "common/array.h" #include "graphics/dither.h" @@ -34,7 +42,9 @@ namespace Graphics { +#ifdef USE_INDEO3 class Indeo3; +#endif /** Common interface for handling Coktel Vision videos and derivated formats. */ class CoktelVideo { @@ -475,7 +485,10 @@ protected: bool _doubleMode; Graphics::PaletteLUT *_palLUT; + +#ifdef USE_INDEO3 Indeo3 *_codecIndeo3; +#endif void clear(bool del = true); @@ -519,3 +532,5 @@ protected: } // End of namespace Graphics #endif // GRAPHICS_VIDEO_COKTELVIDEO_H + +#endif // Engine and dynamic plugins guard diff --git a/graphics/video/coktelvideo/indeo3.cpp b/graphics/video/coktelvideo/indeo3.cpp index 26d1e4c21a..581f59b1b1 100644 --- a/graphics/video/coktelvideo/indeo3.cpp +++ b/graphics/video/coktelvideo/indeo3.cpp @@ -23,6 +23,10 @@ * */ +#include "common/scummsys.h" + +#ifdef USE_INDEO3 + /* Intel Indeo 3 decompressor, derived from ffmpeg. * * Original copyright note: * Intel Indeo 3 (IV31, IV32, etc.) video decoder for ffmpeg @@ -3477,3 +3481,5 @@ const uint32 Indeo3::correctionhighorder[] = { }; } // End of namespace Graphics + +#endif // USE_INDEO3 diff --git a/graphics/video/coktelvideo/indeo3.h b/graphics/video/coktelvideo/indeo3.h index c417a543ec..af6ef26449 100644 --- a/graphics/video/coktelvideo/indeo3.h +++ b/graphics/video/coktelvideo/indeo3.h @@ -23,6 +23,10 @@ * */ +#include "common/scummsys.h" + +#ifdef USE_INDEO3 + /* Intel Indeo 3 decompressor, derived from ffmpeg. * * Original copyright note: @@ -118,3 +122,5 @@ private: } // End of namespace Graphics #endif // GRAPHICS_VIDEO_INDEO3_H + +#endif // USE_INDEO3 |