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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Tue Jan 18 22:10:59 CET 2011


Revision: 55314
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55314&view=rev
Author:   mthreepwood
Date:     2011-01-18 21:10:58 +0000 (Tue, 18 Jan 2011)

Log Message:
-----------
MOHAWK: Rename some Myst-specific sound functions; cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/console.cpp
    scummvm/trunk/engines/mohawk/myst.cpp
    scummvm/trunk/engines/mohawk/myst_areas.cpp
    scummvm/trunk/engines/mohawk/myst_scripts.cpp
    scummvm/trunk/engines/mohawk/myst_stacks/channelwood.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
    scummvm/trunk/engines/mohawk/sound.cpp
    scummvm/trunk/engines/mohawk/sound.h

Modified: scummvm/trunk/engines/mohawk/console.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/console.cpp	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/console.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -216,7 +216,7 @@
 		return true;
 	}
 
-	_vm->_sound->replaceSound((uint16)atoi(argv[1]));
+	_vm->_sound->replaceSoundMyst((uint16)atoi(argv[1]));
 
 	return false;
 }

Modified: scummvm/trunk/engines/mohawk/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst.cpp	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/myst.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -410,7 +410,7 @@
 	_curStack = stack;
 
 	_sound->stopSound();
-	_sound->stopBackground();
+	_sound->stopBackgroundMyst();
 	if (linkSrcSound)
 		_sound->playSoundBlocking(linkSrcSound);
 
@@ -610,13 +610,13 @@
 		debug(2, "Continuing with current sound");
 	else if (soundAction == kMystSoundActionChangeVolume) {
 		debug(2, "Continuing with current sound, changing volume");
-		_sound->changeBackgroundVolume(soundActionVolume);
+		_sound->changeBackgroundVolumeMyst(soundActionVolume);
 	} else if (soundAction == kMystSoundActionStop) {
 		debug(2, "Stopping sound");
-		_sound->stopBackground();
+		_sound->stopBackgroundMyst();
 	} else if (soundAction > 0) {
 		debug(2, "Playing new sound %d", soundAction);
-		_sound->replaceBackground(soundAction, soundActionVolume);
+		_sound->replaceBackgroundMyst(soundAction, soundActionVolume);
 	} else {
 		error("Unknown sound action %d", soundAction);
 	}

Modified: scummvm/trunk/engines/mohawk/myst_areas.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_areas.cpp	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/myst_areas.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -623,7 +623,7 @@
 	}
 
 	if (positionChanged && _dragSound)
-		_vm->_sound->replaceSound(_dragSound);
+		_vm->_sound->replaceSoundMyst(_dragSound);
 }
 
 MystResourceType11::MystResourceType11(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType8(vm, rlstStream, parent) {

Modified: scummvm/trunk/engines/mohawk/myst_scripts.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_scripts.cpp	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/myst_scripts.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -124,7 +124,7 @@
 	OPCODE(22, o_goToDest);
 	OPCODE(23, o_toggleAreasActivation);
 	OPCODE(24, o_playSound);
-	// Opcode 25 is unused; original calls replaceSound
+	// Opcode 25 is unused; original calls replaceSoundMyst
 	OPCODE(26, o_stopSoundBackground);
 	OPCODE(27, o_playSoundBlocking);
 	OPCODE(28, o_copyBackBufferToScreen);
@@ -556,14 +556,14 @@
 		debugC(kDebugScript, "Opcode %d: playSound", op);
 		debugC(kDebugScript, "\tsoundId: %d", soundId);
 
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 	} else
 		unknown(op, var, argc, argv);
 }
 
 void MystScriptParser::o_stopSoundBackground(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	debugC(kDebugScript, "Opcode %d: stopSoundBackground", op);
-	_vm->_sound->stopBackground();
+	_vm->_sound->stopBackgroundMyst();
 }
 
 void MystScriptParser::o_playSoundBlocking(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -685,15 +685,15 @@
 		else if (soundAction == kMystSoundActionChangeVolume) {
 			debugC(kDebugScript, "Continue current sound, change volume");
 			debugC(kDebugScript, "\tVolume: %d", soundVolume);
-			_vm->_sound->changeBackgroundVolume(soundVolume);
+			_vm->_sound->changeBackgroundVolumeMyst(soundVolume);
 		} else if (soundAction == kMystSoundActionStop) {
 			debugC(kDebugScript, "Stop sound");
-			_vm->_sound->stopBackground();
+			_vm->_sound->stopBackgroundMyst();
 		} else if (soundAction > 0) {
 			debugC(kDebugScript, "Play new Sound, change volume");
 			debugC(kDebugScript, "\tSound: %d", soundAction);
 			debugC(kDebugScript, "\tVolume: %d", soundVolume);
-			_vm->_sound->replaceBackground(soundAction, soundVolume);
+			_vm->_sound->replaceBackgroundMyst(soundAction, soundVolume);
 		} else {
 			debugC(kDebugScript, "Unknown");
 			warning("Unknown sound control value in opcode %d", op);
@@ -718,13 +718,13 @@
 		debugC(kDebugScript, "\tsoundId: %d", soundId);
 
 		if (soundId)
-			_vm->_sound->replaceSound(soundId);
+			_vm->_sound->replaceSoundMyst(soundId);
 	}
 }
 
 void MystScriptParser::o_soundResumeBackground(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	debugC(kDebugScript, "Opcode %d: soundResumeBackground", op);
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 }
 
 void MystScriptParser::o_copyImageToScreen(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -864,7 +864,7 @@
 	debugC(kDebugScript, "\tanimated update data size: %d", dataSize);
 
 	if (soundId)
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 
 	_vm->changeToCard(cardId, false);
 
@@ -883,7 +883,7 @@
 	debugC(kDebugScript, "\tanimated update data size: %d", dataSize);
 
 	if (soundId)
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 
 	animatedUpdate(dataSize, &argv[3], delayBetweenSteps);
 }

Modified: scummvm/trunk/engines/mohawk/myst_stacks/channelwood.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/channelwood.cpp	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/myst_stacks/channelwood.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -229,7 +229,7 @@
 		uint16 soundId = argv[0];
 		debugC(kDebugScript, "\tsoundId: %d", soundId);
 
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 
 		// TODO: Get Movie Location from Invoking Resource Rect, rather than
 		//       hardcoded 267, 170 ?
@@ -306,7 +306,7 @@
 	MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource);
 	uint16 soundId = handle->getList1(0);
 	if (soundId)
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 	_vm->_cursor->setCursor(700);
 
 	o_valveHandleMove1(op, var, argc, argv);
@@ -326,7 +326,7 @@
 	// Play release sound
 	uint16 soundId = handle->getList3(0);
 	if (soundId)
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 
 	// Redraw valve
 	_vm->redrawArea(_valveVar);
