From d8e974ba72a5ed9faf43e1a8fcd5611f4606e9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Mon, 10 Jul 2006 09:29:12 +0000 Subject: [PATCH] Fixed bug #1519817, "ALL: Build failure if libmpeg2 is disabled". svn-id: r23470 --- engines/sword2/animation.cpp | 39 +++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index cd0baaa980d..fd6a2b0b5ed 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -481,6 +481,8 @@ bool MoviePlayerDXA::load(const char *name, MovieTextObject *text[]) { #endif +#ifdef USE_MPEG2 + /////////////////////////////////////////////////////////////////////////////// // Movie player for the old MPEG movies /////////////////////////////////////////////////////////////////////////////// @@ -538,7 +540,23 @@ bool MoviePlayerMPEG::decodeFrame() { return result; } -#ifndef BACKEND_8BIT +AnimationState::AnimationState(Sword2Engine *vm, MoviePlayer *player) + : BaseAnimationState(vm->_mixer, vm->_system, 640, 480) { + _vm = vm; + _player = player; +} + +AnimationState::~AnimationState() { +} + +#ifdef BACKEND_8BIT + +void AnimationState::setPalette(byte *pal) { + _player->updatePalette(pal, false); +} + +#else + void MoviePlayerMPEG::handleScreenChanged() { _anim->handleScreenChanged(); } @@ -559,22 +577,6 @@ void MoviePlayerMPEG::drawTextObject(MovieTextObject *t) { _anim->drawTextObject(t->textSprite, _textSurface); } } -#endif - -AnimationState::AnimationState(Sword2Engine *vm, MoviePlayer *player) - : BaseAnimationState(vm->_mixer, vm->_system, 640, 480) { - _vm = vm; - _player = player; -} - -AnimationState::~AnimationState() { -} - -#ifdef BACKEND_8BIT -void AnimationState::setPalette(byte *pal) { - _player->updatePalette(pal, false); -} -#else void AnimationState::drawTextObject(SpriteInfo *s, byte *src) { int moviePitch = _movieScale * _movieWidth; @@ -625,7 +627,6 @@ void AnimationState::drawTextObject(SpriteInfo *s, byte *src) { src += s->w; } } - #endif void AnimationState::clearScreen() { @@ -670,6 +671,8 @@ void AnimationState::drawYUV(int width, int height, byte *const *dat) { #endif } +#endif + /////////////////////////////////////////////////////////////////////////////// // Dummy player for subtitled speech only ///////////////////////////////////////////////////////////////////////////////