diff options
author | Paul Gilbert | 2017-02-09 21:43:03 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-09 21:43:03 -0500 |
commit | abe4f20fc1649bf2f6b111034a4044b4b6b2846f (patch) | |
tree | e5fe2c61a91e578d162195a19a7fd20781505229 /engines/titanic/sound | |
parent | 2fd2eeed1c21047744c9d79b1283c52c009b5406 (diff) | |
download | scummvm-rg350-abe4f20fc1649bf2f6b111034a4044b4b6b2846f.tar.gz scummvm-rg350-abe4f20fc1649bf2f6b111034a4044b4b6b2846f.tar.bz2 scummvm-rg350-abe4f20fc1649bf2f6b111034a4044b4b6b2846f.zip |
TITANIC: CWaveFile::lock now returns pointer to data, not WAV header
Diffstat (limited to 'engines/titanic/sound')
-rw-r--r-- | engines/titanic/sound/wave_file.cpp | 7 | ||||
-rw-r--r-- | engines/titanic/sound/wave_file.h | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp index bc29ed037c..a328fe1543 100644 --- a/engines/titanic/sound/wave_file.cpp +++ b/engines/titanic/sound/wave_file.cpp @@ -29,13 +29,13 @@ namespace Titanic { CWaveFile::CWaveFile() : _soundManager(nullptr), _audioStream(nullptr), - _waveData(nullptr), _waveSize(0), _dataSize(0), + _waveData(nullptr), _waveSize(0), _dataSize(0), _headerSize(0), _soundType(Audio::Mixer::kPlainSoundType) { setup(); } CWaveFile::CWaveFile(QSoundManager *owner) : _soundManager(owner), _audioStream(nullptr), - _waveData(nullptr), _waveSize(0), _dataSize(0), + _waveData(nullptr), _waveSize(0), _dataSize(0), _headerSize(0), _soundType(Audio::Mixer::kPlainSoundType) { setup(); } @@ -140,6 +140,7 @@ void CWaveFile::load(byte *data, uint size) { int rate; byte flags; Audio::loadWAVFromStream(wavStream, _dataSize, rate, flags); + _headerSize = wavStream.pos(); } Audio::SeekableAudioStream *CWaveFile::audioStream() { @@ -168,7 +169,7 @@ const byte *CWaveFile::lock() { switch (_loadMode) { case LOADMODE_SCUMMVM: assert(_waveData); - return _waveData; + return _waveData + _headerSize; default: return nullptr; diff --git a/engines/titanic/sound/wave_file.h b/engines/titanic/sound/wave_file.h index 4158d64683..f37557c7a8 100644 --- a/engines/titanic/sound/wave_file.h +++ b/engines/titanic/sound/wave_file.h @@ -40,6 +40,7 @@ private: byte *_waveData; int _waveSize; int _dataSize; + int _headerSize; QSoundManager *_soundManager; Audio::SeekableAudioStream *_audioStream; Audio::SoundHandle _soundHandle; |