@@ -355,7 +355,7 @@
 	MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource);
 	uint16 soundId = handle->getList1(0);
 	if (soundId)
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 	_vm->_cursor->setCursor(700);
 
 	o_valveHandleMove2(op, var, argc, argv);
@@ -381,7 +381,7 @@
 	MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource);
 	uint16 soundId = handle->getList1(0);
 	if (soundId)
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 	_vm->_cursor->setCursor(700);
 
 	o_valveHandleMove3(op, var, argc, argv);

Modified: scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/myst_stacks/myst.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -818,9 +818,9 @@
 		_vm->_gfx->copyImageToScreen(_libraryBookBaseImage + _libraryBookPage, rect);
 
 		if (_vm->_rnd->getRandomBit())
-			_vm->_sound->replaceSound(_libraryBookSound1);
+			_vm->_sound->replaceSoundMyst(_libraryBookSound1);
 		else
-			_vm->_sound->replaceSound(_libraryBookSound2);
+			_vm->_sound->replaceSoundMyst(_libraryBookSound2);
 
 		_vm->_system->updateScreen();
 	}
@@ -836,9 +836,9 @@
 		_vm->_gfx->copyImageToScreen(_libraryBookBaseImage + _libraryBookPage, rect);
 
 		if (_vm->_rnd->getRandomBit())
-			_vm->_sound->replaceSound(_libraryBookSound1);
+			_vm->_sound->replaceSoundMyst(_libraryBookSound1);
 		else
-			_vm->_sound->replaceSound(_libraryBookSound2);
+			_vm->_sound->replaceSoundMyst(_libraryBookSound2);
 
 		_vm->_system->updateScreen();
 	}
@@ -917,7 +917,7 @@
 	towerRotationMapComputeAngle();
 	towerRotationMapDrawLine(center, end);
 
-	_vm->_sound->replaceSound(5378, Audio::Mixer::kMaxChannelVolume, true);
+	_vm->_sound->replaceSoundMyst(5378, Audio::Mixer::kMaxChannelVolume, true);
 }
 
 void MystScriptParser_Myst::o_towerRotationEnd(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -942,7 +942,7 @@
 		_state.towerRotationAngle = 152;
 	}
 
-	_vm->_sound->replaceSound(6378);
+	_vm->_sound->replaceSoundMyst(6378);
 
 	_towerRotationBlinkLabel = true;
 	_towerRotationBlinkLabelCount = 0;
@@ -997,7 +997,7 @@
 		else
 			_dockVaultState = 1;
 
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 		_vm->redrawArea(41, false);
 		animatedUpdate(directionalUpdateDataSize, &argv[3], delay);
 	}
@@ -1024,7 +1024,7 @@
 		if (_dockVaultState == 1 || _dockVaultState == 2)
 			_dockVaultState = 0;
 
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 		_vm->redrawArea(41, false);
 		animatedUpdate(directionalUpdateDataSize, &argv[3], delay);
 	}
