diff options
author | Torbjörn Andersson | 2007-02-28 18:25:42 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2007-02-28 18:25:42 +0000 |
commit | 61e2a9eb78ebf681a6472e81efaac65d5a373445 (patch) | |
tree | 2bfd651ef216b4ec5ab7c72eba9ddaa4430c98db /engines/kyra | |
parent | 5e2fe7dc7fb294373e1d2907dfd48598da495777 (diff) | |
download | scummvm-rg350-61e2a9eb78ebf681a6472e81efaac65d5a373445.tar.gz scummvm-rg350-61e2a9eb78ebf681a6472e81efaac65d5a373445.tar.bz2 scummvm-rg350-61e2a9eb78ebf681a6472e81efaac65d5a373445.zip |
Clarified some comments and moved some asserts to hopefully answer Fingolfin's
question why we always created a mono audio stream. There are other games that
use more advanced versions of the VQA format, but it seems unlikely that
ScummVM will ever support any of them.
svn-id: r25911
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/vqa.cpp | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 603b67221b..10f85fcfc1 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -230,27 +230,22 @@ bool VQAMovie::open(const char *filename) { _header.maxCBFZSize = _file.readUint32LE(); _header.unk5 = _file.readUint32LE(); - // Version 1 VQA files have some implicit defaults + // Kyrandia 3 uses version 1 VQA files, and is the only + // known game to do so. This version of the format has + // some implicit default values. if (_header.version == 1) { - if (_header.flags & 1) { - if (_header.freq == 0) - _header.freq = 22050; - if (_header.channels == 0) - _header.channels = 1; - if (_header.bits == 0) - _header.bits = 8; - } + if (_header.freq == 0) + _header.freq = 22050; + if (_header.channels == 0) + _header.channels = 1; + if (_header.bits == 0) + _header.bits = 8; } setX((Screen::SCREEN_W - _header.width) / 2); setY((Screen::SCREEN_H - _header.height) / 2); - // HACK: I've only seen 8-bit mono audio in Kyra 3 - - assert(_header.bits == 8); - assert(_header.channels == 1); - _frameInfo = new uint32[_header.numFrames]; _frame = new byte[_header.width * _header.height]; @@ -268,7 +263,19 @@ bool VQAMovie::open(const char *filename) { _numPartialCodeBooks = 0; if (_header.flags & 1) { - // TODO/FIXME: Shouldn't we set FLAG_STEREO if _header.channels == 2 (wonders Fingolfin) + // This VQA movie has sound. Kyrandia 3 uses + // 8-bit sound, and so far testing indicates + // that it's all mono. + // + // This is good, because it means we won't have + // to worry about the confusing parts of the + // VQA spec, where 8- and 16-bit data have + // different signedness and stereo sample + // layout varies between different games. + + assert(_header.bits == 8); + assert(_header.channels == 1); + _stream = Audio::makeAppendableAudioStream(_header.freq, Audio::Mixer::FLAG_UNSIGNED); } else { _stream = NULL; @@ -297,7 +304,8 @@ bool VQAMovie::open(const char *filename) { // HACK: This flag is set in jung2.vqa, and its // purpose, if it has one, is unknown. It can't be a // general purpose flag, because in large movies the - // frame offsets can be large enough to set this flag. + // frame offsets can be large enough to set this flag, + // though of course never for the first frame. // // At least in my copy of Kyrandia 3, _frameInfo[0] is // 0x81000098, and the desired index is 0x4716. So the |