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

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


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

Log Message:
-----------
SCI: Changed some 'const char *' to Common::String

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:09:51 UTC (rev 49810)
+++ scummvm/trunk/engines/sci/resource.cpp	2010-06-15 12:10:18 UTC (rev 49811)
@@ -191,8 +191,8 @@
 
 // Resource source list management
 
-ResourceSource *ResourceManager::addExternalMap(const char *file_name, int volume_nr) {
-	ResourceSource *newsrc = new ResourceSource(kSourceExtMap, file_name);
+ResourceSource *ResourceManager::addExternalMap(const Common::String &filename, int volume_nr) {
+	ResourceSource *newsrc = new ResourceSource(kSourceExtMap, filename);
 
 	newsrc->volume_number = volume_nr;
 
@@ -210,7 +210,7 @@
 	return newsrc;
 }
 
-ResourceSource *ResourceManager::addSource(ResourceSource *map, ResSourceType type, const char *filename, int number) {
+ResourceSource *ResourceManager::addSource(ResourceSource *map, ResSourceType type, const Common::String &filename, int number) {
 	ResourceSource *newsrc = new ResourceSource(type, filename);
 
 	newsrc->volume_number = number;
@@ -235,7 +235,7 @@
 	return newsrc;
 }
 
-ResourceSource *ResourceManager::addPatchDir(const char *dirname) {
+ResourceSource *ResourceManager::addPatchDir(const Common::String &dirname) {
 	ResourceSource *newsrc = new ResourceSource(kSourceDirectory, dirname);
 
 	_sources.push_back(newsrc);
@@ -459,7 +459,7 @@
 			const char *dot = strrchr(name.c_str(), '.');
 			int number = atoi(dot + 1);
 
-			addSource(map, kSourceVolume, name.c_str(), number);
+			addSource(map, kSourceVolume, name, number);
 		}
 #ifdef ENABLE_SCI32
 		// GK1CD hires content
@@ -472,7 +472,7 @@
 
 		for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
 			Common::String filename = (*x)->getName();
-			addSource(0, kSourceMacResourceFork, filename.c_str(), atoi(filename.c_str() + 4));
+			addSource(0, kSourceMacResourceFork, filename, atoi(filename.c_str() + 4));
 		}
 #ifdef ENABLE_SCI32
 		// Mac SCI32 games have extra folders for patches
@@ -504,7 +504,7 @@
 				int resNumber = atoi(strrchr(resName.c_str(), '.') + 1);
 
 				if (mapNumber == resNumber) {
-					addSource(addExternalMap(mapName.c_str(), mapNumber), kSourceVolume, resName.c_str(), mapNumber);
+					addSource(addExternalMap(mapName, mapNumber), kSourceVolume, resName, mapNumber);
 					break;
 				}
 			}

Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h	2010-06-15 12:09:51 UTC (rev 49810)
+++ scummvm/trunk/engines/sci/resource.h	2010-06-15 12:10:18 UTC (rev 49811)
@@ -322,7 +322,7 @@
 	 * Add a path to the resource manager's list of sources.
 	 * @return a pointer to the added source structure, or NULL if an error occurred.
 	 */
-	ResourceSource *addPatchDir(const char *path);
+	ResourceSource *addPatchDir(const Common::String &path);
 
 	ResourceSource *getVolume(ResourceSource *map, int volume_nr);
 
@@ -333,7 +333,7 @@
 	 * @param filename	The name of the source to add
 	 * @return A pointer to the added source structure, or NULL if an error occurred.
 	 */
-	ResourceSource *addSource(ResourceSource *map, ResSourceType type, const char *filename,
+	ResourceSource *addSource(ResourceSource *map, ResSourceType type, const Common::String &filename,
 	                          int number);
 
 	ResourceSource *addSource(ResourceSource *map, ResSourceType type,
@@ -345,7 +345,7 @@
 	 * @param volume_nr  The volume number the map starts at, 0 for <SCI2.1
 	 * @return		A pointer to the added source structure, or NULL if an error occurred.
 	 */
-	ResourceSource *addExternalMap(const char *file_name, int volume_nr = 0);
+	ResourceSource *addExternalMap(const Common::String &filename, int volume_nr = 0);
 
 	ResourceSource *addExternalMap(const Common::FSNode *mapFile, int volume_nr = 0);
 
@@ -355,7 +355,7 @@
 	 * @param resNr		The map resource number
 	 * @return A pointer to the added source structure, or NULL if an error occurred.
 	 */
-	ResourceSource *addInternalMap(const char *name, int resNr);
+	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

Modified: scummvm/trunk/engines/sci/resource_audio.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource_audio.cpp	2010-06-15 12:09:51 UTC (rev 49810)
+++ scummvm/trunk/engines/sci/resource_audio.cpp	2010-06-15 12:10:18 UTC (rev 49811)
@@ -433,7 +433,7 @@
 		return;
 	}
 
-	_audioMapSCI1 = addSource(NULL, kSourceExtAudioMap, fullname.c_str(), language);
+	_audioMapSCI1 = addSource(NULL, kSourceExtAudioMap, fullname, language);
 
 	// Search for audio volumes for this language and add them to the source list
 	Common::ArchiveMemberList files;
@@ -443,7 +443,7 @@
 		const char *dot = strrchr(name.c_str(), '.');
 		int number = atoi(dot + 1);
 
-		addSource(_audioMapSCI1, kSourceAudioVolume, name.c_str(), number);
+		addSource(_audioMapSCI1, kSourceAudioVolume, name, number);
 	}
 
 	scanNewSources();

Modified: scummvm/trunk/engines/sci/resource_intern.h
===================================================================
--- scummvm/trunk/engines/sci/resource_intern.h	2010-06-15 12:09:51 UTC (rev 49810)
+++ scummvm/trunk/engines/sci/resource_intern.h	2010-06-15 12:10:18 UTC (rev 49811)
@@ -56,7 +56,6 @@
 	const Common::String &getLocationName() const { return _name; }
 };
 
-
 } // End of namespace Sci
 
 #endif // SCI_RESOURCE_INTERN_H


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