diff options
author | Max Horn | 2006-04-23 17:39:31 +0000 |
---|---|---|
committer | Max Horn | 2006-04-23 17:39:31 +0000 |
commit | 4b6f90945bfc8ad6c51a46747a0c133393b1fa9b (patch) | |
tree | 3d470ebd52b587f9d3ae731ae00e9ffc209771c0 /engines | |
parent | 0d67640a58b044ade0605319e091df9b2f666e4a (diff) | |
download | scummvm-rg350-4b6f90945bfc8ad6c51a46747a0c133393b1fa9b.tar.gz scummvm-rg350-4b6f90945bfc8ad6c51a46747a0c133393b1fa9b.tar.bz2 scummvm-rg350-4b6f90945bfc8ad6c51a46747a0c133393b1fa9b.zip |
Modified openFile and openResourceFile to take a Common::String instead of a char pointer
svn-id: r22112
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/resource.cpp | 8 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 4 | ||||
-rw-r--r-- | engines/scumm/smush/chunk.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/sound.cpp | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index 6ee4820f07..2218943cda 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -115,7 +115,7 @@ void ScummEngine::openRoom(const int room) { VAR(VAR_CURRENTDISK) = diskNumber; // Try to open the file - result = openResourceFile(filename.c_str(), encByte); + result = openResourceFile(filename, encByte); if (result) { if (room == 0) @@ -185,7 +185,7 @@ void ScummEngine::readRoomsOffsets() { } } -bool ScummEngine::openFile(BaseScummFile &file, const char *filename, bool resourceFile) { +bool ScummEngine::openFile(BaseScummFile &file, const Common::String &filename, bool resourceFile) { bool result = false; if (!_containerFile.empty()) { @@ -204,8 +204,8 @@ bool ScummEngine::openFile(BaseScummFile &file, const char *filename, bool resou return result; } -bool ScummEngine::openResourceFile(const char *filename, byte encByte) { - debugC(DEBUG_GENERAL, "openResourceFile(%s)", filename); +bool ScummEngine::openResourceFile(const Common::String &filename, byte encByte) { + debugC(DEBUG_GENERAL, "openResourceFile(%s)", filename.c_str()); if (openFile(*_fileHandle, filename, true)) { _fileHandle->setEnc(encByte); diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index e9813d1333..dbf8154675 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -732,7 +732,7 @@ public: /** The name of the (macintosh/rescumm style) container file, if any. */ Common::String _containerFile; - bool openFile(BaseScummFile &file, const char *filename, bool resourceFile = false); // TODO: Use Common::String + bool openFile(BaseScummFile &file, const Common::String &filename, bool resourceFile = false); protected: int _resourceHeaderSize; @@ -748,7 +748,7 @@ protected: void deleteRoomOffsets(); virtual void readRoomsOffsets(); void askForDisk(const char *filename, int disknum); // TODO: Use Common::String - bool openResourceFile(const char *filename, byte encByte); // TODO: Use Common::String + bool openResourceFile(const Common::String &filename, byte encByte); // TODO: Use Common::String void loadPtrToResource(int type, int i, const byte *ptr); virtual void readResTypeList(int id, const char *name); diff --git a/engines/scumm/smush/chunk.cpp b/engines/scumm/smush/chunk.cpp index 04e8c06d4b..fd0abb8079 100644 --- a/engines/scumm/smush/chunk.cpp +++ b/engines/scumm/smush/chunk.cpp @@ -101,7 +101,7 @@ FileChunk::FileChunk(ScummFile *data, int offset) { FileChunk::FileChunk(const Common::String &name, int offset) { _data = new ScummFile(); _deleteData = true; - if (!g_scumm->openFile(*_data, name.c_str())) + if (!g_scumm->openFile(*_data, name)) error("FileChunk: Unable to open file %s", name.c_str()); _data->seek(offset, seek_start); diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 9dfeecc80b..df9041b34d 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -1018,7 +1018,7 @@ ScummFile *Sound::openSfxFile() { for (int i = 0; extensions[i].ext; ++i) { Common::String tmp(basename[j]); tmp += extensions[i].ext; - if (_vm->openFile(*file, tmp.c_str())) { + if (_vm->openFile(*file, tmp)) { _soundMode = extensions[i].mode; break; } |