SCUMM: Add support for Bink video
This commit is contained in:
parent
fffe7a9cc0
commit
9374215789
2 changed files with 50 additions and 20 deletions
|
@ -26,12 +26,17 @@
|
||||||
#include "scumm/he/intern_he.h"
|
#include "scumm/he/intern_he.h"
|
||||||
|
|
||||||
#include "audio/audiostream.h"
|
#include "audio/audiostream.h"
|
||||||
|
#include "video/bink_decoder.h"
|
||||||
#include "video/smk_decoder.h"
|
#include "video/smk_decoder.h"
|
||||||
|
|
||||||
namespace Scumm {
|
namespace Scumm {
|
||||||
|
|
||||||
MoviePlayer::MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer) : _vm(vm) {
|
MoviePlayer::MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer) : _vm(vm) {
|
||||||
|
if (_vm->_game.heversion >= 100 && (_vm->_game.features & GF_16BIT_COLOR))
|
||||||
|
_video = new Video::BinkDecoder();
|
||||||
|
else
|
||||||
_video = new Video::SmackerDecoder(mixer);
|
_video = new Video::SmackerDecoder(mixer);
|
||||||
|
|
||||||
_flags = 0;
|
_flags = 0;
|
||||||
_wizResNum = 0;
|
_wizResNum = 0;
|
||||||
}
|
}
|
||||||
|
@ -71,12 +76,17 @@ void MoviePlayer::copyFrameToBuffer(byte *dst, int dstType, uint x, uint y, uint
|
||||||
uint w = _video->getWidth();
|
uint w = _video->getWidth();
|
||||||
|
|
||||||
const Graphics::Surface *surface = _video->decodeNextFrame();
|
const Graphics::Surface *surface = _video->decodeNextFrame();
|
||||||
|
|
||||||
|
if (!surface)
|
||||||
|
return;
|
||||||
|
|
||||||
byte *src = (byte *)surface->pixels;
|
byte *src = (byte *)surface->pixels;
|
||||||
|
|
||||||
if (_video->hasDirtyPalette())
|
if (_video->hasDirtyPalette())
|
||||||
_vm->setPaletteFromPtr(_video->getPalette(), 256);
|
_vm->setPaletteFromPtr(_video->getPalette(), 256);
|
||||||
|
|
||||||
if (_vm->_game.features & GF_16BIT_COLOR) {
|
if (_vm->_game.features & GF_16BIT_COLOR) {
|
||||||
|
if (surface->format.bytesPerPixel == 1) {
|
||||||
dst += y * pitch + x * 2;
|
dst += y * pitch + x * 2;
|
||||||
do {
|
do {
|
||||||
for (uint i = 0; i < w; i++) {
|
for (uint i = 0; i < w; i++) {
|
||||||
|
@ -95,6 +105,26 @@ void MoviePlayer::copyFrameToBuffer(byte *dst, int dstType, uint x, uint y, uint
|
||||||
dst += pitch;
|
dst += pitch;
|
||||||
src += w;
|
src += w;
|
||||||
} while (--h);
|
} 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 {
|
} else {
|
||||||
dst += y * pitch + x;
|
dst += y * pitch + x;
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -704,8 +704,8 @@ void ScummEngine_v99he::resetScummVars() {
|
||||||
VAR(VAR_NUM_UNK) = _numUnk;
|
VAR(VAR_NUM_UNK) = _numUnk;
|
||||||
|
|
||||||
if (_game.heversion >= 100 && (_game.features & GF_16BIT_COLOR)) {
|
if (_game.heversion >= 100 && (_game.features & GF_16BIT_COLOR)) {
|
||||||
// Disable Bink and Smacker video in 16bit color games
|
// Enable Bink and Smacker video in 16bit color games
|
||||||
VAR(140) = 0;
|
VAR(140) = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue