[Scummvm-cvs-logs] SF.net SVN: scummvm: [31405] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Apr 5 15:19:12 CEST 2008


Revision: 31405
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31405&view=rev
Author:   thebluegr
Date:     2008-04-05 06:19:12 -0700 (Sat, 05 Apr 2008)

Log Message:
-----------
Speech is now played correctly in the Macintosh version of IHNM

Modified Paths:
--------------
    scummvm/trunk/engines/saga/rscfile.cpp
    scummvm/trunk/engines/saga/sndres.cpp

Modified: scummvm/trunk/engines/saga/rscfile.cpp
===================================================================
--- scummvm/trunk/engines/saga/rscfile.cpp	2008-04-05 12:36:52 UTC (rev 31404)
+++ scummvm/trunk/engines/saga/rscfile.cpp	2008-04-05 13:19:12 UTC (rev 31405)
@@ -505,10 +505,16 @@
 			} else {
 				// No voice file found, don't add any file to the array
 				voicesFileInArray = true;
-				warning("No voice file found, voices will be disabled");
-				_vm->_voicesEnabled = false;
-				_vm->_subtitlesEnabled = true;
-				_vm->_voiceFilesExist = false;
+
+				if (_vm->getGameType() == GType_IHNM && _vm->isMacResources()) {
+					// The Macintosh version of IHNM has no voices.res, and it has all
+					// its voice files in subdirectories, so don't do anything here
+				} else {
+					warning("No voice file found, voices will be disabled");
+					_vm->_voicesEnabled = false;
+					_vm->_subtitlesEnabled = true;
+					_vm->_voiceFilesExist = false;
+				}
 			}
 		}
 	}

Modified: scummvm/trunk/engines/saga/sndres.cpp
===================================================================
--- scummvm/trunk/engines/saga/sndres.cpp	2008-04-05 12:36:52 UTC (rev 31404)
+++ scummvm/trunk/engines/saga/sndres.cpp	2008-04-05 13:19:12 UTC (rev 31405)
@@ -105,6 +105,18 @@
 	if (_voiceSerial == serial)
 		return;
 
+	// If we got the Macintosh version of IHNM, just set the voice bank
+	// so that we know which voices* subfolder to look for later
+	if (_vm->getGameType() == GType_IHNM && _vm->isMacResources()) {
+		_voiceSerial = serial;
+		// Set a dummy voice context
+		_voiceContext = new ResourceContext();
+		_voiceContext->fileType = GAME_VOICEFILE;
+		_voiceContext->count = 0;
+		_voiceContext->serial = 0;
+		return;
+	}
+
 	// If there are no voice files present, don't set the voice bank
 	if (!_vm->_voiceFilesExist)
 		return;
@@ -177,10 +189,25 @@
 		int dirIndex = 0;
 	
 		if ((context->fileType & GAME_VOICEFILE) != 0) {
-			// TODO
-			return false;
+			dirIndex = floor((float)(resourceId / 64));
+
+			if (_voiceSerial == 0) {
+				if (resourceId <= 16)			// F in hex (1 char in hex)
+					sprintf(soundFileName, "Voices/VoicesS/Voices%d/VoicesS00%x", dirIndex, resourceId);
+				else if (resourceId <= 255)		// FF in hex (2 chars in hex)
+					sprintf(soundFileName, "Voices/VoicesS/Voices%d/VoicesS0%x", dirIndex, resourceId);
+				else
+					sprintf(soundFileName, "Voices/VoicesS/Voices%d/VoicesS%x", dirIndex, resourceId);
+			} else {
+				if (resourceId <= 16)			// F in hex (1 char in hex)
+					sprintf(soundFileName, "Voices/Voices%d/Voices%d/Voices%d00%x", _voiceSerial, dirIndex, _voiceSerial, resourceId);
+				else if (resourceId <= 255)		// FF in hex (2 chars in hex)
+					sprintf(soundFileName, "Voices/Voices%d/Voices%d/Voices%d0%x", _voiceSerial, dirIndex, _voiceSerial, resourceId);
+				else
+					sprintf(soundFileName, "Voices/Voices%d/Voices%d/Voices%d%x", _voiceSerial, dirIndex, _voiceSerial, resourceId);
+			}
 		} else {
-			dirIndex = floor((float)(resourceId / 63));
+			dirIndex = floor((float)(resourceId / 64));
 
 			if (resourceId <= 16)	// F in hex (1 char in hex)
 				sprintf(soundFileName, "SFX/SFX%d/SFX00%x", dirIndex, resourceId);
@@ -204,7 +231,11 @@
 		soundInfo = _vm->getSfxInfo();
 	}
 
-	context->table[resourceId].fillSoundPatch(soundInfo);
+	if (_vm->getGameType() == GType_IHNM && _vm->isMacResources() && (context->fileType & GAME_VOICEFILE) != 0) {
+		// No sound patch data for the voice files in the Mac version of IHNM
+	} else {
+		context->table[resourceId].fillSoundPatch(soundInfo);
+	}
 
 	MemoryReadStream readS(soundResource, soundResourceLength);
 


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