[Scummvm-cvs-logs] SF.net SVN: scummvm:[54954] scummvm/trunk/engines/mohawk/myst_stacks

bgk at users.sourceforge.net bgk at users.sourceforge.net
Sat Dec 18 14:13:49 CET 2010


Revision: 54954
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54954&view=rev
Author:   bgk
Date:     2010-12-18 13:13:49 +0000 (Sat, 18 Dec 2010)

Log Message:
-----------
MOHAWK: Myst sound rework, part 2

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/myst_stacks/channelwood.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/intro.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/preview.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/selenitic.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/stoneship.cpp

Modified: scummvm/trunk/engines/mohawk/myst_stacks/channelwood.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/channelwood.cpp	2010-12-18 13:12:56 UTC (rev 54953)
+++ scummvm/trunk/engines/mohawk/myst_stacks/channelwood.cpp	2010-12-18 13:13:49 UTC (rev 54954)
@@ -85,7 +85,7 @@
 		uint16 soundId = argv[0];
 		debugC(kDebugScript, "\tsoundId: %d", soundId);
 
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 
 		// TODO: Get Movie Location from Invoking Resource Rect, rather than
 		//       hardcoded 267, 170 ?

Modified: scummvm/trunk/engines/mohawk/myst_stacks/intro.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/intro.cpp	2010-12-18 13:12:56 UTC (rev 54953)
+++ scummvm/trunk/engines/mohawk/myst_stacks/intro.cpp	2010-12-18 13:13:49 UTC (rev 54954)
@@ -87,7 +87,7 @@
 	} else {
 		// Play Linking Sound, blocking...
 		_vm->_sound->stopSound();
-		Audio::SoundHandle *handle = _vm->_sound->playSound(soundIdLinkSrc);
+		Audio::SoundHandle *handle = _vm->_sound->replaceSound(soundIdLinkSrc);
 		while (_vm->_mixer->isSoundHandleActive(*handle))
 			_vm->_system->delayMillis(10);
 

Modified: scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp	2010-12-18 13:12:56 UTC (rev 54953)
+++ scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp	2010-12-18 13:13:49 UTC (rev 54954)
@@ -657,9 +657,9 @@
 		_vm->_gfx->copyImageToScreen(_libraryBookBaseImage + _libraryBookPage, rect);
 
 		if (_vm->_rnd->getRandomBit())
-			_vm->_sound->playSound(_libraryBookSound1);
+			_vm->_sound->replaceSound(_libraryBookSound1);
 		else
-			_vm->_sound->playSound(_libraryBookSound2);
+			_vm->_sound->replaceSound(_libraryBookSound2);
 
 		_vm->_system->updateScreen();
 	}
@@ -675,9 +675,9 @@
 		_vm->_gfx->copyImageToScreen(_libraryBookBaseImage + _libraryBookPage, rect);
 
 		if (_vm->_rnd->getRandomBit())
-			_vm->_sound->playSound(_libraryBookSound1);
+			_vm->_sound->replaceSound(_libraryBookSound1);
 		else
-			_vm->_sound->playSound(_libraryBookSound2);
+			_vm->_sound->replaceSound(_libraryBookSound2);
 
 		_vm->_system->updateScreen();
 	}
@@ -742,14 +742,14 @@
 		uint16 var10 = _vm->_varStore->getVar(10);
 
 		if (boxValue == 0x32 && var10 == 0) {
-			handle = _vm->_sound->playSound(soundId);
+			handle = _vm->_sound->replaceSound(soundId);
 
 			while (_vm->_mixer->isSoundHandleActive(*handle))
 				_vm->_system->delayMillis(10);
 
 			_vm->_varStore->setVar(10, 1);
 		} else if (boxValue != 0x32 && var10 == 1) {
-			handle = _vm->_sound->playSound(soundId);
+			handle = _vm->_sound->replaceSound(soundId);
 
 			while (_vm->_mixer->isSoundHandleActive(*handle))
 				_vm->_system->delayMillis(10);
@@ -845,7 +845,7 @@
 		else
 			_dockVaultState = 1;
 
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 		_vm->redrawArea(41, false);
 		animatedUpdate(directionalUpdateDataSize, &argv[3], delay);
 	}
