[Scummvm-git-logs] scummvm master -> 09ebefe96131a98f56db235b92d59a8e14b3f082

dreammaster dreammaster at scummvm.org
Tue Mar 6 13:24:58 CET 2018


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b2811fa567 XEEN: Change setMusicVolume to setMusicPercent for better range clarity
09ebefe961 XEEN: Fix music volume in DarkSide intro when Pharoah is talking


Commit: b2811fa5673de51a6c1198a10d43e7b5f5218df5
    https://github.com/scummvm/scummvm/commit/b2811fa5673de51a6c1198a10d43e7b5f5218df5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-03-06T07:11:33-05:00

Commit Message:
XEEN: Change setMusicVolume to setMusicPercent for better range clarity

Changed paths:
    engines/xeen/locations.cpp
    engines/xeen/sound.cpp
    engines/xeen/sound.h
    engines/xeen/worldofxeen/clouds_cutscenes.cpp
    engines/xeen/worldofxeen/darkside_cutscenes.cpp


diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp
index 4a9abf0..bf724ae 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 a82901e..01d65f7 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 e062917..91a1fa7 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 436abb3..6662cba 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 171ce06..488161e 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();


Commit: 09ebefe96131a98f56db235b92d59a8e14b3f082
    https://github.com/scummvm/scummvm/commit/09ebefe96131a98f56db235b92d59a8e14b3f082
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-03-06T07:12:08-05:00

Commit Message:
XEEN: Fix music volume in DarkSide intro when Pharoah is talking

Changed paths:
    engines/xeen/worldofxeen/darkside_cutscenes.cpp


diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
index 488161e..aaee7e3 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
@@ -301,12 +301,11 @@ bool DarkSideCutscenes::showDarkSideIntro1() {
 	WAIT(20);
 
 	// Zoom into the Pharoah's base closeup view
+	sound.setMusicPercent(38);
 	for (int idx = 14; idx >= 0 && !_vm->shouldExit(); --idx) {
 		pyraTop.draw(0, 0, Common::Point(XLIST1[idx], YLIST1[idx]), 0, idx);
 		pyraTop.draw(0, 1, Common::Point(XLIST2[idx], YLIST1[idx]), 0, idx);
 
-		if (idx == 2)
-			sound.setMusicPercent(38);
 		WAIT(2);
 	}
 





More information about the Scummvm-git-logs mailing list