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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jan 22 22:55:15 CET 2008


Revision: 30617
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30617&view=rev
Author:   thebluegr
Date:     2008-01-22 13:55:14 -0800 (Tue, 22 Jan 2008)

Log Message:
-----------
Code simplification

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

Modified: scummvm/trunk/engines/saga/rscfile.cpp
===================================================================
--- scummvm/trunk/engines/saga/rscfile.cpp	2008-01-22 20:54:35 UTC (rev 30616)
+++ scummvm/trunk/engines/saga/rscfile.cpp	2008-01-22 21:55:14 UTC (rev 30617)
@@ -534,6 +534,7 @@
 	for (i = 0; i < _contextsCount; i++) {
 		context = &_contexts[i];
 		context->file = new Common::File();
+		context->serial = 0;
 
 		// For ITE, add the digital music file and sfx file information here
 		if (_vm->getGameType() == GType_ITE && digitalMusic && i == _contextsCount - 1) {
@@ -560,20 +561,13 @@
 
 				context->fileName = voicesFileName;
 				context->fileType = GAME_VOICEFILE;
-			}
-		}
-		context->serial = 0;
 
-		// IHNM has several different voice files, so we need to allow
-		// multiple resource contexts of the same type. We tell them
-		// apart by assigning each of the duplicates a unique serial
-		// number. The default behaviour when requesting a context will
-		// be to look for serial number 0.
-
-		for (int j = i - 1; j >= 0; j--) {
-			if (_contexts[j].fileType & context->fileType) {
-				context->serial = _contexts[j].serial + 1;
-				break;
+				// IHNM has several different voice files, so we need to allow
+				// multiple resource contexts of the same type. We tell them
+				// apart by assigning each of the duplicates a unique serial
+				// number. The default behaviour when requesting a context will
+				// be to look for serial number 0.
+				context->serial = i - voicesFileIndex + token;
 			}
 		}
 


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