diff options
author | Paul Gilbert | 2009-06-22 06:17:50 +0000 |
---|---|---|
committer | Paul Gilbert | 2009-06-22 06:17:50 +0000 |
commit | 8dfbd0f845689a092615352b157a85bb779a3f1e (patch) | |
tree | aa8b9b3ec578a52ca0bf702b0ff3788a55c1a429 | |
parent | 4c01d4a954efeedc8aedade64b92f80f8af547e5 (diff) | |
download | scummvm-rg350-8dfbd0f845689a092615352b157a85bb779a3f1e.tar.gz scummvm-rg350-8dfbd0f845689a092615352b157a85bb779a3f1e.tar.bz2 scummvm-rg350-8dfbd0f845689a092615352b157a85bb779a3f1e.zip |
Implemented the Op_SetVolume method like the original, which simply set a dummy variable and never actually changed the volume
svn-id: r41748
-rw-r--r-- | engines/cruise/function.cpp | 7 | ||||
-rw-r--r-- | engines/cruise/sound.cpp | 9 | ||||
-rw-r--r-- | engines/cruise/sound.h | 7 |
3 files changed, 7 insertions, 16 deletions
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 1dbac3e209..db7d1eb167 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -1630,16 +1630,13 @@ int16 Op_GetNodeY(void) { } int16 Op_SetVolume(void) { - int oldVolume = _vm->sound().getVolume() >> 2; + int oldVolume = _vm->sound().getVolume(); int newVolume = popVar(); - // TODO: The game seems to expect the volume will only range from 0 - 63, so for now - // I'm doing a translation of the full range 0 - 255 to the 0 - 63 for this script. - // Need to verify at some point that there's no problem with this if (newVolume > 63) newVolume = 63; if (newVolume >= 0) { int volume = 63 - newVolume; - _vm->sound().setVolume(volume << 2); + _vm->sound().setVolume(volume); } return oldVolume >> 2; diff --git a/engines/cruise/sound.cpp b/engines/cruise/sound.cpp index db8dc67e5a..64f628601a 100644 --- a/engines/cruise/sound.cpp +++ b/engines/cruise/sound.cpp @@ -814,15 +814,6 @@ void PCSound::startNote(int channel, int volume, int freq) { _soundDriver->setChannelFrequency(channel, freq); } -void PCSound::setVolume(int volume) { - warning("TODO: setVolume"); -} - -uint8 PCSound::getVolume() { - warning("TODO: getVolume"); - return 63; -} - void PCSound::startSound(int channelNum, const byte *ptr, int size, int speed, int volume, bool loop) { warning("TODO: validate startSound"); playSound(channelNum, speed, ptr, size, 0, 0, volume, loop); diff --git a/engines/cruise/sound.h b/engines/cruise/sound.h index a47b3fc8ad..3c02193086 100644 --- a/engines/cruise/sound.h +++ b/engines/cruise/sound.h @@ -41,6 +41,7 @@ class PCSound { private: Audio::Mixer *_mixer; CruiseEngine *_vm; + int _genVolume; protected: PCSoundDriver *_soundDriver; PCSoundFxPlayer *_player; @@ -71,8 +72,10 @@ public: bool musicLooping() const; void musicLoop(bool v); void startNote(int channel, int volume, int freq); - void setVolume(int volume); - uint8 getVolume(); + + // Note: Volume variable accessed by these methods is never actually used in original game + void setVolume(int volume) { _genVolume = volume; } + uint8 getVolume() const { return _genVolume; } }; } // End of namespace Cruise |