[Scummvm-cvs-logs] SF.net SVN: scummvm:[43808] scummvm/branches/branch-1-0-0

sev at users.sourceforge.net sev at users.sourceforge.net
Sat Aug 29 22:03:02 CEST 2009


Revision: 43808
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43808&view=rev
Author:   sev
Date:     2009-08-29 20:03:02 +0000 (Sat, 29 Aug 2009)

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

Modified Paths:
--------------
    scummvm/branches/branch-1-0-0/configure
    scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/coktelvideo.cpp
    scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/coktelvideo.h
    scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/indeo3.cpp
    scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/indeo3.h

Modified: scummvm/branches/branch-1-0-0/configure
===================================================================
--- scummvm/branches/branch-1-0-0/configure	2009-08-29 19:48:01 UTC (rev 43807)
+++ scummvm/branches/branch-1-0-0/configure	2009-08-29 20:03:02 UTC (rev 43808)
@@ -116,6 +116,7 @@
 # Default option behaviour yes/no
 _build_hq_scalers=yes
 _build_scalers=yes
+_indeo3=auto
 # Default vkeybd/keymapper options
 _vkeybd=no
 _keymapper=no
@@ -608,6 +609,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]
 
@@ -651,6 +654,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-plugins)         _dynamic_modules=yes ;;
 	--default-dynamic)        _plugins_default=dynamic ;;
@@ -1639,6 +1644,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
@@ -1951,6 +1974,10 @@
 	echo_n ", MT-32 emu"
 fi
 
+if test "$_indeo3" = yes ; then
+	echo_n ", Indeo3 decoder"
+fi
+
 if test "$_vkeybd" = yes ; then
 	echo_n ", virtual keyboard"
 fi
@@ -2173,6 +2200,7 @@
 $_def_mpeg2
 $_def_fluidsynth
 $_def_mt32emu
+$_def_indeo3
 
 /* Plugin settings */
 $_def_plugin

Modified: scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/coktelvideo.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/coktelvideo.cpp	2009-08-29 19:48:01 UTC (rev 43807)
+++ scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/coktelvideo.cpp	2009-08-29 20:03:02 UTC (rev 43808)
@@ -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 {
@@ -912,8 +915,12 @@
 	if ((_width != 0) && (_height != 0)) {
 		_hasVideo = true;
 		_features |= kFeaturesVideo;
+#ifdef USE_INDEO3
 		if (_features & kFeaturesFullColor)
 			_codecIndeo3 = new Indeo3(_width, _height, _palLUT);
+#else
+		warning("Vmd::assessVideoProperties(): Indeo3 decoder not compiled in");
+#endif
 	} else
 		_hasVideo = false;
 
@@ -1009,8 +1016,10 @@
 		}
 	}
 
+#ifdef USE_INDEO3
 	if (_externalCodec && _codecIndeo3)
 		_features |= kFeaturesSupportsDouble;
+#endif
 
 	_soundFreq = _stream->readSint16LE();
 	_soundSliceSize = _stream->readSint16LE();
@@ -1189,12 +1198,14 @@
 
 	}
 
+#ifdef USE_INDEO3
 	if (_codecIndeo3) {
 		delete _codecIndeo3;
 
 		_codecIndeo3 = new Indeo3(_width * (doubleMode ? 2 : 1),
 				_height * (doubleMode ? 2 : 1), _palLUT);
 	}
+#endif
 
 	_doubleMode = doubleMode;
 }
@@ -1240,14 +1251,18 @@
 	Imd::clear(del);
 
 	if (del) {
+#ifdef USE_INDEO3
 		delete _codecIndeo3;
+#endif
 		delete[] _frames;
 		delete[] _vidMemBuffer;
 	}
 
 	_hasVideo = true;
 
+#ifdef USE_INDEO3
 	_codecIndeo3 = 0;
+#endif
 
 	_partsPerFrame = 0;
 	_frames = 0;
@@ -1428,7 +1443,6 @@
 	int16 height = bottom - top + 1;
 	int16 sW = _vidMemWidth;
 	int16 sH = _vidMemHeight;
-	uint32 dataLen = _frameDataLen;
 	byte *dataPtr = _frameData;
 	byte *imdVidMem = _vidMem + sW * top + left;
 	byte *srcPtr;
@@ -1441,6 +1455,9 @@
 
 	byte *dest = imdVidMem;
 
+#ifdef USE_INDEO3
+	uint32 dataLen = _frameDataLen;
+
 	if (Indeo3::isIndeo3(dataPtr, dataLen)) {
 		if (!_codecIndeo3)
 			return 0;
@@ -1462,7 +1479,13 @@
 			warning("Unknown external codec");
 			return 0;
 		}
+#else
+	if (_externalCodec) {
+		return 0;
+	} else {
 
+#endif
+
 		type = *dataPtr++;
 		srcPtr = dataPtr;
 
@@ -1845,3 +1868,5 @@
 }
 
 } // End of namespace Graphics
+
+#endif // GRAPHICS_VIDEO_COKTELVIDEO_H

Modified: scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/coktelvideo.h
===================================================================
--- scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/coktelvideo.h	2009-08-29 19:48:01 UTC (rev 43807)
+++ scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/coktelvideo.h	2009-08-29 20:03:02 UTC (rev 43808)
@@ -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 {
@@ -388,7 +398,10 @@
 	bool _doubleMode;
 
 	Graphics::PaletteLUT *_palLUT;
+
+#ifdef USE_INDEO3
 	Indeo3 *_codecIndeo3;
+#endif
 
 	void clear(bool del = true);
 
@@ -415,3 +428,5 @@
 } // End of namespace Graphics
 
 #endif // GRAPHICS_VIDEO_COKTELVIDEO_H
+
+#endif // Engine and dynamic plugins guard

Modified: scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/indeo3.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/indeo3.cpp	2009-08-29 19:48:01 UTC (rev 43807)
+++ scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/indeo3.cpp	2009-08-29 20:03:02 UTC (rev 43808)
@@ -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/branches/branch-1-0-0/graphics/video/coktelvideo/indeo3.h
===================================================================
--- scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/indeo3.h	2009-08-29 19:48:01 UTC (rev 43807)
+++ scummvm/branches/branch-1-0-0/graphics/video/coktelvideo/indeo3.h	2009-08-29 20:03:02 UTC (rev 43808)
@@ -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