[Scummvm-cvs-logs] SF.net SVN: scummvm:[43807] scummvm/trunk

sev at users.sourceforge.net sev at users.sourceforge.net
Sat Aug 29 21:48:01 CEST 2009


Revision: 43807
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43807&view=rev
Author:   sev
Date:     2009-08-29 19:48:01 +0000 (Sat, 29 Aug 2009)

Log Message:
-----------
Patch #2836424: "Optional compilation of CoktelVideo and Indeo3"

Modified Paths:
--------------
    scummvm/trunk/configure
    scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp
    scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h
    scummvm/trunk/graphics/video/coktelvideo/indeo3.cpp
    scummvm/trunk/graphics/video/coktelvideo/indeo3.h

Modified: scummvm/trunk/configure
===================================================================
--- scummvm/trunk/configure	2009-08-29 19:38:37 UTC (rev 43806)
+++ scummvm/trunk/configure	2009-08-29 19:48:01 UTC (rev 43807)
@@ -118,6 +118,7 @@
 _mt32emu=yes
 _build_hq_scalers=yes
 _build_scalers=yes
+_indeo3=auto
 # Default vkeybd/keymapper options
 _vkeybd=no
 _keymapper=no
@@ -615,6 +616,8 @@
   --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 @@
 	--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_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 @@
 	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 @@
 /* Options */
 $_def_text_console
 $_def_mt32emu
+$_def_indeo3
 $_def_16bit
 
 /* Plugin settings */

Modified: scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp	2009-08-29 19:38:37 UTC (rev 43806)
+++ scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp	2009-08-29 19:48:01 UTC (rev 43807)
@@ -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 @@
 
 	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 @@
 		}
 	}
 
+#ifdef USE_INDEO3
 	if (_externalCodec && _codecIndeo3)
 		_features |= kFeaturesSupportsDouble;
+#endif
 
 	return true;
 }
@@ -1506,12 +1515,14 @@
 
 	}
 
+#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 @@
 	Imd::clear(del);
 
 	if (del) {
+#ifdef USE_INDEO3
 		delete _codecIndeo3;
+#endif
 		delete[] _frames;
 		delete[] _vidMemBuffer;
 	}
@@ -1565,7 +1578,9 @@
 	_hasVideo   = true;
 	_videoCodec = 0;
 
+#ifdef USE_INDEO3
 	_codecIndeo3 = 0;
+#endif
 
 	_partsPerFrame = 0;
 	_frames = 0;
@@ -1802,7 +1817,6 @@
 	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 @@
 	uint8 type;
 	byte *dest = imdVidMem;
 
+#ifdef USE_INDEO3
+	uint32 dataLen = _frameDataLen;
+
 	if (Indeo3::isIndeo3(dataPtr, dataLen)) {
 		if (!_codecIndeo3)
 			return 0;
@@ -1838,6 +1855,14 @@
 			return 0;
 		}
 
+#else
+
+	if (_externalCodec) {
+		return 0;
+	} else {
+
+#endif
+
 		type   = *dataPtr++;
 		srcPtr =  dataPtr;
 
@@ -2284,3 +2309,5 @@
 }
 
 } // End of namespace Graphics
+
+#endif // GRAPHICS_VIDEO_COKTELVIDEO_H

Modified: scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h	2009-08-29 19:38:37 UTC (rev 43806)
+++ scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h	2009-08-29 19:48:01 UTC (rev 43807)
@@ -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 @@
 	bool _doubleMode;
 
 	Graphics::PaletteLUT *_palLUT;
+
+#ifdef USE_INDEO3
 	Indeo3 *_codecIndeo3;
+#endif
 
 	void clear(bool del = true);
 
@@ -519,3 +532,5 @@
 } // End of namespace Graphics
 
 #endif // GRAPHICS_VIDEO_COKTELVIDEO_H
+
+#endif // Engine and dynamic plugins guard

Modified: scummvm/trunk/graphics/video/coktelvideo/indeo3.cpp
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/indeo3.cpp	2009-08-29 19:38:37 UTC (rev 43806)
+++ scummvm/trunk/graphics/video/coktelvideo/indeo3.cpp	2009-08-29 19:48:01 UTC (rev 43807)
@@ -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 @@
 };
 
 } // End of namespace Graphics
+
+#endif // USE_INDEO3

Modified: scummvm/trunk/graphics/video/coktelvideo/indeo3.h
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/indeo3.h	2009-08-29 19:38:37 UTC (rev 43806)
+++ scummvm/trunk/graphics/video/coktelvideo/indeo3.h	2009-08-29 19:48:01 UTC (rev 43807)
@@ -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 @@
 } // End of namespace Graphics
 
 #endif // GRAPHICS_VIDEO_INDEO3_H
+
+#endif // USE_INDEO3


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list