aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/resource_audio.cpp
diff options
context:
space:
mode:
authorMax Horn2010-06-15 12:09:51 +0000
committerMax Horn2010-06-15 12:09:51 +0000
commitdea38106f84873a62c4a342c564dbfe9f38ff480 (patch)
tree3939616118e930370c272898d8ebbb92dd954251 /engines/sci/resource_audio.cpp
parent98e1f1a193a27cad12a888c8375c523420b25cbe (diff)
downloadscummvm-rg350-dea38106f84873a62c4a342c564dbfe9f38ff480.tar.gz
scummvm-rg350-dea38106f84873a62c4a342c564dbfe9f38ff480.tar.bz2
scummvm-rg350-dea38106f84873a62c4a342c564dbfe9f38ff480.zip
SCI: Change ResourceSource to a class, further OOPify it.
In particular, renamed location_name to _name and made it const and protected. Thus it cannot be changed after creation, and only read access is now possible, via a getter method. svn-id: r49810
Diffstat (limited to 'engines/sci/resource_audio.cpp')
-rw-r--r--engines/sci/resource_audio.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 85758e9ef0..f7f5077455 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -37,7 +37,7 @@ void ResourceManager::checkIfAudioVolumeIsCompressed(ResourceSource *source) {
Common::SeekableReadStream *fileStream = getVolumeFile(source);
if (!fileStream) {
- warning("Failed to open %s", source->location_name.c_str());
+ warning("Failed to open %s", source->getLocationName().c_str());
return;
}
@@ -155,15 +155,13 @@ void ResourceManager::addNewGMPatch(const Common::String &gameId) {
gmPatchFile = "TALEGM.PAT";
if (!gmPatchFile.empty() && Common::File::exists(gmPatchFile)) {
- ResourceSource *psrcPatch = new ResourceSource(kSourcePatch);
- psrcPatch->location_name = gmPatchFile;
+ ResourceSource *psrcPatch = new ResourceSource(kSourcePatch, gmPatchFile);
processPatch(psrcPatch, kResourceTypePatch, 4);
}
}
void ResourceManager::processWavePatch(ResourceId resourceId, Common::String name) {
- ResourceSource *resSrc = new ResourceSource(kSourceWave);
- resSrc->location_name = name;
+ ResourceSource *resSrc = new ResourceSource(kSourceWave, name);
Resource *newRes = 0;
@@ -352,7 +350,7 @@ int ResourceManager::readAudioMapSCI11(ResourceSource *map) {
int ResourceManager::readAudioMapSCI1(ResourceSource *map, bool unload) {
Common::File file;
- if (!file.open(map->location_name))
+ if (!file.open(map->getLocationName()))
return SCI_ERROR_RESMAP_NOT_FOUND;
bool oldFormat = (file.readUint16LE() >> 11) == kResourceTypeAudio;
@@ -364,7 +362,7 @@ int ResourceManager::readAudioMapSCI1(ResourceSource *map, bool unload) {
uint32 size = file.readUint32LE();
if (file.eos() || file.err()) {
- warning("Error while reading %s", map->location_name.c_str());
+ warning("Error while reading %s", map->getLocationName().c_str());
return SCI_ERROR_RESMAP_NOT_FOUND;
}