aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/sound.cpp
diff options
context:
space:
mode:
authorNorbert Lange2009-08-16 16:39:34 +0000
committerNorbert Lange2009-08-16 16:39:34 +0000
commitc96affd0c1e5480fe1a4a3d3e82583c795570d21 (patch)
tree3f3a71bc02976024345c5c3e44534055d9c9c4cd /engines/agos/sound.cpp
parent2b147c57161cdacf3cdc5bc572ce46160cbd6b5e (diff)
parentce30a513acdaab2ca5eacd136cc80ade1beabb3a (diff)
downloadscummvm-rg350-c96affd0c1e5480fe1a4a3d3e82583c795570d21.tar.gz
scummvm-rg350-c96affd0c1e5480fe1a4a3d3e82583c795570d21.tar.bz2
scummvm-rg350-c96affd0c1e5480fe1a4a3d3e82583c795570d21.zip
merge with trunk
svn-id: r43443
Diffstat (limited to 'engines/agos/sound.cpp')
-rw-r--r--engines/agos/sound.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp
index d20c07a8c8..3008442ed2 100644
--- a/engines/agos/sound.cpp
+++ b/engines/agos/sound.cpp
@@ -133,8 +133,10 @@ public:
};
class VocSound : public BaseSound {
+ byte _flags;
public:
- VocSound(Audio::Mixer *mixer, File *file, uint32 base = 0, bool bigEndian = false) : BaseSound(mixer, file, base, bigEndian) {}
+ VocSound(Audio::Mixer *mixer, File *file, uint32 base = 0, bool bigEndian = false) : BaseSound(mixer, file, base, bigEndian), _flags(0) {}
+ Audio::AudioStream *makeAudioStream(uint sound);
void playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol = 0);
};
@@ -255,14 +257,15 @@ void WavSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType typ
_mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol);
}
-void VocSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) {
- if (_offsets == NULL)
- return;
-
+Audio::AudioStream *VocSound::makeAudioStream(uint sound) {
_file->seek(_offsets[sound], SEEK_SET);
+ return Audio::makeVOCStream(*_file, _flags);
+}
- Audio::AudioStream *stream = Audio::makeVOCStream(*_file, flags);
- _mixer->playInputStream(type, handle, stream);
+void VocSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) {
+ convertVolume(vol);
+ _flags = flags;
+ _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol);
}
void RawSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) {
@@ -630,7 +633,8 @@ void Sound::playEffects(uint sound) {
if (_effectsPaused)
return;
- _mixer->stopHandle(_effectsHandle);
+ if (_vm->getGameType() == GType_SIMON1)
+ _mixer->stopHandle(_effectsHandle);
_effects->playSound(sound, Audio::Mixer::kSFXSoundType, &_effectsHandle, (_vm->getGameId() == GID_SIMON1CD32) ? 0 : Audio::Mixer::FLAG_UNSIGNED);
}