[Scummvm-git-logs] scummvm master -> 128edeebda490794d0ce78d3d6d84beab29c2246

dreammaster dreammaster at scummvm.org
Tue Sep 5 01:11:08 CEST 2017


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

Summary:
128edeebda TITANIC: Implement setup code for sound slider positions


Commit: 128edeebda490794d0ce78d3d6d84beab29c2246
    https://github.com/scummvm/scummvm/commit/128edeebda490794d0ce78d3d6d84beab29c2246
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-04T19:11:01-04:00

Commit Message:
TITANIC: Implement setup code for sound slider positions

Changed paths:
    engines/titanic/pet_control/pet_sound.cpp
    engines/titanic/pet_control/pet_sound.h


diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index a22b743..e4fac34 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -109,6 +109,24 @@ bool CPetSound::reset() {
 	return false;
 }
 
+void CPetSound::setSliders() {
+	CPetControl *pet = getPetControl();
+	CGameManager *gameMan = pet ? pet->getGameManager() : nullptr;
+
+	if (gameMan) {
+		CSoundManager &soundMan = gameMan->_sound._soundManager;
+		uint masterVol = soundMan.getModeVolume(VOL_NORMAL);
+		uint musicVol = soundMan.getMusicVolume();
+		uint parrotVol = soundMan.getParrotVolume();
+		uint speechVol = soundMan.getSpeechVolume();
+
+		_masterVolume.setSliderOffset(masterVol * 0.01);
+		_musicVolume.setSliderOffset(musicVol * 0.01);
+		_parrotVolume.setSliderOffset(parrotVol * 0.01);
+		_speechVolume.setSliderOffset(speechVol * 0.01);
+	}
+}
+
 void CPetSound::draw2(CScreenManager *screenManager) {
 	_element.draw(screenManager);
 
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index 8e9795d..9365b31 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -50,6 +50,11 @@ private:
 	SliderType _draggingSliderNum;
 private:
 	/**
+	 * Sets the positions of the volume sliders
+	 */
+	void setSliders();
+
+	/**
 	 * Called when a slider has changed
 	 */
 	void sliderChanged(double offset, SliderType sliderNum);
@@ -97,6 +102,13 @@ public:
 	virtual bool MouseButtonUpMsg(const Point &pt);
 
 	/**
+	 * Highlight any currently highlighted element
+	 */
+	virtual void highlightCurrent(const Point &pt) {
+		setSliders();
+	}
+
+	/**
 	 * Returns the tooltip text for when the glyph is selected
 	 */
 	virtual void getTooltip(CTextControl *text);





More information about the Scummvm-git-logs mailing list