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

h00ligan at users.sourceforge.net h00ligan at users.sourceforge.net
Sun Dec 27 21:56:13 CET 2009


Revision: 46659
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46659&view=rev
Author:   h00ligan
Date:     2009-12-27 20:56:10 +0000 (Sun, 27 Dec 2009)

Log Message:
-----------
fix resource refactor regression

Modified Paths:
--------------
    scummvm/trunk/engines/saga/resource.cpp
    scummvm/trunk/engines/saga/resource.h

Modified: scummvm/trunk/engines/saga/resource.cpp
===================================================================
--- scummvm/trunk/engines/saga/resource.cpp	2009-12-27 20:38:14 UTC (rev 46658)
+++ scummvm/trunk/engines/saga/resource.cpp	2009-12-27 20:56:10 UTC (rev 46659)
@@ -153,7 +153,7 @@
 			patchResourceId = readS2.readUint32();
 			subjectResourceData = subjectContext->getResourceData(subjectResourceId);
 			resourceData = getResourceData(patchResourceId);
-			subjectResourceData->patchData = new PatchData(&_file);
+			subjectResourceData->patchData = new PatchData(&_file, _fileName);
 			subjectResourceData->offset = resourceData->offset;
 			subjectResourceData->size = resourceData->size;
 		}
@@ -165,7 +165,7 @@
 		if ((patchDescription->fileType & _fileType) != 0) {
 			if (patchDescription->resourceId < _table.size()) {
 				resourceData = &_table[patchDescription->resourceId];
-				resourceData->patchData = new PatchData(patchDescription);
+				resourceData->patchData = new PatchData(patchDescription->fileName);
 				if (resourceData->patchData->_patchFile->open(patchDescription->fileName)) {
 					resourceData->offset = 0;
 					resourceData->size = resourceData->patchData->_patchFile->size();

Modified: scummvm/trunk/engines/saga/resource.h
===================================================================
--- scummvm/trunk/engines/saga/resource.h	2009-12-27 20:38:14 UTC (rev 46658)
+++ scummvm/trunk/engines/saga/resource.h	2009-12-27 20:56:10 UTC (rev 46659)
@@ -39,14 +39,14 @@
 #define RSC_MIN_FILESIZE (RSC_TABLEINFO_SIZE + RSC_TABLEENTRY_SIZE + 1)
 
 struct PatchData {
+	Common::File *_patchFile;
+	const char *_fileName;
 	bool _deletePatchFile;
-	Common::File *_patchFile;
-	const GamePatchDescription *_patchDescription;
 
-	PatchData(const GamePatchDescription *patchDescription): _patchDescription(patchDescription), _deletePatchFile(true) {
+	PatchData(const char *fileName): _fileName(fileName), _deletePatchFile(true) {
 		_patchFile = new Common::File();
 	}
-	PatchData(Common::File *patchFile): _patchDescription(NULL), _patchFile(patchFile), _deletePatchFile(false) {
+	PatchData(Common::File *patchFile, const char *fileName): _patchFile(patchFile), _fileName(fileName), _deletePatchFile(false) {
 	}
 
 	~PatchData() {
@@ -135,7 +135,7 @@
 		const char * fn;
 		if (resourceData && resourceData->patchData != NULL) {
 			file = resourceData->patchData->_patchFile;
-			fn = resourceData->patchData->_patchDescription->fileName;
+			fn = resourceData->patchData->_fileName;
 		} else {
 			file = &_file;
 			fn = _fileName;


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