@@ -1128,7 +1128,7 @@
 						&& _state.clockTowerMinutePosition == 40;
 
 	if (!_state.clockTowerBridgeOpen && correctTime) {
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 		_vm->_system->delayMillis(500);
 
 		// Gears rise up
@@ -1140,7 +1140,7 @@
 		_state.clockTowerBridgeOpen = 1;
 		_vm->redrawArea(12);
 	} else if (_state.clockTowerBridgeOpen && !correctTime) {
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 		_vm->_system->delayMillis(500);
 
 		// Gears sink down
@@ -1159,7 +1159,7 @@
 	uint16 video = getVar(51);
 
 	// Press button
-	_vm->_sound->replaceSound(4698);
+	_vm->_sound->replaceSoundMyst(4698);
 
 	Common::Rect src = Common::Rect(0, 0, 32, 75);
 	Common::Rect dest = Common::Rect(261, 257, 293, 332);
@@ -1176,7 +1176,7 @@
 
 	// Play selected video
 	if (!_state.imagerActive && video != 3)
-		_vm->_sound->replaceSound(argv[0]);
+		_vm->_sound->replaceSoundMyst(argv[0]);
 
 	switch (video) {
 	case 0: // Nothing
@@ -1205,7 +1205,7 @@
 		_imagerMovie->setBlocking(false);
 
 		if (_state.imagerActive) {
-			_vm->_sound->replaceSound(argv[1]);
+			_vm->_sound->replaceSoundMyst(argv[1]);
 
 			// Water disappearing
 			VideoHandle water = _imagerMovie->playMovie();
@@ -1286,11 +1286,11 @@
 		_imagerRedButton->drawConditionalDataToScreen(1);
 
 		if (_imagerValidationStep < 6)
-			_vm->_sound->replaceSound(_imagerSound[0]);
+			_vm->_sound->replaceSoundMyst(_imagerSound[0]);
 		else if (_imagerValidationStep < 10)
-			_vm->_sound->replaceSound(_imagerSound[1]);
+			_vm->_sound->replaceSoundMyst(_imagerSound[1]);
 		else if (_imagerValidationStep == 10)
-			_vm->_sound->replaceSound(_imagerSound[2]);
+			_vm->_sound->replaceSoundMyst(_imagerSound[2]);
 
 		_imagerValidationStep++;
 
@@ -1314,7 +1314,7 @@
 
 	_vm->_cursor->hideCursor();
 	_vm->_sound->stopSound();
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	switch (argv[0]) {
 	case 0:
@@ -1327,7 +1327,7 @@
 		break;
 	}
 
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 	_vm->_cursor->showCursor();
 	_treeStopped = false;
 }
@@ -1351,15 +1351,15 @@
 		_state.generatorVoltage -= value;
 
 		if (_state.generatorVoltage)
-			_vm->_sound->replaceSound(8297);
+			_vm->_sound->replaceSoundMyst(8297);
 		else
-			_vm->_sound->replaceSound(9297);
+			_vm->_sound->replaceSoundMyst(9297);
 	} else {
 		if (_generatorVoltage)
-			_vm->_sound->replaceSound(6297);
+			_vm->_sound->replaceSoundMyst(6297);
 		else {
-			_vm->_sound->replaceSound(7297); //TODO: Replace with play sound and replace background 4297
-			_vm->_sound->replaceBackground(4297);
+			_vm->_sound->replaceSoundMyst(7297); // TODO: Replace with play sound and replace background 4297
+			_vm->_sound->replaceBackgroundMyst(4297);
 		}
 
 		_state.generatorButtons |= mask;
@@ -1473,13 +1473,13 @@
 		if (_tempVar == 0) {
 			uint16 soundId = handle->getList2(0);
 			if (soundId)
-				_vm->_sound->replaceSound(soundId);
+				_vm->_sound->replaceSoundMyst(soundId);
 		}
 		// Combination is right
 		if (_state.cabinSafeCombination == 724) {
 			uint16 soundId = handle->getList2(1);
 			if (soundId)
-				_vm->_sound->replaceSound(soundId);
+				_vm->_sound->replaceSoundMyst(soundId);
 
 			_vm->changeToCard(4103, false);
 
@@ -1504,7 +1504,7 @@
 void MystScriptParser_Myst::o_observatoryMonthChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	debugC(kDebugScript, "Opcode %d: Observatory month change start", op);
 
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	if (op == 129 || op == 131) {
 		// Increase
@@ -1552,7 +1552,7 @@
 		_state.observatoryMonthSlider = _observatoryMonthSlider->_pos.y;
 	}
 
-	_vm->_sound->replaceSound(8500);
+	_vm->_sound->replaceSoundMyst(8500);
 }
 
 void MystScriptParser_Myst::observatoryMonthChange_run() {
@@ -1563,7 +1563,7 @@
 void MystScriptParser_Myst::o_observatoryDayChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	debugC(kDebugScript, "Opcode %d: Observatory day change start", op);
 
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	if (op == 129 || op == 131) {
 		// Increase
@@ -1612,7 +1612,7 @@
 		_state.observatoryDaySlider = _observatoryDaySlider->_pos.y;
 	}
 
-	_vm->_sound->replaceSound(8500);
+	_vm->_sound->replaceSoundMyst(8500);
 }
 
 void MystScriptParser_Myst::observatoryDayChange_run() {
@@ -1623,7 +1623,7 @@
 void MystScriptParser_Myst::o_observatoryYearChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	debugC(kDebugScript, "Opcode %d: Observatory year change start", op);
 
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	if (op == 196) {
 		// Increase
@@ -1666,7 +1666,7 @@
 		_state.observatoryYearSlider = _observatoryYearSlider->_pos.y;
 	}
 
-	_vm->_sound->replaceSound(8500);
+	_vm->_sound->replaceSoundMyst(8500);
 }
 
 void MystScriptParser_Myst::observatoryYearChange_run() {
@@ -1677,7 +1677,7 @@
 void MystScriptParser_Myst::o_observatoryTimeChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	debugC(kDebugScript, "Opcode %d: Observatory time change start", op);
 
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	if (op == 192) {
 		// Increase
@@ -1725,7 +1725,7 @@
 		_state.observatoryTimeSlider = _observatoryTimeSlider->_pos.y;
 	}
 
-	_vm->_sound->replaceSound(8500);
+	_vm->_sound->replaceSoundMyst(8500);
 }
 
 void MystScriptParser_Myst::observatoryTimeChange_run() {
@@ -1742,7 +1742,7 @@
 			|| _state.observatoryYearTarget != _state.observatoryYearSetting
 			|| _state.observatoryTimeTarget != _state.observatoryTimeSetting) {
 		uint16 soundId = argv[0];
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 
 		int16 distance = _state.observatoryYearTarget - _state.observatoryYearSetting;
 		uint32 end = _vm->_system->getMillis() + 32 * ABS(distance) / 50 + 800;
@@ -1755,7 +1755,7 @@
 			_vm->redrawResource(_observatoryVisualizer);
 		}
 
-		_vm->_sound->resumeBackground();
+		_vm->_sound->resumeBackgroundMyst();
 
 		// Redraw visualizer
 		observatorySetTargetToSetting();
@@ -1822,11 +1822,11 @@
 				if (_state.generatorVoltage > 59 || _state.generatorBreakers != 1) {
 					uint16 soundId = breaker->getList2(1);
 					if (soundId)
-						_vm->_sound->replaceSound(soundId);
+						_vm->_sound->replaceSoundMyst(soundId);
 				} else {
 					uint16 soundId = breaker->getList2(0);
 					if (soundId)
-						_vm->_sound->replaceSound(soundId);
+						_vm->_sound->replaceSoundMyst(soundId);
 
 					// Reset breaker state
 					_state.generatorBreakers = 0;
@@ -1836,11 +1836,11 @@
 				if (_state.generatorVoltage > 59 || _state.generatorBreakers != 2) {
 					uint16 soundId = breaker->getList2(1);
 					if (soundId)
-						_vm->_sound->replaceSound(soundId);
+						_vm->_sound->replaceSoundMyst(soundId);
 				} else {
 					uint16 soundId = breaker->getList2(0);
 					if (soundId)
-						_vm->_sound->replaceSound(soundId);
+						_vm->_sound->replaceSoundMyst(soundId);
 
 					// Reset breaker state
 					_state.generatorBreakers = 0;
@@ -1863,7 +1863,7 @@
 
 	_treeStopped = true;
 	if (_state.cabinValvePosition < 25)
-		_vm->_sound->stopBackground();
+		_vm->_sound->stopBackgroundMyst();
 
 	_boilerPressureIncreasing = true;
 }
@@ -1880,7 +1880,7 @@
 		_matchGoOutTime = _vm->_system->getMillis();
 
 		if (_state.cabinValvePosition > 0)
-			_vm->_sound->replaceBackground(8098, 49152);
+			_vm->_sound->replaceBackgroundMyst(8098, 49152);
 
 		if (_state.cabinValvePosition > 12)
 			_state.treeLastMoveTime = _vm->_system->getMillis();
@@ -1898,11 +1898,11 @@
 
 	if (_state.cabinPilotLightLit == 1) {
 		if (_state.cabinValvePosition > 0)
-			_vm->_sound->replaceBackground(8098, 49152);
+			_vm->_sound->replaceBackgroundMyst(8098, 49152);
 
 		// TODO: Play movies
 	} else if (_state.cabinValvePosition > 0)
-		_vm->_sound->replaceBackground(4098, _state.cabinValvePosition << 10);
+		_vm->_sound->replaceBackgroundMyst(4098, _state.cabinValvePosition << 10);
 }
 
 void MystScriptParser_Myst::boilerPressureIncrease_run() {
@@ -1916,13 +1916,13 @@
 			_vm->redrawArea(305);
 		} else if (_state.cabinValvePosition == 25) {
 			if (_state.cabinPilotLightLit == 1)
-				_vm->_sound->replaceBackground(8098, 49152);
+				_vm->_sound->replaceBackgroundMyst(8098, 49152);
 			else
-				_vm->_sound->replaceBackground(4098, 25600);
+				_vm->_sound->replaceBackgroundMyst(4098, 25600);
 		}
 
 		// Pressure increasing sound
-		_vm->_sound->replaceSound(5098);
+		_vm->_sound->replaceSoundMyst(5098);
 
 		// Redraw wheel
 		_vm->redrawArea(99);
@@ -1941,7 +1941,7 @@
 		}
 
 		// Pressure increasing sound
-		_vm->_sound->replaceSound(5098);
+		_vm->_sound->replaceSoundMyst(5098);
 
 		// Redraw wheel
 		_vm->redrawArea(99);
@@ -1952,7 +1952,7 @@
 	debugC(kDebugScript, "Opcode %d: Boiler decrease pressure start", op);
 
 	_treeStopped = true;
-	_vm->_sound->stopBackground();
+	_vm->_sound->stopBackgroundMyst();
 
 	_boilerPressureDecreasing = true;
 }
