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

sev at users.sourceforge.net sev at users.sourceforge.net
Sat Apr 5 16:20:43 CEST 2008


Revision: 31409
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31409&view=rev
Author:   sev
Date:     2008-04-05 07:18:32 -0700 (Sat, 05 Apr 2008)

Log Message:
-----------
Simplify code

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

Modified: scummvm/trunk/engines/saga/music.cpp
===================================================================
--- scummvm/trunk/engines/saga/music.cpp	2008-04-05 14:06:50 UTC (rev 31408)
+++ scummvm/trunk/engines/saga/music.cpp	2008-04-05 14:18:32 UTC (rev 31409)
@@ -550,10 +550,7 @@
 		// Load the external music file for Mac IHNM
 		Common::File musicFile;
 		char musicFileName[40];
-		if (resourceId <= 16)			// F in hex (1 char in hex)
-			sprintf(musicFileName, "Music/Music0%x", resourceId);
-		else
-			sprintf(musicFileName, "Music/Music%x", resourceId);
+		sprintf(musicFileName, "Music/Music%02x", resourceId);
 		musicFile.open(musicFileName);
 		resourceSize = musicFile.size();
 		resourceData = new byte[resourceSize];

Modified: scummvm/trunk/engines/saga/sndres.cpp
===================================================================
--- scummvm/trunk/engines/saga/sndres.cpp	2008-04-05 14:06:50 UTC (rev 31408)
+++ scummvm/trunk/engines/saga/sndres.cpp	2008-04-05 14:18:32 UTC (rev 31409)
@@ -192,29 +192,14 @@
 			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);
+				sprintf(soundFileName, "Voices/VoicesS/Voices%d/VoicesS%03x", 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);
+				sprintf(soundFileName, "Voices/Voices%d/Voices%d/Voices%d%03x", _voiceSerial, dirIndex, _voiceSerial, resourceId);
 			}
 		} else {
 			dirIndex = floor((float)(resourceId / 64));
 
-			if (resourceId <= 16)	// F in hex (1 char in hex)
-				sprintf(soundFileName, "SFX/SFX%d/SFX00%x", dirIndex, resourceId);
-			else if (resourceId <= 255)	// FF in hex (2 chars in hex)
-				sprintf(soundFileName, "SFX/SFX%d/SFX0%x", dirIndex, resourceId);
-			else
-				sprintf(soundFileName, "SFX/SFX%d/SFX%x", dirIndex, resourceId);
+			sprintf(soundFileName, "SFX/SFX%d/SFX%02x", dirIndex, resourceId);
 		}
 		soundFile.open(soundFileName);
 		soundResourceLength = soundFile.size();


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