aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2009-12-27 23:35:22 +0000
committerMatthew Hoops2009-12-27 23:35:22 +0000
commitfedd4f10768771556c74ef24eacd31654b55af78 (patch)
tree5e4efec08a31e3fbdd73c7295500fed77900cf66
parent538806af19285b3dcf2408b44cede4c70f3cc278 (diff)
downloadscummvm-rg350-fedd4f10768771556c74ef24eacd31654b55af78.tar.gz
scummvm-rg350-fedd4f10768771556c74ef24eacd31654b55af78.tar.bz2
scummvm-rg350-fedd4f10768771556c74ef24eacd31654b55af78.zip
Fix regression in SCI1/1.1 wave sound from r46660. I knew it was a bad omen to have that revision number :P
svn-id: r46664
-rw-r--r--engines/sci/resource.cpp6
-rw-r--r--engines/sci/resource.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 67186ed244..c039cfe260 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -193,7 +193,7 @@ ResourceSource *ResourceManager::getVolume(ResourceSource *map, int volume_nr) {
bool ResourceManager::loadPatch(Resource *res, Common::File &file) {
// We assume that the resource type matches res->type
- file.seek(res->file_offset, SEEK_SET);
+ file.seek(res->file_offset + 2, SEEK_SET);
res->data = new byte[res->size];
@@ -944,7 +944,7 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType restype,
newrsc->source = source;
newrsc->size = fsize - patch_data_offset - 2;
newrsc->headerSize = patch_data_offset;
- newrsc->file_offset = 2;
+ newrsc->file_offset = 0;
debugC(1, kDebugLevelResMan, "Patching %s - OK", source->location_name.c_str());
}
@@ -1034,7 +1034,7 @@ void ResourceManager::readWaveAudioPatches() {
newrsc->source = psrcPatch;
newrsc->size = fileSize;
newrsc->headerSize = 0;
- newrsc->file_offset = 0; // No patch header
+ newrsc->file_offset = -2; // Use -2 to signal there's no patch header
debugC(1, kDebugLevelResMan, "Patching %s - OK", psrcPatch->location_name.c_str());
}
}
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index abcf6210af..f2ef41b908 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -204,7 +204,7 @@ public:
byte *header;
uint32 headerSize;
protected:
- uint32 file_offset; /**< Offset in file */
+ int32 file_offset; /**< Offset in file */
ResourceStatus status;
uint16 lockers; /**< Number of places where this resource was locked */
ResourceSource *source;