aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kurushin2009-12-27 20:56:10 +0000
committerAndrew Kurushin2009-12-27 20:56:10 +0000
commit9511b474dcba3447120f0eda7f4eda2a954b7d2d (patch)
treef9bc7550d00b7899aedcd9e24c93cb6bddb6c61b
parent4f78c872d731bf5b567d191d533b3fc1081f04e4 (diff)
downloadscummvm-rg350-9511b474dcba3447120f0eda7f4eda2a954b7d2d.tar.gz
scummvm-rg350-9511b474dcba3447120f0eda7f4eda2a954b7d2d.tar.bz2
scummvm-rg350-9511b474dcba3447120f0eda7f4eda2a954b7d2d.zip
fix resource refactor regression
svn-id: r46659
-rw-r--r--engines/saga/resource.cpp4
-rw-r--r--engines/saga/resource.h10
2 files changed, 7 insertions, 7 deletions
diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp
index 5009ee1a10..7ae8599a93 100644
--- a/engines/saga/resource.cpp
+++ b/engines/saga/resource.cpp
@@ -153,7 +153,7 @@ bool ResourceContext::load(SagaEngine *vm, Resource *resource) {
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 @@ bool ResourceContext::load(SagaEngine *vm, Resource *resource) {
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();
diff --git a/engines/saga/resource.h b/engines/saga/resource.h
index 611feea233..34341f50f0 100644
--- a/engines/saga/resource.h
+++ b/engines/saga/resource.h
@@ -39,14 +39,14 @@ namespace Saga {
#define RSC_MIN_FILESIZE (RSC_TABLEINFO_SIZE + RSC_TABLEENTRY_SIZE + 1)
struct PatchData {
- bool _deletePatchFile;
Common::File *_patchFile;
- const GamePatchDescription *_patchDescription;
+ const char *_fileName;
+ bool _deletePatchFile;
- 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 @@ public:
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;