[Scummvm-cvs-logs] SF.net SVN: scummvm:[52929] scummvm/branches/branch-1-2-0/engines/saga/ resource.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Tue Sep 28 20:17:33 CEST 2010


Revision: 52929
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52929&view=rev
Author:   eriktorbjorn
Date:     2010-09-28 18:17:33 +0000 (Tue, 28 Sep 2010)

Log Message:
-----------
SAGA: Fix ITE intro regression

Backported from trunk. The bug caused p2_a.voc to not be played.
Possibly related to bug #3076822 - ITE: Dialog repeats in intro.

Modified Paths:
--------------
    scummvm/branches/branch-1-2-0/engines/saga/resource.cpp

Modified: scummvm/branches/branch-1-2-0/engines/saga/resource.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/saga/resource.cpp	2010-09-28 18:15:25 UTC (rev 52928)
+++ scummvm/branches/branch-1-2-0/engines/saga/resource.cpp	2010-09-28 18:17:33 UTC (rev 52929)
@@ -165,18 +165,21 @@
 		if ((patchDescription->fileType & _fileType) != 0) {
 			if (patchDescription->resourceId < _table.size()) {
 				resourceData = &_table[patchDescription->resourceId];
-				resourceData->patchData = new PatchData(patchDescription->fileName);
-				if (resourceData->patchData->_patchFile->open(patchDescription->fileName)) {
-					resourceData->offset = 0;
-					resourceData->size = resourceData->patchData->_patchFile->size();
-					// ITE uses several patch files which are loaded and then not needed
-					// anymore (as they're in memory), so close them here. IHNM uses only
-					// 1 patch file, which is reused, so don't close it
-					if (vm->getGameId() == GID_ITE)
-						resourceData->patchData->_patchFile->close();
-				} else {
-					delete resourceData->patchData;
-					resourceData->patchData = NULL;
+				// Check if we've already found a patch for this resource. One is enough.
+				if (!resourceData->patchData) {
+					resourceData->patchData = new PatchData(patchDescription->fileName);
+					if (resourceData->patchData->_patchFile->open(patchDescription->fileName)) {
+						resourceData->offset = 0;
+						resourceData->size = resourceData->patchData->_patchFile->size();
+						// ITE uses several patch files which are loaded and then not needed
+						// anymore (as they're in memory), so close them here. IHNM uses only
+						// 1 patch file, which is reused, so don't close it
+						if (vm->getGameId() == GID_ITE)
+							resourceData->patchData->_patchFile->close();
+					} else {
+						delete resourceData->patchData;
+						resourceData->patchData = NULL;
+					}
 				}
 			}
 		}


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