diff options
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/kyra/resource.cpp | 2 | ||||
| -rw-r--r-- | engines/queen/queen.cpp | 2 | ||||
| -rw-r--r-- | engines/saga/game.cpp | 2 | ||||
| -rw-r--r-- | engines/scumm/file.cpp | 20 | ||||
| -rw-r--r-- | engines/scumm/file.h | 16 | ||||
| -rw-r--r-- | engines/scumm/resource.cpp | 2 | ||||
| -rw-r--r-- | engines/simon/game.cpp | 2 |
7 files changed, 23 insertions, 23 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 42c8d3894f..27388aaa06 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -239,7 +239,7 @@ PAKFile::PAKFile(const Common::String& file, bool isAmiga) { uint8 *buffer = 0; _open = false; - if (!pakfile.open(file.c_str())) { + if (!pakfile.open(file)) { debug(3, "couldn't open pakfile '%s'\n", file.c_str()); return; } diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 7c0d767912..d1219fb59e 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -101,7 +101,7 @@ DetectedGameList Engine_QUEEN_detectGames(const FSList &fslist) { if (0 == scumm_stricmp("queen.1", gameName) || 0 == scumm_stricmp("queen.1c", gameName)) { Common::File dataFile; - dataFile.open(file->path().c_str()); + dataFile.open(file->path()); assert(dataFile.isOpen()); if (0 == scumm_stricmp("queen.1", gameName)) { //an unmodified file diff --git a/engines/saga/game.cpp b/engines/saga/game.cpp index a8bac4bddd..4154173f33 100644 --- a/engines/saga/game.cpp +++ b/engines/saga/game.cpp @@ -1556,7 +1556,7 @@ static int detectGame(const FSList *fslist, Common::Language language, Common::P tstr.toLowercase(); if(!filesMD5.contains(tstr)) { - if (testFile.open(file->_key.c_str())) { + if (testFile.open(file->_key)) { testFile.close(); if (Common::md5_file(file->_key.c_str(), md5sum, NULL, FILE_MD5_BYTES)) { diff --git a/engines/scumm/file.cpp b/engines/scumm/file.cpp index 7a17d8c97b..efc23e53c8 100644 --- a/engines/scumm/file.cpp +++ b/engines/scumm/file.cpp @@ -56,7 +56,7 @@ void ScummFile::resetSubfile() { seek(0, SEEK_SET); } -bool ScummFile::open(const char *filename, AccessMode mode) { +bool ScummFile::open(const Common::String &filename, AccessMode mode) { if (File::open(filename, mode)) { resetSubfile(); return true; @@ -65,7 +65,7 @@ bool ScummFile::open(const char *filename, AccessMode mode) { } } -bool ScummFile::openSubFile(const char *filename) { +bool ScummFile::openSubFile(const Common::String &filename) { assert(isOpen()); // Disable the XOR encryption and reset any current subfile range @@ -112,7 +112,7 @@ bool ScummFile::openSubFile(const char *filename) { return false; } - if (scumm_stricmp(file_name, filename) == 0) { + if (scumm_stricmp(file_name, filename.c_str()) == 0) { // We got a match! setSubfileRange(file_off, file_len); return true; @@ -1380,11 +1380,11 @@ bool ScummNESFile::generateIndex() { return true; } -bool ScummNESFile::open(const char *filename, AccessMode mode) { +bool ScummNESFile::open(const Common::String &filename, AccessMode mode) { uint8 md5sum[16]; if (_ROMset == kROMsetNum) { - if (Common::md5_file(filename, md5sum)) { + if (Common::md5_file(filename.c_str(), md5sum)) { char md5str[32+1]; for (int j = 0; j < 16; j++) { sprintf(md5str + j*2, "%02x", (int)md5sum[j]); @@ -1439,10 +1439,10 @@ void ScummNESFile::close() { File::close(); } -bool ScummNESFile::openSubFile(const char *filename) { +bool ScummNESFile::openSubFile(const Common::String &filename) { assert(isOpen()); - const char *ext = strrchr(filename, '.'); + const char *ext = strrchr(filename.c_str(), '.'); char resNum[3]; int res; @@ -1556,7 +1556,7 @@ bool ScummC64File::openDisk(char num) { return true; } -bool ScummC64File::open(const char *filename, AccessMode mode) { +bool ScummC64File::open(const Common::String &filename, AccessMode mode) { uint16 signature; // check signature @@ -1708,10 +1708,10 @@ void ScummC64File::close() { File::close(); } -bool ScummC64File::openSubFile(const char *filename) { +bool ScummC64File::openSubFile(const Common::String &filename) { assert(isOpen()); - const char *ext = strrchr(filename, '.'); + const char *ext = strrchr(filename.c_str(), '.'); char resNum[3]; int res; diff --git a/engines/scumm/file.h b/engines/scumm/file.h index fa5e4d35a5..2fbf9f01e4 100644 --- a/engines/scumm/file.h +++ b/engines/scumm/file.h @@ -31,8 +31,8 @@ class BaseScummFile : public Common::File { public: virtual void setEnc(byte value) = 0; - virtual bool open(const char *filename, AccessMode mode = kFileReadMode) = 0; - virtual bool openSubFile(const char *filename) = 0; + virtual bool open(const Common::String &filename, AccessMode mode = kFileReadMode) = 0; + virtual bool openSubFile(const Common::String &filename) = 0; virtual bool eof() = 0; virtual uint32 pos() = 0; @@ -54,8 +54,8 @@ public: void setSubfileRange(uint32 start, uint32 len); void resetSubfile(); - bool open(const char *filename, AccessMode mode = kFileReadMode); - bool openSubFile(const char *filename); + bool open(const Common::String &filename, AccessMode mode = kFileReadMode); + bool openSubFile(const Common::String &filename); bool eof(); uint32 pos(); @@ -96,8 +96,8 @@ public: ScummNESFile(); void setEnc(byte value); - bool open(const char *filename, AccessMode mode = kFileReadMode); - bool openSubFile(const char *filename); + bool open(const Common::String &filename, AccessMode mode = kFileReadMode); + bool openSubFile(const Common::String &filename); void close(); bool eof() { return _stream->eos(); } @@ -142,8 +142,8 @@ public: ScummC64File(const char *disk1, const char *disk2, bool maniac); void setEnc(byte value); - bool open(const char *filename, AccessMode mode = kFileReadMode); - bool openSubFile(const char *filename); + bool open(const Common::String &filename, AccessMode mode = kFileReadMode); + bool openSubFile(const Common::String &filename); void close(); bool eof() { return _stream->eos(); } diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index f54b80b239..d8eba584ee 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -250,7 +250,7 @@ bool ScummEngine::openFile(BaseScummFile &file, const char *filename, bool resou char name[128]; file.close(); - file.open(_containerFile.c_str()); + file.open(_containerFile); assert(file.isOpen()); strncpy(name, filename, 128); diff --git a/engines/simon/game.cpp b/engines/simon/game.cpp index b8b4cb8788..9e83b4d9ca 100644 --- a/engines/simon/game.cpp +++ b/engines/simon/game.cpp @@ -1305,7 +1305,7 @@ static int detectGame(const FSList *fslist, Common::Language language, Common::P tstr.toLowercase(); if(!filesMD5.contains(tstr)) { - if (testFile.open(file->_key.c_str())) { + if (testFile.open(file->_key)) { testFile.close(); if (Common::md5_file(file->_key.c_str(), md5sum, NULL, FILE_MD5_BYTES)) { |