@@ -873,7 +873,7 @@
 		if (_dockVaultState == 1 || _dockVaultState == 2)
 			_dockVaultState = 0;
 
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 		_vm->redrawArea(41, false);
 		animatedUpdate(directionalUpdateDataSize, &argv[3], delay);
 	}
@@ -980,7 +980,7 @@
 						&& myst.clockTowerMinutePosition == 40;
 
 	if (!myst.clockTowerBridgeOpen && correctTime) {
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 		_vm->_system->delayMillis(500);
 
 		// TODO: Play only 1st half of movie i.e. gears rise up, from 0 to 650
@@ -989,7 +989,7 @@
 		myst.clockTowerBridgeOpen = 1;
 		_vm->redrawArea(12);
 	} else if (myst.clockTowerBridgeOpen && !correctTime) {
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 		_vm->_system->delayMillis(500);
 
 		// TODO: Play only 2nd half of movie i.e. gears sink down, from 700 to 1300
@@ -1006,9 +1006,9 @@
 		uint16 varValue = _vm->_varStore->getVar(var);
 
 		if (varValue)
-			_vm->_sound->playSound(argv[1]);
+			_vm->_sound->replaceSound(argv[1]);
 		else
-			_vm->_sound->playSound(argv[0]);
+			_vm->_sound->replaceSound(argv[0]);
 
 		_vm->_varStore->setVar(var, !varValue);
 		// TODO: Change Var 45 "Dock Forechamber Imager Water Effect Enabled" here?
@@ -1036,7 +1036,7 @@
 		debugC(kDebugScript, "\tsoundIdBeepTune: %d", soundIdBeepTune);
 		debugC(kDebugScript, "\tsoundIdPanelSlam: %d", soundIdPanelSlam);
 
-		_vm->_sound->playSound(soundIdBeepLo);
+		_vm->_sound->replaceSound(soundIdBeepLo);
 
 		// TODO: Complete Logic...
 	} else
@@ -1082,14 +1082,16 @@
 		myst.generatorVoltage -= value;
 
 		if (myst.generatorVoltage)
-			_vm->_sound->playSound(8297);
+			_vm->_sound->replaceSound(8297);
 		else
-			_vm->_sound->playSound(9297);
+			_vm->_sound->replaceSound(9297);
 	} else {
 		if (_generatorVoltage)
-			_vm->_sound->playSound(6297);
-		else
-			_vm->_sound->playSound(7297); //TODO: Replace with play sound and replace background 4297
+			_vm->_sound->replaceSound(6297);
+		else {
+			_vm->_sound->replaceSound(7297); //TODO: Replace with play sound and replace background 4297
+			_vm->_sound->replaceBackground(4297);
+		}
 
 		myst.generatorButtons |= mask;
 		myst.generatorVoltage += value;
@@ -1205,13 +1207,13 @@
 		if (_tempVar == 0) {
 			uint16 soundId = handle->getList2(0);
 			if (soundId)
-				_vm->_sound->playSound(soundId);
+				_vm->_sound->replaceSound(soundId);
 		}
 		// Combination is right
 		if (myst.cabinSafeCombination == 724) {
 			uint16 soundId = handle->getList2(1);
 			if (soundId)
-				_vm->_sound->playSound(soundId);
+				_vm->_sound->replaceSound(soundId);
 
 			_vm->changeToCard(4103, false);
 
@@ -1265,7 +1267,7 @@
 		//       etc.
 
 		// TODO: Sound seems to be stuck looping?
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 	} else
 		unknown(op, var, argc, argv);
 }
