[Scummvm-git-logs] scummvm master -> f16505b128c5aac2a0b4d8c18e360b14058149e1

dreammaster dreammaster at scummvm.org
Sun Jun 25 14:01:09 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:
f16505b128 TITANIC: Change Bomb to use speech sound type


Commit: f16505b128c5aac2a0b4d8c18e360b14058149e1
    https://github.com/scummvm/scummvm/commit/f16505b128c5aac2a0b4d8c18e360b14058149e1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-06-25T08:00:55-04:00

Commit Message:
TITANIC: Change Bomb to use speech sound type

Changed paths:
    engines/titanic/game/bomb.cpp
    engines/titanic/sound/proximity.cpp
    engines/titanic/sound/proximity.h


diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp
index 17c10c5..93887ab 100644
--- a/engines/titanic/game/bomb.cpp
+++ b/engines/titanic/game/bomb.cpp
@@ -158,7 +158,7 @@ bool CBomb::StatusChangeMsg(CStatusChangeMsg *msg) {
 			break;
 		}
 
-		_soundHandle = queueSound(name, _soundHandle, _volume);
+		_soundHandle = queueSound(name, _soundHandle, _volume, Audio::Mixer::kSpeechSoundType);
 	}
 
 	return true;
@@ -174,7 +174,6 @@ bool CBomb::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 
 	if (_active) {
 		stopSound(_soundHandle);
-		//stopSound(_unusedHandle);
 
 		if (_numCorrectWheels < CORRECT_WHEELS) {
 			_tappedCtr = MIN(_tappedCtr + 1, 23);
@@ -201,7 +200,7 @@ bool CBomb::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 				break;
 			}
 
-			_soundHandle = queueSound(name, _soundHandle, _volume);
+			_soundHandle = queueSound(name, _soundHandle, _volume, Audio::Mixer::kSpeechSoundType);
 			_countdown = 999;
 		}
 	} else {
@@ -258,7 +257,7 @@ bool CBomb::ActMsg(CActMsg *msg) {
 			break;
 		}
 
-		_soundHandle = queueSound(name, _soundHandle, _volume);
+		_soundHandle = queueSound(name, _soundHandle, _volume, Audio::Mixer::kSpeechSoundType);
 		_countdown = 999;
 	}
 
@@ -267,7 +266,8 @@ bool CBomb::ActMsg(CActMsg *msg) {
 
 bool CBomb::TurnOn(CTurnOn *msg) {
 	if (!_active) {
-		_soundHandle = playSound("z#389.wav", _volume);
+		CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
+		_soundHandle = playSound("z#389.wav", prox);
 		_active = true;
 
 		// WORKAROUND: Only reset the code wheels back to 'O' value
@@ -295,8 +295,9 @@ bool CBomb::TurnOn(CTurnOn *msg) {
 
 bool CBomb::TimerMsg(CTimerMsg *msg) {
 	if (msg->_action == "Disarmed") {
+		CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
 		stopSound(_soundHandle);
-		playSound("z#364.wav", _volume);
+		playSound("z#364.wav", prox);
 
 		CActMsg actMsg1("Disarm Bomb");
 		actMsg1.execute("EndExplodeShip");
@@ -330,8 +331,9 @@ bool CBomb::TimerMsg(CTimerMsg *msg) {
 
 					if (_countdown >= 100) {
 						// Play "x hundred and" or just "x hundred"
+						CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
 						CString hName = remainder ? HUNDREDS_AND_WAVS[hundreds] : HUNDREDS_WAVS[hundreds];
-						_soundHandle = playSound(hName, _volume);
+						_soundHandle = playSound(hName, prox);
 					}
 
 					CString ctrName = COUNTDOWN_WAVS[remainder];
@@ -342,9 +344,10 @@ bool CBomb::TimerMsg(CTimerMsg *msg) {
 
 					// Play the sub-hundred portion of the countdown amount
 					if (_soundHandle > 0) {
-						_soundHandle = queueSound(ctrName, _soundHandle, _volume);
+						_soundHandle = queueSound(ctrName, _soundHandle, _volume, 0, false, Audio::Mixer::kSpeechSoundType);
 					} else {
-						_soundHandle = playSound(ctrName, _volume);
+						CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
+						_soundHandle = playSound(ctrName, prox);
 					}
 
 					// Reduce countdown and schedule another timer
@@ -352,7 +355,7 @@ bool CBomb::TimerMsg(CTimerMsg *msg) {
 					addTimer(0, 1000, 0);
 				}
 			} else {
-				// Bomb speech currently active, so schedule the method'
+				// Bomb speech currently active, so schedule the method
 				// to re-trigger after 100ms to check if speech is finished
 				addTimer(0, 100, 0);
 			}
diff --git a/engines/titanic/sound/proximity.cpp b/engines/titanic/sound/proximity.cpp
index 796e344..f949bad 100644
--- a/engines/titanic/sound/proximity.cpp
+++ b/engines/titanic/sound/proximity.cpp
@@ -35,4 +35,14 @@ CProximity::CProximity() : _channelVolume(100), _balance(0),
 		_soundDuration(0), _soundType(Audio::Mixer::kPlainSoundType) {
 }
 
+CProximity::CProximity(Audio::Mixer::SoundType soundType, int volume) :
+	_soundType(soundType), _channelVolume(volume),
+	_balance(0), _priorSoundHandle(-1), _frequencyMultiplier(0.0),
+	_frequencyAdjust(1.875), _repeated(false), _channelMode(10),
+	_positioningMode(POSMODE_NONE), _azimuth(0.0), _range(0.5), _elevation(0),
+	_posX(0.0), _posY(0.0), _posZ(0.0), _hasVelocity(false), _velocityX(0),
+	_velocityY(0), _velocityZ(0), _disposeAfterUse(DisposeAfterUse::NO),
+	_endTalkerFn(nullptr), _talker(nullptr), _soundDuration(0) {
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/proximity.h b/engines/titanic/sound/proximity.h
index 2f07452..92e65bb 100644
--- a/engines/titanic/sound/proximity.h
+++ b/engines/titanic/sound/proximity.h
@@ -61,6 +61,7 @@ public:
 	Audio::Mixer::SoundType _soundType;
 public:
 	CProximity();
+	CProximity(Audio::Mixer::SoundType soundType, int volume = 100);
 };
 
 } // End of namespace Titanic





More information about the Scummvm-git-logs mailing list