diff options
Diffstat (limited to 'engines/sword1/animation.cpp')
-rw-r--r-- | engines/sword1/animation.cpp | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index 441e622184..c0e7be7758 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -23,6 +23,7 @@ * */ + #include "common/file.h" #include "sword1/sword1.h" #include "sword1/animation.h" @@ -71,9 +72,6 @@ MoviePlayer::MoviePlayer(SwordEngine *vm, Text *textMan, Audio::Mixer *snd, OSys _bgSoundStream = NULL; _decoderType = decoderType; _decoder = decoder; - - _white = 255; - _black = 0; } MoviePlayer::~MoviePlayer() { @@ -256,35 +254,9 @@ bool MoviePlayer::playVideo() { if (frame) _vm->_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, x, y, frame->w, frame->h); - if (_decoder->hasDirtyPalette()) { + if (_decoder->hasDirtyPalette()) _decoder->setSystemPalette(); - uint32 maxWeight = 0; - uint32 minWeight = 0xFFFFFFFF; - uint32 weight; - byte r, g, b; - - byte *palette = _decoder->getPalette(); - - for (int i = 0; i < 256; i++) { - r = *palette++; - g = *palette++; - b = *palette++; - - weight = 3 * r * r + 6 * g * g + 2 * b * b; - - if (weight >= maxWeight) { - maxWeight = weight; - _white = i; - } - - if (weight <= minWeight) { - minWeight = weight; - _black = i; - } - } - } - Graphics::Surface *screen = _vm->_system->lockScreen(); performPostProcessing((byte *)screen->pixels); _vm->_system->unlockScreen(); @@ -295,19 +267,17 @@ bool MoviePlayer::playVideo() { while (_vm->_system->getEventManager()->pollEvent(event)) if ((event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) || event.type == Common::EVENT_LBUTTONUP) return false; - - _vm->_system->delayMillis(10); } return !_vm->shouldQuit(); } byte MoviePlayer::findBlackPalIndex() { - return _black; + return 0; } byte MoviePlayer::findWhitePalIndex() { - return _white; + return 0xff; } DXADecoderWithSound::DXADecoderWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle) |