BUILD: Allow for disabling Bink support

This commit is contained in:
Matthew Hoops 2011-07-13 12:08:26 -04:00
parent 7dc7271316
commit a50abde1b1
12 changed files with 104 additions and 10 deletions

View file

@ -22,6 +22,14 @@
// Based on eos' BitStream implementation
#include "common/scummsys.h"
#ifndef USE_BINK
#error "BitStream support disabled because Bink support is disabled"
#else
#ifndef COMMON_BITSTREAM_H
#define COMMON_BITSTREAM_H
@ -100,3 +108,5 @@ private:
} // End of namespace Common
#endif // COMMON_BITSTREAM_H
#endif // USE_BINK

View file

@ -26,6 +26,14 @@
// Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
// Copyright (c) 2010 Vitor Sessak
#include "common/scummsys.h"
#ifndef USE_BINK
#error "DCT support disabled because Bink support is disabled"
#else
#ifndef COMMON_DCT_H
#define COMMON_DCT_H
@ -69,3 +77,5 @@ private:
} // End of namespace Common
#endif // COMMON_DCT_H
#endif // USE_BINK

View file

@ -26,6 +26,14 @@
// Copyright (c) 2002 Fabrice Bellard
// Partly based on libdjbfft by D. J. Bernstein
#include "common/scummsys.h"
#ifndef USE_BINK
#error "FFT support disabled because Bink support is disabled"
#else
#ifndef COMMON_FFT_H
#define COMMON_FFT_H
@ -71,3 +79,5 @@ private:
} // End of namespace Common
#endif // COMMON_FFT_H
#endif // USE_BINK

View file

@ -22,6 +22,14 @@
// Based on eos' Huffman code
#include "common/scummsys.h"
#ifndef USE_BINK
#error "Huffman support disabled because Bink support is disabled"
#else
#ifndef COMMON_HUFFMAN_H
#define COMMON_HUFFMAN_H
@ -75,3 +83,5 @@ private:
} // End of namespace Common
#endif // COMMON_HUFFMAN_H
#endif // USE_BINK

View file

@ -22,6 +22,14 @@
// Based on eos' math code
#include "common/scummsys.h"
#ifndef USE_BINK
#error "Math functions disabled because Bink support is disabled"
#else
#ifndef COMMON_MATH_H
#define COMMON_MATH_H
@ -109,3 +117,5 @@ inline float deg2rad(float deg) {
} // End of namespace Common
#endif // COMMON_MATHS_H
#endif // USE_BINK

View file

@ -2,30 +2,24 @@ MODULE := common
MODULE_OBJS := \
archive.o \
bitstream.o \
config-file.o \
config-manager.o \
dcl.o \
dct.o \
debug.o \
error.o \
EventDispatcher.o \
EventRecorder.o \
fft.o \
file.o \
fs.o \
hashmap.o \
huffman.o \
iff_container.o \
macresman.o \
math.o \
memorypool.o \
md5.o \
mutex.o \
quicktime.o \
random.o \
rational.o \
rdft.o \
str.o \
stream.o \
system.o \
@ -41,5 +35,15 @@ MODULE_OBJS := \
xmlparser.o \
zlib.o
ifdef USE_BINK
MODULE_OBJS += \
bitstream.o \
dct.o \
fft.o \
huffman.o \
math.o \
rdft.o
endif
# Include common rules
include $(srcdir)/rules.mk

View file

@ -24,6 +24,14 @@
// Based upon the (I)RDFT code in FFmpeg
// Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com>
#include "common/scummsys.h"
#ifndef USE_BINK
#error "RDFT support disabled because Bink support is disabled"
#else
#ifndef COMMON_RDFT_H
#define COMMON_RDFT_H
@ -62,3 +70,5 @@ private:
} // End of namespace Common
#endif // COMMON_RDFT_H
#endif // USE_BINK

11
configure vendored
View file

@ -154,6 +154,7 @@ _build_scalers=yes
_build_hq_scalers=yes
_enable_prof=no
_global_constructors=no
_bink=yes
# Default vkeybd/keymapper options
_vkeybd=no
_keymapper=no
@ -775,6 +776,7 @@ Optional Features:
--enable-text-console use text console instead of graphical console
--enable-verbose-build enable regular echoing of commands during build
process
--disable-bink don't build with Bink video support
Optional Libraries:
--with-alsa-prefix=DIR Prefix where alsa is installed (optional)
@ -877,6 +879,8 @@ for ac_option in $@; do
--disable-libunity) _libunity=no ;;
--enable-opengl) _opengl=yes ;;
--disable-opengl) _opengl=no ;;
--enable-bink) _bink=yes ;;
--disable-bink) _bink=no ;;
--enable-verbose-build) _verbose_build=yes ;;
--enable-plugins) _dynamic_modules=yes ;;
--default-dynamic) _plugins_default=dynamic ;;
@ -3264,6 +3268,13 @@ else
echo "$_taskbar"
fi
#
# Check whether to build Bink video support
#
echo_n "Building Bink video support... "
define_in_config_if_yes $_bink 'USE_BINK'
echo "$_bink"
#
# Figure out installation directories
#

View file

@ -26,15 +26,20 @@
#include "scumm/he/intern_he.h"
#include "audio/audiostream.h"
#include "video/bink_decoder.h"
#include "video/smk_decoder.h"
#ifdef USE_BINK
#include "video/bink_decoder.h"
#endif
namespace Scumm {
MoviePlayer::MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer) : _vm(vm) {
#ifdef USE_BINK
if (_vm->_game.heversion >= 100 && (_vm->_game.features & GF_16BIT_COLOR))
_video = new Video::BinkDecoder();
else
#endif
_video = new Video::SmackerDecoder(mixer);
_flags = 0;

View file

@ -704,8 +704,12 @@ void ScummEngine_v99he::resetScummVars() {
VAR(VAR_NUM_UNK) = _numUnk;
if (_game.heversion >= 100 && (_game.features & GF_16BIT_COLOR)) {
// Enable Bink and Smacker video in 16bit color games
// Enable Bink video in 16bit color games
#ifdef USE_BINK
VAR(140) = 1;
#else
VAR(140) = 0;
#endif
}
}
#endif

View file

@ -24,6 +24,10 @@
// based quite heavily on the Bink decoder found in FFmpeg.
// Many thanks to Kostya Shishkov for doing the hard work.
#include "common/scummsys.h"
#ifdef USE_BINK
#ifndef VIDEO_BINK_DECODER_H
#define VIDEO_BINK_DECODER_H
@ -325,4 +329,6 @@ private:
} // End of namespace Video
#endif
#endif // VIDEO_BINK_DECODER_H
#endif // USE_BINK

View file

@ -2,7 +2,6 @@ MODULE := video
MODULE_OBJS := \
avi_decoder.o \
bink_decoder.o \
coktel_decoder.o \
dxa_decoder.o \
flic_decoder.o \
@ -20,5 +19,10 @@ MODULE_OBJS := \
codecs/smc.o \
codecs/truemotion1.o
ifdef USE_BINK
MODULE_OBJS += \
bink_decoder.o
endif
# Include common rules
include $(srcdir)/rules.mk