@@ -1324,11 +1326,11 @@
 				if (myst.generatorVoltage > 59 || myst.generatorBreakers != 1) {
 					uint16 soundId = breaker->getList2(1);
 					if (soundId)
-						_vm->_sound->playSound(soundId);
+						_vm->_sound->replaceSound(soundId);
 				} else {
 					uint16 soundId = breaker->getList2(0);
 					if (soundId)
-						_vm->_sound->playSound(soundId);
+						_vm->_sound->replaceSound(soundId);
 
 					// Reset breaker state
 					myst.generatorBreakers = 0;
@@ -1338,11 +1340,11 @@
 				if (myst.generatorVoltage > 59 || myst.generatorBreakers != 2) {
 					uint16 soundId = breaker->getList2(1);
 					if (soundId)
-						_vm->_sound->playSound(soundId);
+						_vm->_sound->replaceSound(soundId);
 				} else {
 					uint16 soundId = breaker->getList2(0);
 					if (soundId)
-						_vm->_sound->playSound(soundId);
+						_vm->_sound->replaceSound(soundId);
 
 					// Reset breaker state
 					myst.generatorBreakers = 0;
@@ -1431,7 +1433,7 @@
 		}
 
 		// Pressure increasing sound
-		_vm->_sound->playSound(5098);
+		_vm->_sound->replaceSound(5098);
 
 		// Redraw wheel
 		_vm->redrawArea(99);
@@ -1452,7 +1454,7 @@
 		}
 
 		// Pressure increasing sound
-		_vm->_sound->playSound(5098);
+		_vm->_sound->replaceSound(5098);
 
 		// Redraw wheel
 		_vm->redrawArea(99);
@@ -1510,7 +1512,7 @@
 		myst.cabinValvePosition++;
 
 		// Pressure increasing sound
-		_vm->_sound->playSound(4642);
+		_vm->_sound->replaceSound(4642);
 
 		// Redraw wheel
 		_vm->redrawArea(99);
@@ -1525,7 +1527,7 @@
 		myst.cabinValvePosition--;
 
 		// Pressure decreasing sound
-		_vm->_sound->playSound(4642);
+		_vm->_sound->replaceSound(4642);
 
 		// Redraw wheel
 		_vm->redrawArea(99);
@@ -1572,17 +1574,18 @@
 				// Tree movement
 				if (goingDown) {
 					myst.treePosition--;
-					_vm->_sound->playSound(2);
+					_vm->_sound->replaceSound(2);
 				} else {
 					myst.treePosition++;
-					_vm->_sound->playSound(1);
+					_vm->_sound->replaceSound(1);
 				}
 
 				// Stop background music if going up from book room
