aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2009-08-29 19:48:01 +0000
committerEugene Sandulenko2009-08-29 19:48:01 +0000
commit5f8fafcc1394225bdf0325f0796527a8fa946424 (patch)
treeffa92e08e0c84ba34b7a69aa60a41efb66c985bc
parente8a5cf29d4f6780310332d94dbff4972f12fc14b (diff)
downloadscummvm-rg350-5f8fafcc1394225bdf0325f0796527a8fa946424.tar.gz
scummvm-rg350-5f8fafcc1394225bdf0325f0796527a8fa946424.tar.bz2
scummvm-rg350-5f8fafcc1394225bdf0325f0796527a8fa946424.zip
Patch #2836424: "Optional compilation of CoktelVideo and Indeo3"
svn-id: r43807
-rwxr-xr-xconfigure28
-rw-r--r--graphics/video/coktelvideo/coktelvideo.cpp31
-rw-r--r--graphics/video/coktelvideo/coktelvideo.h15
-rw-r--r--graphics/video/coktelvideo/indeo3.cpp6
-rw-r--r--graphics/video/coktelvideo/indeo3.h6
5 files changed, 84 insertions, 2 deletions
diff --git a/configure b/configure
index 67bb417fbd..e70f602aab 100755
--- a/configure
+++ b/configure
@@ -118,6 +118,7 @@ _text_console=no
_mt32emu=yes
_build_hq_scalers=yes
_build_scalers=yes
+_indeo3=auto
# Default vkeybd/keymapper options
_vkeybd=no
_keymapper=no
@@ -615,6 +616,8 @@ Optional Libraries:
--with-mpeg2-prefix=DIR Prefix where libmpeg2 is installed (optional)
--enable-mpeg2 enable mpeg2 codec for cutscenes [no]
+ --disable-indeo3 disable Indeo3 decoder [autodetect]
+
--with-fluidsynth-prefix=DIR Prefix where libfluidsynth is installed (optional)
--disable-fluidsynth disable fluidsynth MIDI driver [autodetect]
@@ -662,6 +665,8 @@ for ac_option in $@; do
--enable-nasm) _nasm=yes ;;
--disable-nasm) _nasm=no ;;
--enable-mpeg2) _mpeg2=yes ;;
+ --disable-indeo3) _indeo3=no ;;
+ --enable-indeo3) _indeo3=yes ;;
--disable-fluidsynth) _fluidsynth=no ;;
--enable-readline) _readline=yes ;;
--disable-readline) _readline=no ;;
@@ -1719,6 +1724,24 @@ add_to_config_mk_if_no $_build_hq_scalers 'DISABLE_HQ_SCALERS = 1'
add_to_config_mk_if_no $_build_scalers 'DISABLE_SCALERS = 1'
#
+# Check whether to compile the Indeo3 decoder
+#
+if test "$_indeo3" = auto ; then
+ # Autodetect. Build if either the gob engine or plugins are enabled
+ if test `get_engine_build gob` = yes || test "$_dynamic_modules" = yes ; then
+ _indeo3="yes"
+ else
+ _indeo3="no"
+ fi
+fi
+if test "$_indeo3" = no ; then
+ _def_indeo3='#undef USE_INDEO3'
+else
+ _def_indeo3='#define USE_INDEO3'
+fi
+add_to_config_mk_if_yes "$_indeo3" 'USE_INDEO3 = 1'
+
+#
# Check for math lib
#
cat > $TMPC << EOF
@@ -2074,6 +2097,10 @@ if test "$_mt32emu" = yes ; then
echo_n ", MT-32 emu"
fi
+if test "$_indeo3" = yes ; then
+ echo_n ", Indeo3 decoder"
+fi
+
if test "$_text_console" = yes ; then
echo_n ", text console"
fi
@@ -2307,6 +2334,7 @@ $_def_readline
/* Options */
$_def_text_console
$_def_mt32emu
+$_def_indeo3
$_def_16bit
/* Plugin settings */
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