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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri May 23 13:35:07 CEST 2008


Revision: 32226
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32226&view=rev
Author:   lordhoto
Date:     2008-05-23 04:35:05 -0700 (Fri, 23 May 2008)

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

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

Modified: scummvm/trunk/engines/kyra/sound.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound.cpp	2008-05-23 11:26:33 UTC (rev 32225)
+++ scummvm/trunk/engines/kyra/sound.cpp	2008-05-23 11:35:05 UTC (rev 32226)
@@ -67,9 +67,6 @@
 }
 
 bool Sound::voicePlay(const char *file, bool isSfx) {
-	uint32 fileSize = 0;
-	byte *fileData = 0;
-	bool found = false;
 	char filenamebuffer[25];
 
 	int h = 0;
@@ -88,28 +85,28 @@
 		if (!stream)
 			continue;
 		audioStream = _supportedCodes[i].streamFunc(stream, true, 0, 0, 1);
-		found = true;
 		break;
 	}
 
-	if (!found) {
+	if (!audioStream) {
 		strcpy(filenamebuffer, file);
 		strcat(filenamebuffer, ".VOC");
 
-		fileData = _vm->resource()->fileData(filenamebuffer, &fileSize);
+		uint32 fileSize = 0;
+		byte *fileData = _vm->resource()->fileData(filenamebuffer, &fileSize);
 		if (!fileData)
 			return false;
 
 		Common::MemoryReadStream vocStream(fileData, fileSize);
 		audioStream = Audio::makeVOCStream(vocStream);
+
+		delete[] fileData;
+		fileSize = 0;
 	}
 
 	_soundChannels[h].file = file;
 	_mixer->playInputStream(isSfx ? Audio::Mixer::kSFXSoundType : Audio::Mixer::kSpeechSoundType, &_soundChannels[h].channelHandle, audioStream);
 
-	delete[] fileData;
-	fileSize = 0;
-
 	return true;
 }
 


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