[Scummvm-cvs-logs] SF.net SVN: scummvm: [31210] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Mar 21 17:21:27 CET 2008


Revision: 31210
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31210&view=rev
Author:   lordhoto
Date:     2008-03-21 09:21:27 -0700 (Fri, 21 Mar 2008)

Log Message:
-----------
Cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/sound.h
    scummvm/trunk/engines/kyra/sound_towns.cpp

Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h	2008-03-21 16:18:27 UTC (rev 31209)
+++ scummvm/trunk/engines/kyra/sound.h	2008-03-21 16:21:27 UTC (rev 31210)
@@ -185,6 +185,12 @@
 	enum {
 		kNumChannelHandles = 4
 	};
+	
+	struct SoundChannel {
+		Common::String file;
+		Audio::SoundHandle channelHandle;
+	};
+	SoundChannel _soundChannels[kNumChannelHandles];
 
 	int _musicEnabled;
 	bool _sfxEnabled;
@@ -197,12 +203,6 @@
 private:
 	const AudioDataStruct *_soundDataList;
 
-	struct SoundChannel {
-		Common::String file;
-		Audio::SoundHandle channelHandle;
-	};
-	SoundChannel _soundChannels[kNumChannelHandles];
-
 	struct SpeechCodecs {
 		const char *fileext;
 		Audio::AudioStream *(*streamFunc)(
@@ -428,14 +428,13 @@
 	void haltTrack();
 	void beginFadeOut();
 
-	void voicePlay(const char *file);
+	bool voicePlay(const char *file);
 	void playSoundEffect(uint8) {}
 
 private:
 	int _lastTrack;
 
 	Audio::AudioStream *_currentSFX;
-	Audio::SoundHandle _sfxHandles[kNumChannelHandles];
 
 	//SoundTowns_v2_TwnDriver *_driver;
 	uint8 *_twnTrackData;

Modified: scummvm/trunk/engines/kyra/sound_towns.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_towns.cpp	2008-03-21 16:18:27 UTC (rev 31209)
+++ scummvm/trunk/engines/kyra/sound_towns.cpp	2008-03-21 16:21:27 UTC (rev 31210)
@@ -1432,15 +1432,15 @@
 	//_driver->reset();
 }
 
-void SoundTowns_v2::voicePlay(const char *file) {
+bool SoundTowns_v2::voicePlay(const char *file) {
 	static const uint16 rates[] =	{ 0x10E1, 0x0CA9, 0x0870, 0x0654, 0x0438, 0x032A, 0x021C, 0x0194 };
 
 	int h = 0;
 	if (_currentSFX) {
-		while (_mixer->isSoundHandleActive(_sfxHandles[h]) && h < kNumChannelHandles)
+		while (_mixer->isSoundHandleActive(_soundChannels[h].channelHandle) && h < kNumChannelHandles)
 			h++;
 		if (h >= kNumChannelHandles)
-			return;
+			return false;
 	}
 
 	uint8 * data = _vm->resource()->fileData(file, 0);
@@ -1490,9 +1490,11 @@
 
 	_currentSFX = Audio::makeLinearInputStream(sfx, outsize, outputRate,
 		Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_LITTLE_ENDIAN | Audio::Mixer::FLAG_AUTOFREE, 0, 0);
-	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandles[h], _currentSFX);
+	_soundChannels[h].file = file;
+	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundChannels[h].channelHandle, _currentSFX);
 
 	delete [] data;
+	return true;
 }
 
 void SoundTowns_v2::beginFadeOut() {


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