@@ -1966,12 +1966,12 @@
 
 	if (_state.cabinPilotLightLit == 1) {
 		if (_state.cabinValvePosition > 0)
-			_vm->_sound->replaceBackground(8098, 49152);
+			_vm->_sound->replaceBackgroundMyst(8098, 49152);
 
 		// TODO: Play movies
 	} else {
 		if (_state.cabinValvePosition > 0)
-			_vm->_sound->replaceBackground(4098, _state.cabinValvePosition << 10);
+			_vm->_sound->replaceBackgroundMyst(4098, _state.cabinValvePosition << 10);
 	}
 }
 
@@ -1996,7 +1996,7 @@
 		_state.cabinValvePosition++;
 
 		// Pressure increasing sound
-		_vm->_sound->replaceSound(4642);
+		_vm->_sound->replaceSoundMyst(4642);
 
 		// Redraw wheel
 		_vm->redrawArea(99);
@@ -2009,7 +2009,7 @@
 		_state.cabinValvePosition--;
 
 		// Pressure decreasing sound
-		_vm->_sound->replaceSound(4642);
+		_vm->_sound->replaceSoundMyst(4642);
 
 		// Redraw wheel
 		_vm->redrawArea(99);
@@ -2054,18 +2054,18 @@
 				// Tree movement
 				if (goingDown) {
 					_state.treePosition--;
-					_vm->_sound->replaceSound(2);
+					_vm->_sound->replaceSoundMyst(2);
 				} else {
 					_state.treePosition++;
-					_vm->_sound->replaceSound(1);
+					_vm->_sound->replaceSoundMyst(1);
 				}
 
 				// Stop background music if going up from book room
 				if (_vm->getCurCard() == 4630) {
 					if (_state.treePosition > 0)
-						_vm->_sound->stopBackground();
+						_vm->_sound->stopBackgroundMyst();
 					else
-						_vm->_sound->replaceBackground(4630, 24576);
+						_vm->_sound->replaceBackgroundMyst(4630, 24576);
 				}
 
 				// Redraw tree
@@ -2100,7 +2100,7 @@
 
 	_rocketSliderSound = 0;
 	_vm->_cursor->setCursor(700);
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 	rocketSliderMove();
 }
 
@@ -2129,7 +2129,7 @@
 	else if (_invokingResource == _rocketSlider5)
 		_state.rocketSliderPosition[4] = _rocketSlider5->_pos.y;
 
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 }
 
 void MystScriptParser_Myst::rocketSliderMove() {
@@ -2139,7 +2139,7 @@
 		uint16 soundId = rocketSliderGetSound(slider->_pos.y);
 		if (soundId != _rocketSliderSound) {
 			_rocketSliderSound = soundId;
-			_vm->_sound->replaceSound(soundId, Audio::Mixer::kMaxChannelVolume, true);
+			_vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
 		}
 	}
 }
@@ -2155,35 +2155,35 @@
 	bool solved = true;
 
 	soundId = rocketSliderGetSound(_rocketSlider1->_pos.y);
-	_vm->_sound->replaceSound(soundId);
+	_vm->_sound->replaceSoundMyst(soundId);
 	_rocketSlider1->drawConditionalDataToScreen(2);
 	_vm->_system->delayMillis(250);
 	if (soundId != 9558)
 		solved = false;
 
 	soundId = rocketSliderGetSound(_rocketSlider2->_pos.y);
-	_vm->_sound->replaceSound(soundId);
+	_vm->_sound->replaceSoundMyst(soundId);
 	_rocketSlider2->drawConditionalDataToScreen(2);
 	_vm->_system->delayMillis(250);
 	if (soundId != 9546)
 		solved = false;
 
 	soundId = rocketSliderGetSound(_rocketSlider3->_pos.y);
-	_vm->_sound->replaceSound(soundId);
+	_vm->_sound->replaceSoundMyst(soundId);
 	_rocketSlider3->drawConditionalDataToScreen(2);
 	_vm->_system->delayMillis(250);
 	if (soundId != 9543)
 		solved = false;
 
 	soundId = rocketSliderGetSound(_rocketSlider4->_pos.y);
-	_vm->_sound->replaceSound(soundId);
+	_vm->_sound->replaceSoundMyst(soundId);
 	_rocketSlider4->drawConditionalDataToScreen(2);
 	_vm->_system->delayMillis(250);
 	if (soundId != 9553)
 		solved = false;
 
 	soundId = rocketSliderGetSound(_rocketSlider5->_pos.y);
-	_vm->_sound->replaceSound(soundId);
+	_vm->_sound->replaceSoundMyst(soundId);
 	_rocketSlider5->drawConditionalDataToScreen(2);
 	_vm->_system->delayMillis(250);
 	if (soundId != 9560)
@@ -2237,7 +2237,7 @@
 	// Play note
 	if (_state.generatorVoltage == 59 && !_state.generatorBreakers) {
 		uint16 soundId = key->getList1(0);
-		_vm->_sound->replaceSound(soundId, Audio::Mixer::kMaxChannelVolume, true);
+		_vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
 	}
 }
 
@@ -2275,12 +2275,12 @@
 			// Play note
 			if (_state.generatorVoltage == 59 && !_state.generatorBreakers) {
 				uint16 soundId = key->getList1(0);
-				_vm->_sound->replaceSound(soundId, Audio::Mixer::kMaxChannelVolume, true);
+				_vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
 			}
 		} else {
 			// Not pressing a key anymore
 			_vm->_sound->stopSound();
-			_vm->_sound->resumeBackground();
+			_vm->_sound->resumeBackgroundMyst();
 		}
 	}
 
@@ -2302,7 +2302,7 @@
 	_vm->_system->updateScreen();
 
 	_vm->_sound->stopSound();
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 }
 
 void MystScriptParser_Myst::o_rocketLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -2343,7 +2343,7 @@
 		uint16 soundId = lever->getList2(0);
 
 		if (soundId)
-			_vm->_sound->replaceSound(soundId);
+			_vm->_sound->replaceSoundMyst(soundId);
 
 		// If rocket correctly powered
 		if (_state.generatorVoltage == 59 && !_state.generatorBreakers)
@@ -2407,7 +2407,7 @@
 	debugC(kDebugScript, "Opcode %d: Month slider start move", op);
 
 	_vm->_cursor->setCursor(700);
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	observatoryUpdateMonth();
 }
