aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMax Horn2010-06-15 12:10:18 +0000
committerMax Horn2010-06-15 12:10:18 +0000
commit793c04f43b3d75b4b6d1ff2a2a93f2a496c0065f (patch)
tree3bdb42141d74ed6d8db0033e251ab8d98bf74089 /engines/sci
parentdea38106f84873a62c4a342c564dbfe9f38ff480 (diff)
downloadscummvm-rg350-793c04f43b3d75b4b6d1ff2a2a93f2a496c0065f.tar.gz
scummvm-rg350-793c04f43b3d75b4b6d1ff2a2a93f2a496c0065f.tar.bz2
scummvm-rg350-793c04f43b3d75b4b6d1ff2a2a93f2a496c0065f.zip
SCI: Changed some 'const char *' to Common::String
svn-id: r49811
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/resource.cpp14
-rw-r--r--engines/sci/resource.h8
-rw-r--r--engines/sci/resource_audio.cpp4
-rw-r--r--engines/sci/resource_intern.h1
4 files changed, 13 insertions, 14 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 0d7e435aa0..f60c6a3c96 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -191,8 +191,8 @@ ResourceSource::~ResourceSource() {
// 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 @@ ResourceSource *ResourceManager::addExternalMap(const Common::FSNode *mapFile, i
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 @@ ResourceSource *ResourceManager::addSource(ResourceSource *map, ResSourceType ty
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 @@ int ResourceManager::addAppropriateSources() {
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 @@ int ResourceManager::addAppropriateSources() {
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 ResourceManager::addAppropriateSources() {
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;
}
}
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index 7677209d2d..9b498b59de 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -322,7 +322,7 @@ protected:
* 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 @@ protected:
* @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 @@ protected:
* @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 @@ protected:
* @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
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index f7f5077455..9721a884dc 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -433,7 +433,7 @@ void ResourceManager::setAudioLanguage(int language) {
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 @@ void ResourceManager::setAudioLanguage(int language) {
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();
diff --git a/engines/sci/resource_intern.h b/engines/sci/resource_intern.h
index 60cf1b99a4..ceae474b39 100644
--- a/engines/sci/resource_intern.h
+++ b/engines/sci/resource_intern.h
@@ -56,7 +56,6 @@ public:
const Common::String &getLocationName() const { return _name; }
};
-
} // End of namespace Sci
#endif // SCI_RESOURCE_INTERN_H