-				if (_vm->getCurCard() == 4630 && myst.treePosition > 0) {
-					_vm->_sound->stopBackground();
-				} else {
-					_vm->_sound->replaceBackground(4630, 24576);
+				if (_vm->getCurCard() == 4630) {
+					if (myst.treePosition > 0)
+						_vm->_sound->stopBackground();
+					else
+						_vm->_sound->replaceBackground(4630, 24576);
 				}
 
 				// Redraw tree
@@ -1863,7 +1866,7 @@
 	if (step == maxStep && step != _rocketLeverPosition) {
 		uint16 soundId = lever->getList2(0);
 		if (soundId)
-			_vm->_sound->playSound(soundId);
+			_vm->_sound->replaceSound(soundId);
 
 		// If rocket correctly powered
 		if (myst.generatorVoltage == 59 && !myst.generatorBreakers) {
@@ -1975,7 +1978,7 @@
 
 void MystScriptParser_Myst::o_cabinMatchLight(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	if (!_cabinMatchState) {
-		_vm->_sound->playSound(4103);
+		_vm->_sound->replaceSound(4103);
 
 		// Match is lit
 		_cabinMatchState = 1;
@@ -2073,7 +2076,7 @@
 	MystResourceType11 *resource = static_cast<MystResourceType11 *>(_invokingResource);
 	uint16 soundId = resource->getList1(0);
 	if (soundId)
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 
 	// Turn wheel one step
 	if (wheel == 1) {
@@ -2136,9 +2139,9 @@
 		_vm->_gfx->copyImageToScreen(_libraryBookBaseImage + _libraryBookPage, rect);
 
 		if (_vm->_rnd->getRandomBit())
-			_vm->_sound->playSound(_libraryBookSound1);
+			_vm->_sound->replaceSound(_libraryBookSound1);
 		else
-			_vm->_sound->playSound(_libraryBookSound2);
+			_vm->_sound->replaceSound(_libraryBookSound2);
 
 		_vm->_system->updateScreen();
 	}
@@ -2162,9 +2165,9 @@
 		_vm->_gfx->copyImageToScreen(_libraryBookBaseImage + _libraryBookPage, rect);
 
 		if (_vm->_rnd->getRandomBit())
-			_vm->_sound->playSound(_libraryBookSound1);
+			_vm->_sound->replaceSound(_libraryBookSound1);
 		else
-			_vm->_sound->playSound(_libraryBookSound2);
+			_vm->_sound->replaceSound(_libraryBookSound2);
 
 		_vm->_system->updateScreen();
 	}
@@ -2222,12 +2225,12 @@
 	if (_dockVaultState) {
 		// Open switch
 		myst.dockMarkerSwitch = 1;
-		_vm->_sound->playSound(4143);
+		_vm->_sound->replaceSound(4143);
 		_vm->redrawArea(4);
 
 		// Close vault
 		_dockVaultState = 0;
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 		_vm->redrawArea(41, false);
 		animatedUpdate(directionalUpdateDataSize, &argv[3], delay);
 	}
@@ -2289,7 +2292,7 @@
 		uint16 var105 = _vm->_varStore->getVar(105);
 
 		if (var105 && !g_opcode201Parameters.lastVar105)
-			_vm->_sound->playSound(g_opcode201Parameters.soundId);
+			_vm->_sound->replaceSound(g_opcode201Parameters.soundId);
 
 		g_opcode201Parameters.lastVar105 = var105;
 	}
@@ -2316,7 +2319,7 @@
 void MystScriptParser_Myst::towerRotationMap_run() {
 	if (!_towerRotationMapInitialized) {
 		_towerRotationMapInitialized = true;
-		_vm->_sound->playSound(4378);
+		_vm->_sound->replaceSound(4378);
 
 		towerRotationDrawBuildings();
 
@@ -2529,7 +2532,7 @@
 		_libraryBookcaseMoving = false;
 
 		// Play transform sound and video
-		_vm->_sound->playSound(_libraryBookcaseSoundId);
+		_vm->_sound->replaceSound(_libraryBookcaseSoundId);
 		_libraryBookcaseMovie->playMovie();
 	}
 }

Modified: scummvm/trunk/engines/mohawk/myst_stacks/preview.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/preview.cpp	2010-12-18 13:12:56 UTC (rev 54953)
+++ scummvm/trunk/engines/mohawk/myst_stacks/preview.cpp	2010-12-18 13:13:49 UTC (rev 54954)
@@ -108,7 +108,7 @@
 	// Used for Card 3000 (Closed Myst Book)
 	// TODO: Fill in logic.
 	// Start Voice Over... which controls book opening
-	_vm->_sound->playSound(3001);
+	_vm->_sound->replaceSound(3001);
 
 	// then link to Myst - Trigger of Hotspot? then opcode 199/196/197 for voice over continue?
 	// TODO: Sync Voice and Actions to Original

Modified: scummvm/trunk/engines/mohawk/myst_stacks/selenitic.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/selenitic.cpp	2010-12-18 13:12:56 UTC (rev 54953)
+++ scummvm/trunk/engines/mohawk/myst_stacks/selenitic.cpp	2010-12-18 13:13:49 UTC (rev 54954)
@@ -579,7 +579,7 @@
 		soundId =  2191;
 
 	if (soundId)
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 
 	_mazeRunnerLight->drawConditionalDataToScreen(0);
 }
@@ -623,17 +623,17 @@
 		}
 
 		_soundReceiverPosition = &selenitic.soundReceiverPositions[source];
-		_vm->_sound->stopSound();
-		_vm->_sound->playSound(2287);
+		_vm->_sound->stopBackground();
+		_vm->_sound->replaceSound(2287);
 		soundReceiverDrawView();
 		uint16 soundId = soundReceiverCurrentSound(source, *_soundReceiverPosition);
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceBackground(soundId);
 		_vm->_system->delayMillis(1000);
 	}
 
 	_soundReceiverPosition = oldPosition;
 	_soundReceiverSigmaPressed = true;