@@ -2416,7 +2416,7 @@
 	debugC(kDebugScript, "Opcode %d: Month slider end move", op);
 
 	_vm->checkCursorHints();
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 
 	observatoryUpdateMonth();
 }
@@ -2427,7 +2427,7 @@
 	if (month != _state.observatoryMonthSetting) {
 		_state.observatoryMonthSetting = month;
 		_state.observatoryMonthSlider = _observatoryMonthSlider->_pos.y;
-		_vm->_sound->replaceSound(8500);
+		_vm->_sound->replaceSoundMyst(8500);
 
 		// Redraw digits
 		_vm->redrawArea(73);
@@ -2438,7 +2438,7 @@
 	debugC(kDebugScript, "Opcode %d: Day slider start move", op);
 
 	_vm->_cursor->setCursor(700);
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	observatoryUpdateDay();
 }
@@ -2447,7 +2447,7 @@
 	debugC(kDebugScript, "Opcode %d: Day slider end move", op);
 
 	_vm->checkCursorHints();
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 
 	observatoryUpdateDay();
 }
@@ -2458,7 +2458,7 @@
 	if (day != _state.observatoryDaySetting) {
 		_state.observatoryDaySetting = day;
 		_state.observatoryDaySlider = _observatoryDaySlider->_pos.y;
-		_vm->_sound->replaceSound(8500);
+		_vm->_sound->replaceSoundMyst(8500);
 
 		// Redraw digits
 		_vm->redrawArea(75);
@@ -2470,7 +2470,7 @@
 	debugC(kDebugScript, "Opcode %d: Year slider start move", op);
 
 	_vm->_cursor->setCursor(700);
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	observatoryUpdateYear();
 }
@@ -2479,7 +2479,7 @@
 	debugC(kDebugScript, "Opcode %d: Year slider end move", op);
 
 	_vm->checkCursorHints();
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 
 	observatoryUpdateYear();
 }
@@ -2490,7 +2490,7 @@
 	if (year != _state.observatoryYearSetting) {
 		_state.observatoryYearSetting = year;
 		_state.observatoryYearSlider = _observatoryYearSlider->_pos.y;
-		_vm->_sound->replaceSound(8500);
+		_vm->_sound->replaceSoundMyst(8500);
 
 		// Redraw digits
 		_vm->redrawArea(79);
@@ -2504,7 +2504,7 @@
 	debugC(kDebugScript, "Opcode %d: Time slider start move", op);
 
 	_vm->_cursor->setCursor(700);
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	observatoryUpdateTime();
 }
@@ -2513,7 +2513,7 @@
 	debugC(kDebugScript, "Opcode %d: Time slider end move", op);
 
 	_vm->checkCursorHints();
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 
 	observatoryUpdateTime();
 }
@@ -2524,7 +2524,7 @@
 	if (time != _state.observatoryTimeSetting) {
 		_state.observatoryTimeSetting = time;
 		_state.observatoryTimeSlider = _observatoryTimeSlider->_pos.y;
-		_vm->_sound->replaceSound(8500);
+		_vm->_sound->replaceSoundMyst(8500);
 
 		// Redraw digits
 		_vm->redrawArea(80);
@@ -2545,7 +2545,7 @@
 
 void MystScriptParser_Myst::o_cabinMatchLight(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
 	if (!_cabinMatchState) {
-		_vm->_sound->replaceSound(4103);
+		_vm->_sound->replaceSoundMyst(4103);
 
 		// Match is lit
 		_cabinMatchState = 1;
@@ -2637,7 +2637,7 @@
 	uint16 soundId = resource->getList1(0);
 
 	if (soundId)
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 
 	// Turn wheel one step
 	if (wheel == 1)
@@ -2698,9 +2698,9 @@
 		_vm->_gfx->copyImageToScreen(_libraryBookBaseImage + _libraryBookPage, rect);
 
 		if (_vm->_rnd->getRandomBit())
-			_vm->_sound->replaceSound(_libraryBookSound1);
+			_vm->_sound->replaceSoundMyst(_libraryBookSound1);
 		else
-			_vm->_sound->replaceSound(_libraryBookSound2);
+			_vm->_sound->replaceSoundMyst(_libraryBookSound2);
 
 		_vm->_system->updateScreen();
 	}
@@ -2724,9 +2724,9 @@
 		_vm->_gfx->copyImageToScreen(_libraryBookBaseImage + _libraryBookPage, rect);
 
 		if (_vm->_rnd->getRandomBit())
-			_vm->_sound->replaceSound(_libraryBookSound1);
+			_vm->_sound->replaceSoundMyst(_libraryBookSound1);
 		else
-			_vm->_sound->replaceSound(_libraryBookSound2);
+			_vm->_sound->replaceSoundMyst(_libraryBookSound2);
 
 		_vm->_system->updateScreen();
 	}
@@ -2761,7 +2761,7 @@
 		_vm->redrawResource(_observatoryCurrentSlider);
 		_observatoryCurrentSlider = 0;
 	}
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 }
 
 void MystScriptParser_Myst::o_dockVaultForceClose(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -2777,12 +2777,12 @@
 	if (_dockVaultState) {
 		// Open switch
 		_state.dockMarkerSwitch = 1;
-		_vm->_sound->replaceSound(4143);
+		_vm->_sound->replaceSoundMyst(4143);
 		_vm->redrawArea(4);
 
 		// Close vault
 		_dockVaultState = 0;
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 		_vm->redrawArea(41, false);
 		animatedUpdate(directionalUpdateDataSize, &argv[3], delay);
 	}
@@ -2819,7 +2819,7 @@
 		if (step == maxStep) {
 			// Start videos for first step
 			if (_clockWeightPosition < 2214) {
-				_vm->_sound->replaceSound(5113);
+				_vm->_sound->replaceSoundMyst(5113);
 				clockGearForwardOneStep(1);
 
 				// Left lever
@@ -2867,7 +2867,7 @@
 void MystScriptParser_Myst::clockGears_run() {
 	if (!_vm->_video->isVideoPlaying() && _clockWeightPosition < 2214) {
 		_clockMiddleGearMovedAlone = true;
-		_vm->_sound->replaceSound(5113);
+		_vm->_sound->replaceSoundMyst(5113);
 		clockGearForwardOneStep(1);
 		clockWeightDownOneStep();
 	}
@@ -2888,7 +2888,7 @@
 	}
 
 	if (_clockMiddleGearMovedAlone)
-		_vm->_sound->replaceSound(8113);
+		_vm->_sound->replaceSoundMyst(8113);
 
 	// Get current lever frame
 	MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
@@ -2916,7 +2916,7 @@
 			&& !_state.gearsOpen) {
 
 		// Make weight go down
-		_vm->_sound->replaceSound(9113);
+		_vm->_sound->replaceSoundMyst(9113);
 		_clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack) , 124, 0);
 		_vm->_video->setVideoBounds(_clockWeightVideo,
 				Graphics::VideoTimestamp(_clockWeightPosition, 600),
@@ -2924,16 +2924,16 @@
 		_vm->_video->waitUntilMovieEnds(_clockWeightVideo);
 		_clockWeightPosition = 2214;
 
-		_vm->_sound->replaceSound(6113);
+		_vm->_sound->replaceSoundMyst(6113);
 		_vm->_system->delayMillis(1000);
-		_vm->_sound->replaceSound(7113);
+		_vm->_sound->replaceSoundMyst(7113);
 
 		// Gear opening video
 		_vm->_video->playMovieBlocking(_vm->wrapMovieFilename("cl1wggat", kMystStack) , 195, 225);
 		_state.gearsOpen = 1;
 		_vm->redrawArea(40);
 
-		_vm->_sound->replaceBackground(4113, 16384);
+		_vm->_sound->replaceBackgroundMyst(4113, 16384);
 	}
 }
 
