diff options
| author | Paul Gilbert | 2018-03-06 07:11:33 -0500 | 
|---|---|---|
| committer | Paul Gilbert | 2018-03-06 07:11:33 -0500 | 
| commit | b2811fa5673de51a6c1198a10d43e7b5f5218df5 (patch) | |
| tree | b8de43b05eba068d4e974f4d0c8b8915657f1969 | |
| parent | a461a39e4a864a0e850e72322e8771db188b7d4a (diff) | |
| download | scummvm-rg350-b2811fa5673de51a6c1198a10d43e7b5f5218df5.tar.gz scummvm-rg350-b2811fa5673de51a6c1198a10d43e7b5f5218df5.tar.bz2 scummvm-rg350-b2811fa5673de51a6c1198a10d43e7b5f5218df5.zip | |
XEEN: Change setMusicVolume to setMusicPercent for better range clarity
| -rw-r--r-- | engines/xeen/locations.cpp | 20 | ||||
| -rw-r--r-- | engines/xeen/sound.cpp | 11 | ||||
| -rw-r--r-- | engines/xeen/sound.h | 5 | ||||
| -rw-r--r-- | engines/xeen/worldofxeen/clouds_cutscenes.cpp | 7 | ||||
| -rw-r--r-- | engines/xeen/worldofxeen/darkside_cutscenes.cpp | 17 | 
5 files changed, 34 insertions, 26 deletions
| diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp index 4a9abf073d..bf724ae8d0 100644 --- a/engines/xeen/locations.cpp +++ b/engines/xeen/locations.cpp @@ -1336,7 +1336,7 @@ int ReaperCutscene::show() {  		}  	} -	sound.setMusicVolume(48); +	sound.setMusicPercent(38);  	sprites1.draw(0, 0, Common::Point(0, 0));  	if (_isDarkCc) {  		sprites1.draw(0, 1, Common::Point(160, 0)); @@ -1433,7 +1433,7 @@ exit:  	// Restore game screen  	sound.stopSound(); -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	screen.loadBackground("back.raw");  	intf.drawParty(false); @@ -1641,7 +1641,7 @@ int GolemCutscene::show() {  		if (g_vm->shouldExit() || _buttonValue)  			goto exit;  	} -	sound.setMusicVolume(48); +	sound.setMusicPercent(38);  	sound.playSound(_mazeFlag ? "golem15.voc" : "golem13.voc");  	do { @@ -1729,7 +1729,7 @@ int GolemCutscene::show() {  			goto exit;  	} -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	if (!_mazeFlag) {  		for (int idx = 0; !g_vm->shouldExit() && idx < (_isDarkCc ? 9 : 12); ++idx) { @@ -1756,7 +1756,7 @@ exit:  	setNewLocation();  	// Restore game screen -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	sound.stopSound();  	screen.loadBackground("back.raw"); @@ -1939,7 +1939,7 @@ int DwarfCutscene::show() {  			goto exit;  	} -	sound.setMusicVolume(48); +	sound.setMusicPercent(38);  	screen.blitFrom(savedBg);  	sprites2.draw(0, 0);  	windows[0].update(); @@ -1999,7 +1999,7 @@ exit:  	setNewLocation();  	// Restore game screen -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	sound.stopSound();  	screen.loadBackground("back.raw"); @@ -2140,7 +2140,7 @@ int SphinxCutscene::show() {  			goto exit;  	} -	sound.setMusicVolume(48); +	sound.setMusicPercent(38);  	for (int idx = 0; idx < (_mazeFlag ? 3 : 2); ++idx) {  		switch (idx) { @@ -2172,7 +2172,7 @@ int SphinxCutscene::show() {  		sprites1.draw(0, 1, Common::Point(160, 0));  	} -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	if (!_mazeFlag) {  		for (int idx = 0; idx < 8; ++idx) { @@ -2198,7 +2198,7 @@ exit:  	setNewLocation();  	// Restore game screen -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	screen.loadBackground("back.raw");  	intf.drawParty(false);  	intf.draw3d(false, false); diff --git a/engines/xeen/sound.cpp b/engines/xeen/sound.cpp index a82901efe6..01d65f743e 100644 --- a/engines/xeen/sound.cpp +++ b/engines/xeen/sound.cpp @@ -29,7 +29,7 @@  namespace Xeen {  Sound::Sound(Audio::Mixer *mixer) : _mixer(mixer), _fxOn(true), _musicOn(true), -		_songData(nullptr), _effectsData(nullptr), _musicSide(0) { +		_songData(nullptr), _effectsData(nullptr), _musicSide(0), _musicPercent(100) {  	_SoundDriver = new AdlibSoundDriver();  } @@ -81,6 +81,7 @@ void Sound::stopAllAudio() {  	stopSong();  	stopFX();  	stopSound(); +	setMusicPercent(100);  }  void Sound::setFxOn(bool isOn) { @@ -191,4 +192,12 @@ bool Sound::isMusicPlaying() const {  	return _SoundDriver->isPlaying();  } +void Sound::setMusicPercent(byte percent) { +	assert(percent <= 100); +	_musicPercent = percent; + +	songCommand(SET_VOLUME, (int)percent * 127 / 100); +} + +  } // End of namespace Xeen diff --git a/engines/xeen/sound.h b/engines/xeen/sound.h index e0629170ef..91a1fa79c8 100644 --- a/engines/xeen/sound.h +++ b/engines/xeen/sound.h @@ -39,6 +39,7 @@ private:  	const byte *_songData;  	Audio::Mixer *_mixer;  	Audio::SoundHandle _soundHandle; +	byte _musicPercent;  private:  	/**  	 * Loads effects data that was embedded in the music driver @@ -84,9 +85,9 @@ public:  	void restartSong() { songCommand(RESTART_SONG); }  	/** -	 * Sets the music volume +	 * Sets the in-game music volume percent. This is separate from the ScummVM volume  	 */ -	void setMusicVolume(byte volume) { songCommand(SET_VOLUME, volume); } +	void setMusicPercent(byte percent);  	/**  	 * Plays a song diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.cpp b/engines/xeen/worldofxeen/clouds_cutscenes.cpp index 436abb3b42..6662cbae29 100644 --- a/engines/xeen/worldofxeen/clouds_cutscenes.cpp +++ b/engines/xeen/worldofxeen/clouds_cutscenes.cpp @@ -44,7 +44,6 @@ bool CloudsCutscenes::showCloudsIntro() {  	bool seenIntro = showCloudsTitle() && showCloudsIntroInner();  	sound.stopAllAudio(); -	sound.setMusicVolume(100);  	screen.freePages();  	return seenIntro; @@ -247,7 +246,7 @@ bool CloudsCutscenes::showCloudsIntroInner() {  	if (doScroll(false, true))  		return false; -	sound.setMusicVolume(75); +	sound.setMusicPercent(60);  	screen.restoreBackground();  	screen.update();  	resetSubtitles(0, 1); @@ -523,7 +522,7 @@ bool CloudsCutscenes::showCloudsEnding1() {  		WAIT(3);  	} -	sound.setMusicVolume(75); +	sound.setMusicPercent(60);  	// Alamar's monologue  	for (int idx = 0; idx < 3; ++idx) { @@ -570,7 +569,7 @@ bool CloudsCutscenes::showCloudsEnding1() {  	// Laugh  	sound.playSound("darklaff.voc"); -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	// Alamar fade out  	for (int idx = 12; idx >= 0; --idx) { diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp index 171ce06f2a..488161edae 100644 --- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp +++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp @@ -95,7 +95,7 @@ bool DarkSideCutscenes::showDarkSideTitle(bool seenIntro) {  	screen.horizMerge(0);  	screen.fadeIn(); -	sound.setMusicVolume(0x5f); +	sound.setMusicPercent(75);  	sound.playFX(1);  	// Initial loop for dragon roaring @@ -191,7 +191,6 @@ bool DarkSideCutscenes::showDarkSideIntro(bool seenIntro) {  	}  	sound.stopAllAudio(); -	sound.setMusicVolume(100);  	screen.freePages();  	return seenIntro; @@ -247,7 +246,7 @@ bool DarkSideCutscenes::showDarkSideIntro1() {  	};  	// Play the intro music -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	sound.playSong("bigtheme.m");  	screen.loadBackground("jvc.raw"); @@ -299,7 +298,7 @@ bool DarkSideCutscenes::showDarkSideIntro1() {  	screen.saveBackground();  	screen.freePages(); -	WAIT(30); +	WAIT(20);  	// Zoom into the Pharoah's base closeup view  	for (int idx = 14; idx >= 0 && !_vm->shouldExit(); --idx) { @@ -307,7 +306,7 @@ bool DarkSideCutscenes::showDarkSideIntro1() {  		pyraTop.draw(0, 1, Common::Point(XLIST2[idx], YLIST1[idx]), 0, idx);  		if (idx == 2) -			sound.setMusicVolume(48); +			sound.setMusicPercent(38);  		WAIT(2);  	} @@ -724,7 +723,7 @@ bool DarkSideCutscenes::showDarkSideIntro3() {  	sound.playFX(0);  	screen.fadeOut(); -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	screen.loadBackground("bird.raw");  	screen.saveBackground();  	screen.fadeIn(); @@ -1193,7 +1192,7 @@ bool DarkSideCutscenes::showDarkSideEnding2() {  	// Closeup of side of Alamar's helmet  	SpriteResource sc11("sc11.end"); -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	sound.playSong("dngon2.m");  	screen.fadeOut();  	screen.loadBackground("blank.raw"); @@ -1241,7 +1240,7 @@ bool DarkSideCutscenes::showDarkSideEnding2() {  	// I'm ready for you this time  	SpriteResource sc13("sc13.end");  	resetSubtitles(26); -	sound.setMusicVolume(48); +	sound.setMusicPercent(38);  	for (int idx = 0; idx < 16; ++idx) {  		if (idx == 1) @@ -1430,7 +1429,7 @@ bool DarkSideCutscenes::showDarkSideEnding3() {  	// Corak waving his hands  	SpriteResource sc20("sc20.end"); -	sound.setMusicVolume(95); +	sound.setMusicPercent(75);  	sound.playSong("sf17.m");  	screen.loadBackground("blank.raw");  	screen.saveBackground(); | 
