diff options
| -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  | 