-	_vm->_sound->stopSound();
+	_vm->_sound->stopBackground();
 
 	_soundReceiverSources[selenitic.soundReceiverCurrentSource]->drawConditionalDataToScreen(1);
 
@@ -738,7 +738,8 @@
 		_vm->_sound->stopSound();
 
 		uint16 soundId = argv[0];
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->stopBackground();
+		_vm->_sound->replaceSound(soundId);
 
 		_soundReceiverCurrentSource->drawConditionalDataToScreen(1);
 
@@ -755,11 +756,11 @@
 
 	if (_mazeRunnerPosition == 288) {
 		_vm->changeToCard(cardIdEntry, false);
-		_vm->_sound->playSound(cardIdEntry);
+		_vm->_sound->replaceSound(cardIdEntry);
 		animatedUpdate(argv[2], &argv[3], 10);
 	} else if (_mazeRunnerPosition == 289) {
 		_vm->changeToCard(cardIdExit, false);
-		_vm->_sound->playSound(cardIdExit);
+		_vm->_sound->replaceSound(cardIdExit);
 		animatedUpdate(argv[2], &argv[3], 10);
 	}
 }
@@ -877,15 +878,14 @@
 
 	uint16 soundId = slider->getList3(0);
 	if (soundId)
-		_vm->_sound->playSound(soundId);
+		_vm->_sound->replaceSound(soundId);
 
-	_vm->_sound->stopSound();
 	_vm->_sound->resumeBackground();
 }
 
 void MystScriptParser_Selenitic::soundLockCheckSolution(MystResourceType10 *slider, uint16 value, uint16 solution, bool &solved) {
 	slider->drawConditionalDataToScreen(2);
-	_vm->_sound->playSound(soundLockCurrentSound(value / 12, false));
+	_vm->_sound->replaceSound(soundLockCurrentSound(value / 12, false));
 	_vm->_system->delayMillis(1500);
 
 	if (value / 12 != solution) {
@@ -903,7 +903,7 @@
 	bool solved = true;
 
 	_vm->_sound->pauseBackground();
-	_vm->_sound->playSound(1147);
+	_vm->_sound->replaceSound(1147);
 	_soundLockButton->drawConditionalDataToScreen(1);
 	_vm->_cursor->hideCursor();
 
@@ -913,7 +913,7 @@
 	soundLockCheckSolution(_soundLockSlider4, selenitic.soundLockSliderPositions[3], 6, solved);
 	soundLockCheckSolution(_soundLockSlider5, selenitic.soundLockSliderPositions[4], 7, solved);
 
-	_vm->_sound->playSound(1148);
+	_vm->_sound->replaceSound(1148);
 	_vm->_sound->resumeBackground();
 
 	if (solved) {
@@ -925,7 +925,7 @@
 		_vm->changeToCard(cardIdClosed, true);
 
 		_vm->changeToCard(cardIdOpen, false);
-		_vm->_sound->playSound(argv[2]);
+		_vm->_sound->replaceSound(argv[2]);
 
 		animatedUpdate(argv[4], &argv[5], argv[3]);
 	} else {

Modified: scummvm/trunk/engines/mohawk/myst_stacks/stoneship.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/stoneship.cpp	2010-12-18 13:12:56 UTC (rev 54953)
+++ scummvm/trunk/engines/mohawk/myst_stacks/stoneship.cpp	2010-12-18 13:13:49 UTC (rev 54954)
@@ -553,8 +553,8 @@
 
 		// TODO: Work Out Function i.e. control Var etc.
 		if (false) {
-			_vm->_sound->playSound(soundId);
-			_vm->_sound->playSound(soundIdStopping);
+			_vm->_sound->replaceSound(soundId);
+			_vm->_sound->replaceSound(soundIdStopping);
 		}
 	} else
 		unknown(op, var, argc, argv);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list