From 4b6f90945bfc8ad6c51a46747a0c133393b1fa9b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 23 Apr 2006 17:39:31 +0000 Subject: Modified openFile and openResourceFile to take a Common::String instead of a char pointer svn-id: r22112 --- engines/scumm/resource.cpp | 8 ++++---- engines/scumm/scumm.h | 4 ++-- engines/scumm/smush/chunk.cpp | 2 +- engines/scumm/sound.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/scumm') 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; } -- cgit v1.2.3