diff options
author | Torbjörn Andersson | 2005-02-19 14:02:16 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-02-19 14:02:16 +0000 |
commit | 43cfe01f3d8d2307a23933920cce43740871f367 (patch) | |
tree | fe56072f944bc980981d5f0cfe1683116645d076 /sword2/sound.cpp | |
parent | 0de5fa2f33147529edcf4dccd24a2750b23a2867 (diff) | |
download | scummvm-rg350-43cfe01f3d8d2307a23933920cce43740871f367.tar.gz scummvm-rg350-43cfe01f3d8d2307a23933920cce43740871f367.tar.bz2 scummvm-rg350-43cfe01f3d8d2307a23933920cce43740871f367.zip |
This is the second part of the BS2 restructuring. There are two new
classes: Screen and Mouse. Screen handles most of the drawing, except the
mouse cursor and in-game menus.
The old Graphics class is no more.
I've also fixed some "reverse stereo" regressions from the first part of
the restructuring.
I'm not sure what the next step will be, but hopefully it will be smaller
than this one was.
svn-id: r16812
Diffstat (limited to 'sword2/sound.cpp')
-rw-r--r-- | sword2/sound.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sword2/sound.cpp b/sword2/sound.cpp index 90e5f8a395..97155db266 100644 --- a/sword2/sound.cpp +++ b/sword2/sound.cpp @@ -82,6 +82,20 @@ Sound::~Sound() { } } +void Sound::setReverseStereo(bool reverse) { + if (reverse != _reverseStereo) { + _reverseStereo = reverse; + + for (int i = 0; i < FXQ_LENGTH; i++) { + if (!_fxQueue[i].resource) + continue; + + _fxQueue[i].pan = -_fxQueue[i].pan; + _vm->_mixer->setChannelBalance(_fxQueue[i].handle, _fxQueue[i].pan); + } + } +} + /** * Stop all sounds, close their resources and clear the FX queue. */ @@ -190,6 +204,9 @@ void Sound::queueFx(int32 res, int32 type, int32 delay, int32 volume, int32 pan) volume = (volume * SoundMixer::kMaxChannelVolume) / 16; pan = (pan * 127) / 16; + if (isReverseStereo()) + pan = -pan; + _fxQueue[i].resource = res; _fxQueue[i].data = data + sizeof(StandardHeader); _fxQueue[i].len = len; |