diff options
author | Matthew Hoops | 2011-07-02 16:37:41 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-07-02 16:37:41 -0400 |
commit | 9374215789fcfa3ee34f256d819eaa91aa08b04f (patch) | |
tree | 71e35ec7e807dfb9a08b60b31100d545167ef48c /engines/scumm/he | |
parent | fffe7a9cc06cd03b8a7efbe6e75e3fc1a14c38ba (diff) | |
download | scummvm-rg350-9374215789fcfa3ee34f256d819eaa91aa08b04f.tar.gz scummvm-rg350-9374215789fcfa3ee34f256d819eaa91aa08b04f.tar.bz2 scummvm-rg350-9374215789fcfa3ee34f256d819eaa91aa08b04f.zip |
SCUMM: Add support for Bink video
Diffstat (limited to 'engines/scumm/he')
-rw-r--r-- | engines/scumm/he/animation_he.cpp | 66 |
1 files changed, 48 insertions, 18 deletions
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp index 95a8a701bb..7c1bbfc9a5 100644 --- a/engines/scumm/he/animation_he.cpp +++ b/engines/scumm/he/animation_he.cpp @@ -26,12 +26,17 @@ #include "scumm/he/intern_he.h" #include "audio/audiostream.h" +#include "video/bink_decoder.h" #include "video/smk_decoder.h" namespace Scumm { MoviePlayer::MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer) : _vm(vm) { - _video = new Video::SmackerDecoder(mixer); + if (_vm->_game.heversion >= 100 && (_vm->_game.features & GF_16BIT_COLOR)) + _video = new Video::BinkDecoder(); + else + _video = new Video::SmackerDecoder(mixer); + _flags = 0; _wizResNum = 0; } @@ -71,30 +76,55 @@ void MoviePlayer::copyFrameToBuffer(byte *dst, int dstType, uint x, uint y, uint uint w = _video->getWidth(); const Graphics::Surface *surface = _video->decodeNextFrame(); + + if (!surface) + return; + byte *src = (byte *)surface->pixels; if (_video->hasDirtyPalette()) _vm->setPaletteFromPtr(_video->getPalette(), 256); if (_vm->_game.features & GF_16BIT_COLOR) { - dst += y * pitch + x * 2; - do { - for (uint i = 0; i < w; i++) { - uint16 color = READ_LE_UINT16(_vm->_hePalettes + _vm->_hePaletteSlot + 768 + src[i] * 2); - switch (dstType) { - case kDstScreen: - WRITE_UINT16(dst + i * 2, color); - break; - case kDstResource: - WRITE_LE_UINT16(dst + i * 2, color); - break; - default: - error("copyFrameToBuffer: Unknown dstType %d", dstType); + if (surface->format.bytesPerPixel == 1) { + dst += y * pitch + x * 2; + do { + for (uint i = 0; i < w; i++) { + uint16 color = READ_LE_UINT16(_vm->_hePalettes + _vm->_hePaletteSlot + 768 + src[i] * 2); + switch (dstType) { + case kDstScreen: + WRITE_UINT16(dst + i * 2, color); + break; + case kDstResource: + WRITE_LE_UINT16(dst + i * 2, color); + break; + default: + error("copyFrameToBuffer: Unknown dstType %d", dstType); + } } - } - dst += pitch; - src += w; - } while (--h); + dst += pitch; + src += w; + } while (--h); + } else { + dst += y * pitch + x * 2; + do { + for (uint i = 0; i < w; i++) { + uint16 color = *((uint16 *)src + i); + switch (dstType) { + case kDstScreen: + WRITE_UINT16(dst + i * 2, color); + break; + case kDstResource: + WRITE_LE_UINT16(dst + i * 2, color); + break; + default: + error("copyFrameToBuffer: Unknown dstType %d", dstType); + } + } + dst += pitch; + src += surface->pitch; + } while (--h); + } } else { dst += y * pitch + x; do { |