[Scummvm-cvs-logs] SF.net SVN: scummvm: [27265] scummvm/branches/branch-0-10-0/engines/agos

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sun Jun 10 03:01:32 CEST 2007


Revision: 27265
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27265&view=rev
Author:   Kirben
Date:     2007-06-09 18:01:31 -0700 (Sat, 09 Jun 2007)

Log Message:
-----------
Fix single sound effect, failing to play multiple times regression, caused by changes for PP in the past.

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/engines/agos/agos.h
    scummvm/branches/branch-0-10-0/engines/agos/script_pp.cpp
    scummvm/branches/branch-0-10-0/engines/agos/sound.cpp

Modified: scummvm/branches/branch-0-10-0/engines/agos/agos.h
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/agos.h	2007-06-10 00:36:01 UTC (rev 27264)
+++ scummvm/branches/branch-0-10-0/engines/agos/agos.h	2007-06-10 01:01:31 UTC (rev 27265)
@@ -1673,6 +1673,7 @@
 	void opp_sync();
 	void opp_saveUserGame();
 	void opp_loadUserGame();
+	void opp_playTune();
 	void opp_saveOopsPosition();
 	void opp_resetGameTime();
 	void opp_resetPVCount();

Modified: scummvm/branches/branch-0-10-0/engines/agos/script_pp.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/script_pp.cpp	2007-06-10 00:36:01 UTC (rev 27264)
+++ scummvm/branches/branch-0-10-0/engines/agos/script_pp.cpp	2007-06-10 01:01:31 UTC (rev 27265)
@@ -238,7 +238,7 @@
 		/* 160 */
 		OPCODE(oe2_ink),
 		OPCODE(off_screenTextBox),
-		OPCODE(os1_screenTextMsg),
+		OPCODE(opp_playTune),
 		OPCODE(o_invalid),
 		/* 164 */
 		OPCODE(oe2_getDollar2),
@@ -405,6 +405,19 @@
 	loadGame(genSaveName(1));
 }
 
+void AGOSEngine_PuzzlePack::opp_playTune() {
+	// 162: play tune
+	getVarOrByte();
+	getVarOrByte();
+	getNextWord();
+
+	uint16 music = (uint16)getVarOrWord();
+	if (music != _lastMusicPlayed) {
+		_lastMusicPlayed = music;
+		playSpeech(music, 1);
+	}
+}
+
 void AGOSEngine_PuzzlePack::opp_saveOopsPosition() {
 	// 173: save oops position
 	if (!isVgaQueueEmpty()) {

Modified: scummvm/branches/branch-0-10-0/engines/agos/sound.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/sound.cpp	2007-06-10 00:36:01 UTC (rev 27264)
+++ scummvm/branches/branch-0-10-0/engines/agos/sound.cpp	2007-06-10 01:01:31 UTC (rev 27265)
@@ -243,7 +243,7 @@
 
 void WavSound::playSound(uint sound, uint loopSound, Audio::SoundHandle *handle, byte flags, int vol) {
 	convertVolume(vol);
-	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), sound, vol);
+	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol);
 }
 
 void VocSound::playSound(uint sound, uint loopSound, Audio::SoundHandle *handle, byte flags, int vol) {
@@ -255,7 +255,7 @@
 	int size, rate;
 	byte *buffer = Audio::loadVOCFromStream(*_file, size, rate);
 	assert(buffer);
-	_mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE, sound);
+	_mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE);
 }
 
 void RawSound::playSound(uint sound, uint loopSound, Audio::SoundHandle *handle, byte flags, int vol) {
@@ -268,7 +268,7 @@
 	byte *buffer = (byte *)malloc(size);
 	assert(buffer);
 	_file->read(buffer, size);
-	_mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, 22050, flags | Audio::Mixer::FLAG_AUTOFREE, sound);
+	_mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, 22050, flags | Audio::Mixer::FLAG_AUTOFREE);
 }
 
 #ifdef USE_MAD
@@ -296,7 +296,7 @@
 
 void MP3Sound::playSound(uint sound, uint loopSound, Audio::SoundHandle *handle, byte flags, int vol) {
 	convertVolume(vol);
-	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), sound, vol);
+	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol);
 }
 #endif
 
@@ -325,7 +325,7 @@
 
 void VorbisSound::playSound(uint sound, uint loopSound, Audio::SoundHandle *handle, byte flags, int vol) {
 	convertVolume(vol);
-	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), sound, vol);
+	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol);
 }
 #endif
 
@@ -354,7 +354,7 @@
 
 void FlacSound::playSound(uint sound, uint loopSound, Audio::SoundHandle *handle, byte flags, int vol) {
 	convertVolume(vol);
-	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), sound, vol);
+	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol);
 }
 #endif
 
@@ -681,9 +681,9 @@
 	memcpy(buffer, soundData, size);
 
 	if (_vm->getPlatform() == Common::kPlatformPC)
-		_mixer->playRaw(Audio::Mixer::kSFXSoundType, &_effectsHandle, buffer, size, 8000, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE, sound);
+		_mixer->playRaw(Audio::Mixer::kSFXSoundType, &_effectsHandle, buffer, size, 8000, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE);
 	else
-		_mixer->playRaw(Audio::Mixer::kSFXSoundType, &_effectsHandle, buffer, size, 8000, Audio::Mixer::FLAG_AUTOFREE, sound);
+		_mixer->playRaw(Audio::Mixer::kSFXSoundType, &_effectsHandle, buffer, size, 8000, Audio::Mixer::FLAG_AUTOFREE);
 }
 
 // Feeble Files specific
@@ -747,7 +747,7 @@
 		memcpy(buffer, soundData + stream.pos(), size);
 	}
 
-	_mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE, sound, vol, pan);
+	_mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE, -1, vol, pan);
 }
 
 void Sound::stopSfx5() {


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