From 4020500640481e0a8089fd82ad94d2c286f0e024 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 15 Jun 2010 12:15:05 +0000 Subject: SCI: Rename ResourceSource members to follow _camelCase convention svn-id: r49823 --- engines/sci/resource.cpp | 22 +++++++++++----------- engines/sci/resource.h | 2 +- engines/sci/resource_audio.cpp | 20 ++++++++++---------- engines/sci/resource_intern.h | 14 +++++++------- 4 files changed, 29 insertions(+), 29 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 69bce4f5d5..1614700886 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -164,17 +164,17 @@ void Resource::writeToStream(Common::WriteStream *stream) const { } uint32 Resource::getAudioCompressionType() { - return _source->audioCompressionType; + return _source->_audioCompressionType; } ResourceSource::ResourceSource(ResSourceType type, const Common::String &name, int volNum) - : _sourceType(type), _name(name), volume_number(volNum) { - scanned = false; + : _sourceType(type), _name(name), _volumeNumber(volNum) { + _scanned = false; _resourceFile = 0; - associated_map = NULL; - audioCompressionType = 0; - audioCompressionOffsetMapping = NULL; + _associatedMap = NULL; + _audioCompressionType = 0; + _audioCompressionOffsetMapping = NULL; } ResourceSource::~ResourceSource() { @@ -397,10 +397,10 @@ void AudioVolumeResourceSource::loadResource(Resource *res, ResourceManager *res if (!fileStream) return; - if (audioCompressionType) { + if (_audioCompressionType) { // this file is compressed, so lookup our offset in the offset-translation table and get the new offset // also calculate the compressed size by using the next offset - int32 *mappingTable = audioCompressionOffsetMapping; + int32 *mappingTable = _audioCompressionOffsetMapping; int32 compressedOffset = 0; do { @@ -641,8 +641,8 @@ void ResourceManager::scanNewSources() { for (Common::List::iterator it = _sources.begin(); it != _sources.end(); ++it) { ResourceSource *source = *it; - if (!source->scanned) { - source->scanned = true; + if (!source->_scanned) { + source->_scanned = true; source->scanSource(this); } } @@ -1439,7 +1439,7 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) { // for SCI2.1 and SCI3 maps that are not resmap.000. The resmap.* files' numbers // need to be used in concurrence with the volume specified in the map to get // the actual resource file. - res->_source = findVolume(map, volume_nr + map->volume_number); + res->_source = findVolume(map, volume_nr + map->_volumeNumber); res->_fileOffset = off; } } diff --git a/engines/sci/resource.h b/engines/sci/resource.h index bddcbffae7..e753dc1686 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -362,7 +362,7 @@ protected: ResourceSource *addInternalMap(const Common::String &name, int resNr); /** - * Checks, if an audio volume got compressed by our tool. If that's the case, it will set audioCompressionType + * Checks, if an audio volume got compressed by our tool. If that's the case, it will set _audioCompressionType * and read in the offset translation table for later usage. */ void checkIfAudioVolumeIsCompressed(ResourceSource *source); diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index cbd713c906..25e73242ef 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -52,13 +52,13 @@ void ResourceManager::checkIfAudioVolumeIsCompressed(ResourceSource *source) { case MKID_BE('OGG '): case MKID_BE('FLAC'): // Detected a compressed audio volume - source->audioCompressionType = compressionType; + source->_audioCompressionType = compressionType; // Now read the whole offset mapping table for later usage int32 recordCount = fileStream->readUint32LE(); if (!recordCount) error("compressed audio volume doesn't contain any entries!"); int32 *offsetMapping = new int32[(recordCount + 1) * 2]; - source->audioCompressionOffsetMapping = offsetMapping; + source->_audioCompressionOffsetMapping = offsetMapping; for (int recordNo = 0; recordNo < recordCount; recordNo++) { *offsetMapping++ = fileStream->readUint32LE(); *offsetMapping++ = fileStream->readUint32LE(); @@ -257,10 +257,10 @@ void ResourceManager::removeAudioResource(ResourceId resId) { int ResourceManager::readAudioMapSCI11(ResourceSource *map) { bool isEarly = true; uint32 offset = 0; - Resource *mapRes = findResource(ResourceId(kResourceTypeMap, map->volume_number), false); + Resource *mapRes = findResource(ResourceId(kResourceTypeMap, map->_volumeNumber), false); if (!mapRes) { - warning("Failed to open %i.MAP", map->volume_number); + warning("Failed to open %i.MAP", map->_volumeNumber); return SCI_ERROR_RESMAP_NOT_FOUND; } @@ -271,7 +271,7 @@ int ResourceManager::readAudioMapSCI11(ResourceSource *map) { byte *ptr = mapRes->data; - if (map->volume_number == 65535) { + if (map->_volumeNumber == 65535) { // Heuristic to detect late SCI1.1 map format if ((mapRes->size >= 6) && (ptr[mapRes->size - 6] != 0xff)) isEarly = false; @@ -324,7 +324,7 @@ int ResourceManager::readAudioMapSCI11(ResourceSource *map) { ptr += 2; if (syncSize > 0) - addResource(ResourceId(kResourceTypeSync36, map->volume_number, n & 0xffffff3f), src, offset, syncSize); + addResource(ResourceId(kResourceTypeSync36, map->_volumeNumber, n & 0xffffff3f), src, offset, syncSize); } if (n & 0x40) { @@ -334,7 +334,7 @@ int ResourceManager::readAudioMapSCI11(ResourceSource *map) { ptr += 2; } - addResource(ResourceId(kResourceTypeAudio36, map->volume_number, n & 0xffffff3f), src, offset + syncSize); + addResource(ResourceId(kResourceTypeAudio36, map->_volumeNumber, n & 0xffffff3f), src, offset + syncSize); } } @@ -401,7 +401,7 @@ int ResourceManager::readAudioMapSCI1(ResourceSource *map, bool unload) { void ResourceManager::setAudioLanguage(int language) { if (_audioMapSCI1) { - if (_audioMapSCI1->volume_number == language) { + if (_audioMapSCI1->_volumeNumber == language) { // This language is already loaded return; } @@ -413,7 +413,7 @@ void ResourceManager::setAudioLanguage(int language) { Common::List::iterator it = _sources.begin(); while (it != _sources.end()) { ResourceSource *src = *it; - if (src->associated_map == _audioMapSCI1) { + if (src->_associatedMap == _audioMapSCI1) { it = _sources.erase(it); delete src; } else { @@ -454,7 +454,7 @@ void ResourceManager::setAudioLanguage(int language) { } int ResourceManager::getAudioLanguage() const { - return (_audioMapSCI1 ? _audioMapSCI1->volume_number : 0); + return (_audioMapSCI1 ? _audioMapSCI1->_volumeNumber : 0); } SoundResource::SoundResource(uint32 resNumber, ResourceManager *resMan, SciVersion soundVersion) : _resMan(resMan), _soundVersion(soundVersion) { diff --git a/engines/sci/resource_intern.h b/engines/sci/resource_intern.h index 52f47aca8b..5a5129c125 100644 --- a/engines/sci/resource_intern.h +++ b/engines/sci/resource_intern.h @@ -53,12 +53,12 @@ protected: const Common::String _name; public: - bool scanned; + bool _scanned; const Common::FSNode *_resourceFile; - const int volume_number; - ResourceSource *associated_map; // TODO: Move to VolumeResourceSource - uint32 audioCompressionType; // TODO: Move to AudioVolumeResourceSource - int32 *audioCompressionOffsetMapping; // TODO: Move to AudioVolumeResourceSource + const int _volumeNumber; + ResourceSource *_associatedMap; // TODO: Move to VolumeResourceSource + uint32 _audioCompressionType; // TODO: Move to AudioVolumeResourceSource + int32 *_audioCompressionOffsetMapping; // TODO: Move to AudioVolumeResourceSource protected: ResourceSource(ResSourceType type, const Common::String &name, int volNum = 0); @@ -109,11 +109,11 @@ class VolumeResourceSource : public ResourceSource { public: VolumeResourceSource(const Common::String &name, ResourceSource *map, int volNum, ResSourceType type = kSourceVolume) : ResourceSource(type, name, volNum) { - associated_map = map; + _associatedMap = map; } virtual ResourceSource *findVolume(ResourceSource *map, int volNum) { - if (associated_map == map && volume_number == volNum) + if (_associatedMap == map && _volumeNumber == volNum) return this; return NULL; }; -- cgit v1.2.3