@@ -2967,8 +2967,8 @@
 
 	_vm->_cursor->hideCursor();
 
-	_vm->_sound->stopBackground();
-	_vm->_sound->replaceSound(5113);
+	_vm->_sound->stopBackgroundMyst();
+	_vm->_sound->replaceSoundMyst(5113);
 
 	// Play reset videos
 	clockResetWeight();
@@ -2983,13 +2983,13 @@
 			_vm->_video->delayUntilMovieEnds(handle);
 	}
 
-	_vm->_sound->replaceSound(10113);
+	_vm->_sound->replaceSoundMyst(10113);
 
 	// Close gear
 	if (_state.gearsOpen) {
-		_vm->_sound->replaceSound(6113);
+		_vm->_sound->replaceSoundMyst(6113);
 		_vm->_system->delayMillis(1000);
-		_vm->_sound->replaceSound(7113);
+		_vm->_sound->replaceSoundMyst(7113);
 
 		// TODO: Play cl1wggat backwards
 		// Redraw gear
@@ -3071,7 +3071,7 @@
 void MystScriptParser_Myst::towerRotationMap_run() {
 	if (!_towerRotationMapInitialized) {
 		_towerRotationMapInitialized = true;
-		_vm->_sound->replaceSound(4378);
+		_vm->_sound->replaceSoundMyst(4378);
 
 		towerRotationDrawBuildings();
 
@@ -3268,7 +3268,7 @@
 		_libraryBookcaseMoving = false;
 
 		// Play transform sound and video
-		_vm->_sound->replaceSound(_libraryBookcaseSoundId);
+		_vm->_sound->replaceSoundMyst(_libraryBookcaseSoundId);
 		_libraryBookcaseMovie->playMovie();
 	}
 }
@@ -3434,33 +3434,33 @@
 
 		// Make sliders "initialize"
 		if (observatoryIsDDMMYYYY2400()) {
-			_vm->_sound->replaceSound(8500);
+			_vm->_sound->replaceSoundMyst(8500);
 			_observatoryDaySlider->drawConditionalDataToScreen(2);
 			_vm->_system->delayMillis(200);
 			_vm->redrawResource(_observatoryDaySlider);
 
-			_vm->_sound->replaceSound(8500);
+			_vm->_sound->replaceSoundMyst(8500);
 			_observatoryMonthSlider->drawConditionalDataToScreen(2);
 			_vm->_system->delayMillis(200);
 			_vm->redrawResource(_observatoryMonthSlider);
 		} else {
-			_vm->_sound->replaceSound(8500);
+			_vm->_sound->replaceSoundMyst(8500);
 			_observatoryMonthSlider->drawConditionalDataToScreen(2);
 			_vm->_system->delayMillis(200);
 			_vm->redrawResource(_observatoryMonthSlider);
 
-			_vm->_sound->replaceSound(8500);
+			_vm->_sound->replaceSoundMyst(8500);
 			_observatoryDaySlider->drawConditionalDataToScreen(2);
 			_vm->_system->delayMillis(200);
 			_vm->redrawResource(_observatoryDaySlider);
 		}
 
-		_vm->_sound->replaceSound(8500);
+		_vm->_sound->replaceSoundMyst(8500);
 		_observatoryYearSlider->drawConditionalDataToScreen(2);
 		_vm->_system->delayMillis(200);
 		_vm->redrawResource(_observatoryYearSlider);
 
-		_vm->_sound->replaceSound(8500);
+		_vm->_sound->replaceSoundMyst(8500);
 		_observatoryTimeSlider->drawConditionalDataToScreen(2);
 		_vm->_system->delayMillis(200);
 		_vm->redrawResource(_observatoryTimeSlider);
@@ -3592,7 +3592,7 @@
 
 	if (_tempVar == 1) {
 		_vm->_sound->stopSound();
-		_vm->_sound->pauseBackground();
+		_vm->_sound->pauseBackgroundMyst();
 
 		if (_globals.ending != 4) {
 			_tempVar = 2;

Modified: scummvm/trunk/engines/mohawk/myst_stacks/preview.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/preview.cpp	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/myst_stacks/preview.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -108,7 +108,7 @@
 	// Used for Card 3000 (Closed Myst Book)
 	// TODO: Fill in logic.
 	// Start Voice Over... which controls book opening
-	_vm->_sound->replaceSound(3001);
+	_vm->_sound->replaceSoundMyst(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	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/myst_stacks/selenitic.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -559,7 +559,7 @@
 		soundId =  2191;
 
 	if (soundId)
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 
 	_mazeRunnerLight->drawConditionalDataToScreen(0);
 }
@@ -601,17 +601,17 @@
 		}
 
 		_soundReceiverPosition = &_state.soundReceiverPositions[source];
-		_vm->_sound->stopBackground();
-		_vm->_sound->replaceSound(2287);
+		_vm->_sound->stopBackgroundMyst();
+		_vm->_sound->replaceSoundMyst(2287);
 		soundReceiverDrawView();
 		uint16 soundId = soundReceiverCurrentSound(source, *_soundReceiverPosition);
-		_vm->_sound->replaceBackground(soundId);
+		_vm->_sound->replaceBackgroundMyst(soundId);
 		_vm->_system->delayMillis(1000);
 	}
 
 	_soundReceiverPosition = oldPosition;
 	_soundReceiverSigmaPressed = true;
-	_vm->_sound->stopBackground();
+	_vm->_sound->stopBackgroundMyst();
 
 	_soundReceiverSources[_state.soundReceiverCurrentSource]->drawConditionalDataToScreen(1);
 
@@ -712,8 +712,8 @@
 		_vm->_sound->stopSound();
 
 		uint16 soundId = argv[0];
-		_vm->_sound->stopBackground();
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->stopBackgroundMyst();
+		_vm->_sound->replaceSoundMyst(soundId);
 
 		_soundReceiverCurrentSource->drawConditionalDataToScreen(1);
 
@@ -730,11 +730,11 @@
 
 	if (_mazeRunnerPosition == 288) {
 		_vm->changeToCard(cardIdEntry, false);
-		_vm->_sound->replaceSound(cardIdEntry);
+		_vm->_sound->replaceSoundMyst(cardIdEntry);
 		animatedUpdate(argv[2], &argv[3], 10);
 	} else if (_mazeRunnerPosition == 289) {
 		_vm->changeToCard(cardIdExit, false);
-		_vm->_sound->replaceSound(cardIdExit);
+		_vm->_sound->replaceSoundMyst(cardIdExit);
 		animatedUpdate(argv[2], &argv[3], 10);
 	}
 }
