diff options
author | Torbjörn Andersson | 2006-05-22 07:27:20 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-05-22 07:27:20 +0000 |
commit | c40a8b48a1214363a4313d32c39eb0e02c506221 (patch) | |
tree | 55ecb8d34f5e9033cc4624f79a3433294870e10f /engines/kyra | |
parent | 35d242b74b4f31fd4be8853d2bd945df975d4d7b (diff) | |
download | scummvm-rg350-c40a8b48a1214363a4313d32c39eb0e02c506221.tar.gz scummvm-rg350-c40a8b48a1214363a4313d32c39eb0e02c506221.tar.bz2 scummvm-rg350-c40a8b48a1214363a4313d32c39eb0e02c506221.zip |
Cleanup.
svn-id: r22569
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra3.cpp | 21 | ||||
-rw-r--r-- | engines/kyra/vqa.cpp | 13 | ||||
-rw-r--r-- | engines/kyra/vqa.h | 2 |
3 files changed, 18 insertions, 18 deletions
diff --git a/engines/kyra/kyra3.cpp b/engines/kyra/kyra3.cpp index 805a2395b6..d10da1ec78 100644 --- a/engines/kyra/kyra3.cpp +++ b/engines/kyra/kyra3.cpp @@ -151,28 +151,27 @@ void KyraEngine_v3::playVQA(const char *name) { debugC(9, kDebugLevelMain, "KyraEngine::playVQA('%s')", name); VQAMovie vqa(this, _system); - uint8 pal[768]; - memcpy(pal, _screen->_currentPalette, sizeof(pal)); - if (_screen->_curPage == 0) - _screen->copyCurPageBlock(0, 0, 320, 200, _screen->getPagePtr(3)); - char filename[20]; int size = 0; // TODO: Movie size is 0, 1 or 2. snprintf(filename, sizeof(filename), "%s%d.VQA", name, size); - vqa.open(filename); - if (vqa.opened()) { + if (vqa.open(filename)) { + uint8 pal[768]; + memcpy(pal, _screen->_currentPalette, sizeof(pal)); + if (_screen->_curPage == 0) + _screen->copyCurPageBlock(0, 0, 320, 200, _screen->getPagePtr(3)); + _screen->hideMouse(); vqa.setDrawPage(0); vqa.play(); vqa.close(); _screen->showMouse(); - } - if (_screen->_curPage == 0) - _screen->copyBlockToPage(0, 0, 0, 320, 200, _screen->getPagePtr(3)); - _screen->setScreenPalette(pal); + if (_screen->_curPage == 0) + _screen->copyBlockToPage(0, 0, 0, 320, 200, _screen->getPagePtr(3)); + _screen->setScreenPalette(pal); + } } void KyraEngine_v3::playMenuAudioFile() { diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index e0bc757da9..0918066bc7 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -248,16 +248,16 @@ void VQAMovie::decodeSND1(byte *inbuf, uint32 insize, byte *outbuf, uint32 outsi } } -void VQAMovie::open(const char *filename) { +bool VQAMovie::open(const char *filename) { debugC(9, kDebugLevelMovie, "VQAMovie::open('%s')", filename); close(); if (!_file.open(filename)) - return; + return false; if (_file.readUint32BE() != MKID_BE('FORM')) { warning("VQAMovie::open: Cannot find `FORM' tag"); - return; + return false; } // For now, we ignore the size of the FORM chunk. @@ -265,7 +265,7 @@ void VQAMovie::open(const char *filename) { if (_file.readUint32BE() != MKID_BE('WVQA')) { warning("WQAMovie::open: Cannot find `WVQA' tag"); - return; + return false; } bool foundHeader = false; @@ -351,12 +351,12 @@ void VQAMovie::open(const char *filename) { case MKID_BE('FINF'): // Frame info if (!foundHeader) { warning("VQAMovie::open: Found `FINF' before `VQHD'"); - return; + return false; } if (size != 4 * (uint32)_header.numFrames) { warning("VQAMovie::open: Expected size %d for `FINF' chunk, but got %d", 4 * _header.numFrames, size); - return; + return false; } foundFrameInfo = true; @@ -409,6 +409,7 @@ void VQAMovie::open(const char *filename) { initBuffers(); _opened = true; + return true; } void VQAMovie::close() { diff --git a/engines/kyra/vqa.h b/engines/kyra/vqa.h index 90ad2b12b4..f8a2930d52 100644 --- a/engines/kyra/vqa.h +++ b/engines/kyra/vqa.h @@ -45,7 +45,7 @@ public: void setDrawPage(int page) { _drawPage = page; } - void open(const char *filename); + bool open(const char *filename); void close(); void play(); |