diff options
Diffstat (limited to 'engines/kyra/vqa.cpp')
-rw-r--r-- | engines/kyra/vqa.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 0b8f9c99a2..1225bc9976 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -32,12 +32,14 @@ // The jung2.vqa movie does work, but only thanks to a grotesque hack. +#include "kyra/vqa.h" + #include "common/system.h" #include "sound/audiostream.h" #include "sound/mixer.h" + #include "kyra/sound.h" #include "kyra/screen.h" -#include "kyra/vqa.h" #include "kyra/resource.h" namespace Kyra { @@ -45,6 +47,7 @@ namespace Kyra { VQAMovie::VQAMovie(KyraEngine_v1 *vm, OSystem *system) { _system = system; _vm = vm; + _screen = _vm->screen(); _opened = false; _x = _y = _drawPage = -1; } @@ -474,13 +477,13 @@ void VQAMovie::displayFrame(uint frameNum) { case MKID_BE('CPL0'): // Palette assert(size <= 3 * 256); - _file->read(_vm->screen()->_currentPalette, size); + _file->read(_screen->getPalette(0).getData(), size); break; case MKID_BE('CPLZ'): // Palette inbuf = (byte *)allocBuffer(0, size); _file->read(inbuf, size); - Screen::decodeFrame4(inbuf, _vm->screen()->_currentPalette, 768); + Screen::decodeFrame4(inbuf, _screen->getPalette(0).getData(), 768); break; case MKID_BE('VPT0'): // Frame data @@ -520,9 +523,8 @@ void VQAMovie::displayFrame(uint frameNum) { // The frame has been decoded - if (_frameInfo[frameNum] & 0x80000000) { - _vm->screen()->setScreenPalette(_vm->screen()->_currentPalette); - } + if (_frameInfo[frameNum] & 0x80000000) + _screen->setScreenPalette(_screen->getPalette(0)); int blockPitch = _header.width / _header.blockW; @@ -562,7 +564,7 @@ void VQAMovie::displayFrame(uint frameNum) { _partialCodeBookSize = 0; } - _vm->screen()->copyBlockToPage(_drawPage, _x, _y, _header.width, _header.height, _frame); + _screen->copyBlockToPage(_drawPage, _x, _y, _header.width, _header.height, _frame); } void VQAMovie::play() { @@ -638,6 +640,7 @@ void VQAMovie::play() { } _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sound, _stream); + Common::EventManager *eventMan = _vm->getEventManager(); for (uint i = 0; i < _header.numFrames; i++) { displayFrame(i); @@ -656,17 +659,17 @@ void VQAMovie::play() { break; Common::Event event; - - Common::EventManager *eventMan = _system->getEventManager(); while (eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_KEYDOWN: - if (event.kbd.ascii == 27) + if (event.kbd.keycode == Common::KEYCODE_ESCAPE) return; break; + case Common::EVENT_RTL: case Common::EVENT_QUIT: return; + default: break; } @@ -675,7 +678,7 @@ void VQAMovie::play() { _system->delayMillis(10); } - _vm->screen()->updateScreen(); + _screen->updateScreen(); } // TODO: Wait for the sound to finish? |