@@ -795,7 +795,7 @@
 	uint16 soundId = soundLockCurrentSound(slider->_pos.y, true);
 	if (_soundLockSoundId != soundId) {
 		_soundLockSoundId = soundId;
-		_vm->_sound->replaceSound(soundId, Audio::Mixer::kMaxChannelVolume, true);
+		_vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true);
 	}
 }
 
@@ -805,10 +805,10 @@
 	MystResourceType10 *slider = soundLockSliderFromVar(var);
 
 	_vm->_cursor->setCursor(700);
-	_vm->_sound->pauseBackground();
+	_vm->_sound->pauseBackgroundMyst();
 
 	_soundLockSoundId = soundLockCurrentSound(slider->_pos.y, true);
-	_vm->_sound->replaceSound(_soundLockSoundId, Audio::Mixer::kMaxChannelVolume, true);
+	_vm->_sound->replaceSoundMyst(_soundLockSoundId, Audio::Mixer::kMaxChannelVolume, true);
 }
 
 void MystScriptParser_Selenitic::o_soundLockEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -850,14 +850,14 @@
 
 	uint16 soundId = slider->getList3(0);
 	if (soundId)
-		_vm->_sound->replaceSound(soundId);
+		_vm->_sound->replaceSoundMyst(soundId);
 
