[Scummvm-git-logs] scummvm master -> abe4f20fc1649bf2f6b111034a4044b4b6b2846f

dreammaster dreammaster at scummvm.org
Fri Feb 10 03:43:15 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
abe4f20fc1 TITANIC: CWaveFile::lock now returns pointer to data, not WAV header


Commit: abe4f20fc1649bf2f6b111034a4044b4b6b2846f
    https://github.com/scummvm/scummvm/commit/abe4f20fc1649bf2f6b111034a4044b4b6b2846f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-09T21:43:03-05:00

Commit Message:
TITANIC: CWaveFile::lock now returns pointer to data, not WAV header

Changed paths:
    engines/titanic/sound/wave_file.cpp
    engines/titanic/sound/wave_file.h


diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp
index bc29ed0..a328fe1 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 4158d64..f37557c 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;





More information about the Scummvm-git-logs mailing list