[Scummvm-cvs-logs] SF.net SVN: scummvm:[49823] scummvm/trunk/engines/sci

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Jun 15 14:15:05 CEST 2010


Revision: 49823
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49823&view=rev
Author:   fingolfin
Date:     2010-06-15 12:15:05 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
SCI: Rename ResourceSource members to follow _camelCase convention

Modified Paths:
--------------
    scummvm/trunk/engines/sci/resource.cpp
    scummvm/trunk/engines/sci/resource.h
    scummvm/trunk/engines/sci/resource_audio.cpp
    scummvm/trunk/engines/sci/resource_intern.h

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2010-06-15 12:14:39 UTC (rev 49822)
+++ scummvm/trunk/engines/sci/resource.cpp	2010-06-15 12:15:05 UTC (rev 49823)
@@ -164,17 +164,17 @@
 }
 
 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 @@
 	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 @@
 	for (Common::List<ResourceSource *>::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 @@
 				// 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;
 			}
 		}

Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h	2010-06-15 12:14:39 UTC (rev 49822)
+++ scummvm/trunk/engines/sci/resource.h	2010-06-15 12:15:05 UTC (rev 49823)
@@ -362,7 +362,7 @@
 	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);

Modified: scummvm/trunk/engines/sci/resource_audio.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource_audio.cpp	2010-06-15 12:14:39 UTC (rev 49822)
+++ scummvm/trunk/engines/sci/resource_audio.cpp	2010-06-15 12:15:05 UTC (rev 49823)
@@ -52,13 +52,13 @@
 	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 @@
 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 @@
 
 	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 @@
 				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 @@
 				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 @@
 
 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 @@
 		Common::List<ResourceSource *>::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 @@
 }
 
 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) {

Modified: scummvm/trunk/engines/sci/resource_intern.h
===================================================================
--- scummvm/trunk/engines/sci/resource_intern.h	2010-06-15 12:14:39 UTC (rev 49822)
+++ scummvm/trunk/engines/sci/resource_intern.h	2010-06-15 12:15:05 UTC (rev 49823)
@@ -53,12 +53,12 @@
 	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 @@
 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;
 	};


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