-	_vm->_sound->resumeBackground();
+	_vm->_sound->resumeBackgroundMyst();
 }
 
 void MystScriptParser_Selenitic::soundLockCheckSolution(MystResourceType10 *slider, uint16 value, uint16 solution, bool &solved) {
 	slider->drawConditionalDataToScreen(2);
-	_vm->_sound->replaceSound(soundLockCurrentSound(value / 12, false));
+	_vm->_sound->replaceSoundMyst(soundLockCurrentSound(value / 12, false));
 	_vm->_system->delayMillis(1500);
 
 	if (value / 12 != solution)
@@ -872,8 +872,8 @@
 
 	bool solved = true;
 
-	_vm->_sound->pauseBackground();
-	_vm->_sound->replaceSound(1147);
+	_vm->_sound->pauseBackgroundMyst();
+	_vm->_sound->replaceSoundMyst(1147);
 	_soundLockButton->drawConditionalDataToScreen(1);
 	_vm->_cursor->hideCursor();
 
@@ -883,8 +883,8 @@
 	soundLockCheckSolution(_soundLockSlider4, _state.soundLockSliderPositions[3], 6, solved);
 	soundLockCheckSolution(_soundLockSlider5, _state.soundLockSliderPositions[4], 7, solved);
 
-	_vm->_sound->replaceSound(1148);
-	_vm->_sound->resumeBackground();
+	_vm->_sound->replaceSoundMyst(1148);
+	_vm->_sound->resumeBackgroundMyst();
 
 	if (solved) {
 		_soundLockButton->drawConditionalDataToScreen(2);
@@ -895,7 +895,7 @@
 		_vm->changeToCard(cardIdClosed, true);
 
 		_vm->changeToCard(cardIdOpen, false);
-		_vm->_sound->replaceSound(argv[2]);
+		_vm->_sound->replaceSoundMyst(argv[2]);
 
 		animatedUpdate(argv[4], &argv[5], argv[3]);
 	} else {
@@ -968,7 +968,7 @@
 
 void MystScriptParser_Selenitic::soundReceiverUpdateSound() {
 	uint16 soundId = soundReceiverCurrentSound(_state.soundReceiverCurrentSource, *_soundReceiverPosition);
-	_vm->_sound->replaceSound(soundId);
+	_vm->_sound->replaceSoundMyst(soundId);
 }
 
 uint16 MystScriptParser_Selenitic::soundReceiverCurrentSound(uint16 source, uint16 position) {

Modified: scummvm/trunk/engines/mohawk/myst_stacks/stoneship.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/stoneship.cpp	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/myst_stacks/stoneship.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -632,8 +632,8 @@
 
 		// TODO: Work Out Function i.e. control Var etc.
 		if (false) {
-			_vm->_sound->replaceSound(soundId);
-			_vm->_sound->replaceSound(soundIdStopping);
+			_vm->_sound->replaceSoundMyst(soundId);
+			_vm->_sound->replaceSoundMyst(soundIdStopping);
 		}
 	} else
 		unknown(op, var, argc, argv);

Modified: scummvm/trunk/engines/mohawk/sound.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/sound.cpp	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/sound.cpp	2011-01-18 21:10:58 UTC (rev 55314)
@@ -79,20 +79,9 @@
 
 	switch (_vm->getGameType()) {
 	case GType_MYST:
-		if (_vm->getFeatures() & GF_ME) {
-			// Myst ME is a bit more efficient with sound storage than Myst
-			// Myst has lots of sounds repeated. To overcome this, Myst ME
-			// has MJMP resources which provide a link to the actual MSND
-			// resource we're looking for. This saves a lot of space from
-			// repeated data.
-			if (_vm->hasResource(ID_MJMP, id)) {
-				Common::SeekableReadStream *mjmpStream = _vm->getResource(ID_MJMP, id);
-				id = mjmpStream->readUint16LE();
-				delete mjmpStream;
-			}
-
-			audStream = Audio::makeWAVStream(_vm->getResource(ID_MSND, id), DisposeAfterUse::YES);
-		} else
+		if (_vm->getFeatures() & GF_ME)
+			audStream = Audio::makeWAVStream(_vm->getResource(ID_MSND, convertMystID(id)), DisposeAfterUse::YES);
+		else
 			audStream = makeMohawkWaveStream(_vm->getResource(ID_MSND, id));
 		break;
 	case GType_ZOOMBINI:
@@ -129,18 +118,18 @@
 	return NULL;
 }
 
-Audio::SoundHandle *Sound::replaceSound(uint16 id, byte volume, bool loop) {
+Audio::SoundHandle *Sound::replaceSoundMyst(uint16 id, byte volume, bool loop) {
 	debug (0, "Replacing sound %d", id);
 
-	//TODO: The original engine does fading
+	// TODO: The original engine does fading
 
-	Common::String name = getName(id);
+	Common::String name = _vm->getResourceName(ID_MSND, convertMystID(id));
 
 	// Check if sound is already playing
 	for (uint32 i = 0; i < _handles.size(); i++)
 		if (_handles[i].type == kUsedHandle
 				&& _vm->_mixer->isSoundHandleActive(_handles[i].handle)
-				&& name.equals(getName(_handles[i].id)))
+				&& name.equals(_vm->getResourceName(ID_MSND, convertMystID(_handles[i].id))))
 			return &_handles[i].handle;
 
 	stopSound();
@@ -560,22 +549,37 @@
 	return false;
 }
 
-Audio::SoundHandle *Sound::replaceBackground(uint16 id, uint16 volume) {
+uint16 Sound::convertMystID(uint16 id) {
+	// Myst ME is a bit more efficient with sound storage than Myst
+	// Myst has lots of sounds repeated. To overcome this, Myst ME
+	// has MJMP resources which provide a link to the actual MSND
+	// resource we're looking for. This saves a lot of space from
+	// repeated data.
+	if (_vm->hasResource(ID_MJMP, id)) {
+		Common::SeekableReadStream *mjmpStream = _vm->getResource(ID_MJMP, id);
+		id = mjmpStream->readUint16LE();
+		delete mjmpStream;
+	}
+
+	return id;
+}
+
+Audio::SoundHandle *Sound::replaceBackgroundMyst(uint16 id, uint16 volume) {
 	debug (0, "Replacing background %d", id);
 
 	// TODO: The original engine does fading
 
-	Common::String name = getName(id);
+	Common::String name = _vm->getResourceName(ID_MSND, convertMystID(id));
 
 	// Check if sound is already playing
 	for (uint32 i = 0; i < _handles.size(); i++)
 		if (_handles[i].type == kBackgroundHandle
 				&& _vm->_mixer->isSoundHandleActive(_handles[i].handle)
-				&& name.equals(getName(_handles[i].id)))
+				&& name.equals(_vm->getResourceName(ID_MSND, convertMystID(_handles[i].id))))
 			return &_handles[i].handle;
 
 	// Stop old background sound
-	stopBackground();
+	stopBackgroundMyst();
 
 	// Play new sound
 	Audio::AudioStream *audStream = makeAudioStream(id);
@@ -595,7 +599,7 @@
 	return NULL;
 }
 
-void Sound::stopBackground() {
+void Sound::stopBackgroundMyst() {
 	for (uint32 i = 0; i < _handles.size(); i++)
 		if (_handles[i].type == kBackgroundHandle) {
 			_vm->_mixer->stopHandle(_handles[i].handle);
@@ -604,39 +608,22 @@
 		}
 }
 
-void Sound::pauseBackground() {
+void Sound::pauseBackgroundMyst() {
 	for (uint32 i = 0; i < _handles.size(); i++)
 		if (_handles[i].type == kBackgroundHandle)
 			_vm->_mixer->pauseHandle(_handles[i].handle, true);
 }
 
-void Sound::resumeBackground() {
+void Sound::resumeBackgroundMyst() {
 	for (uint32 i = 0; i < _handles.size(); i++)
 		if (_handles[i].type == kBackgroundHandle)
 			_vm->_mixer->pauseHandle(_handles[i].handle, false);
 }
 
-void Sound::changeBackgroundVolume(uint16 vol) {
+void Sound::changeBackgroundVolumeMyst(uint16 vol) {
 	for (uint32 i = 0; i < _handles.size(); i++)
 		if (_handles[i].type == kBackgroundHandle)
 			_vm->_mixer->setChannelVolume(_handles[i].handle, vol >> 8);
 }
 
-Common::String Sound::getName(uint16 id) {
-	if (_vm->getFeatures() & GF_ME) {
-		// Myst ME is a bit more efficient with sound storage than Myst
-		// Myst has lots of sounds repeated. To overcome this, Myst ME
-		// has MJMP resources which provide a link to the actual MSND
-		// resource we're looking for. This saves a lot of space from
-		// repeated data.
-		if (_vm->hasResource(ID_MJMP, id)) {
-			Common::SeekableReadStream *mjmpStream = _vm->getResource(ID_MJMP, id);
-			id = mjmpStream->readUint16LE();
-			delete mjmpStream;
-		}
-	}
-
-	return _vm->getResourceName(ID_MSND, id);
-}
-
 } // End of namespace Mohawk

Modified: scummvm/trunk/engines/mohawk/sound.h
===================================================================
--- scummvm/trunk/engines/mohawk/sound.h	2011-01-18 21:03:13 UTC (rev 55313)
+++ scummvm/trunk/engines/mohawk/sound.h	2011-01-18 21:10:58 UTC (rev 55314)
@@ -119,8 +119,8 @@
 	Sound(MohawkEngine *vm);
 	~Sound();
 
+	// Generic sound functions
 	Audio::SoundHandle *playSound(uint16 id, byte volume = Audio::Mixer::kMaxChannelVolume, bool loop = false);
-	Audio::SoundHandle *replaceSound(uint16 id, byte volume = Audio::Mixer::kMaxChannelVolume, bool loop = false);
 	void playSoundBlocking(uint16 id, byte volume = Audio::Mixer::kMaxChannelVolume);
 	void playMidi(uint16 id);
 	void stopMidi();
@@ -130,14 +130,15 @@
 	void resumeSound();
 	bool isPlaying(uint16 id);
 
-	// Myst background sound functions
-	Audio::SoundHandle *replaceBackground(uint16 id, uint16 volume = 0xFFFF);
-	void pauseBackground();
-	void resumeBackground();
-	void stopBackground();
-	void changeBackgroundVolume(uint16 vol);
+	// Myst-specific sound functions
+	Audio::SoundHandle *replaceSoundMyst(uint16 id, byte volume = Audio::Mixer::kMaxChannelVolume, bool loop = false);
+	Audio::SoundHandle *replaceBackgroundMyst(uint16 id, uint16 volume = 0xFFFF);
+	void pauseBackgroundMyst();
+	void resumeBackgroundMyst();
+	void stopBackgroundMyst();
+	void changeBackgroundVolumeMyst(uint16 vol);
 
-	// Riven-specific
+	// Riven-specific sound functions
 	void playSLST(uint16 index, uint16 card);
 	void playSLST(SLSTRecord slstRecord);
 	void pauseSLST();
@@ -158,7 +159,7 @@
 	Common::Array<SndHandle> _handles;
 	SndHandle *getHandle();
 	Audio::AudioStream *makeAudioStream(uint16 id);
-	Common::String getName(uint16 id);
+	uint16 convertMystID(uint16 id);
 
 	// Riven-specific
 	void playSLSTSound(uint16 index, bool fade, bool loop, uint16 volume, int16 balance);


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