diff options
Diffstat (limited to 'engines')
31 files changed, 86 insertions, 86 deletions
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 86422a7d01..fd81fc0ca0 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -898,7 +898,7 @@ SaveStateList AgiMetaEngine::listSaves(const char *target) const { Common::String pattern = target; pattern += ".???"; - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -907,7 +907,7 @@ SaveStateList AgiMetaEngine::listSaves(const char *target) const { int slotNum = atoi(file->c_str() + file->size() - 3); if (slotNum >= 0 && slotNum <= 999) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { uint32 type = in->readUint32BE(); if (type == AGIflag) diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index 23251fc9e3..c0af375eb5 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -183,7 +183,7 @@ SaveStateList AgosMetaEngine::listSaves(const char *target) const { Common::String pattern = target; pattern += ".???"; - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -192,7 +192,7 @@ SaveStateList AgosMetaEngine::listSaves(const char *target) const { int slotNum = atoi(file->c_str() + file->size() - 3); if (slotNum >= 0 && slotNum <= 999) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { saveDesc = file->c_str(); saveList.push_back(SaveStateDescriptor(slotNum, saveDesc)); diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 7da14c5bc7..f9de74b730 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -569,13 +569,13 @@ SaveStateList CineMetaEngine::listSaves(const char *target) const { Common::String pattern = target; pattern += ".?"; - Common::StringList filenames = saveFileMan->listSavefiles(pattern.c_str()); + Common::StringList filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); Common::StringList::const_iterator file = filenames.begin(); Common::String filename = target; filename += ".dir"; - Common::InSaveFile *in = saveFileMan->openForLoading(filename.c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(filename); if (in) { int8 ch; char saveDesc[20]; diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index 9551878732..cf00f3c312 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -206,7 +206,7 @@ SaveStateList CruiseMetaEngine::listSaves(const char *target) const { Common::StringList filenames; Common::String pattern("cruise.s??"); - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -215,7 +215,7 @@ SaveStateList CruiseMetaEngine::listSaves(const char *target) const { int slotNum = atoi(file->c_str() + file->size() - 2); if (slotNum >= 0 && slotNum <= 99) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { Cruise::CruiseSavegameHeader header; Cruise::readSavegameHeader(in, header); diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index be717dd0df..a2ba4a0aed 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -230,7 +230,7 @@ void GroovieMetaEngine::removeSaveState(const char *target, int slot) const { } Common::String filename = SaveLoad::getSlotSaveName(target, slot); - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } SaveStateDescriptor GroovieMetaEngine::querySaveMetaInfos(const char *target, int slot) const { diff --git a/engines/groovie/saveload.cpp b/engines/groovie/saveload.cpp index 0d719ed599..ec182af3c5 100644 --- a/engines/groovie/saveload.cpp +++ b/engines/groovie/saveload.cpp @@ -50,7 +50,7 @@ SaveStateList SaveLoad::listValidSaves(const Common::String &target) { // Get the list of savefiles Common::String pattern = target + ".00?"; - Common::StringList savefiles = g_system->getSavefileManager()->listSavefiles(pattern.c_str()); + Common::StringList savefiles = g_system->getSavefileManager()->listSavefiles(pattern); // Sort the list of filenames sort(savefiles.begin(), savefiles.end()); @@ -80,7 +80,7 @@ Common::InSaveFile *SaveLoad::openForLoading(const Common::String &target, int s // Open the savefile Common::String savename = getSlotSaveName(target, slot); - Common::InSaveFile *savefile = g_system->getSavefileManager()->openForLoading(savename.c_str()); + Common::InSaveFile *savefile = g_system->getSavefileManager()->openForLoading(savename); if (!savefile) { return NULL; } @@ -154,7 +154,7 @@ Common::OutSaveFile *SaveLoad::openForSaving(const Common::String &target, int s // Open the savefile Common::String savename = getSlotSaveName(target, slot); - Common::OutSaveFile *savefile = g_system->getSavefileManager()->openForSaving(savename.c_str()); + Common::OutSaveFile *savefile = g_system->getSavefileManager()->openForSaving(savename); if (!savefile) { return NULL; } diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 7c1280cfde..364c856b67 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -1192,7 +1192,7 @@ SaveStateList KyraMetaEngine::listSaves(const char *target) const { pattern += ".???"; Common::StringList filenames; - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -1201,7 +1201,7 @@ SaveStateList KyraMetaEngine::listSaves(const char *target) const { int slotNum = atoi(file->c_str() + file->size() - 3); if (slotNum >= 0 && slotNum <= 999) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { if (Kyra::KyraEngine_v1::readSaveHeader(in, false, header) == Kyra::KyraEngine_v1::kRSHENoError) { // Workaround for old savegames using 'German' as description for kyra3 start savegame (slot 0) @@ -1226,12 +1226,12 @@ void KyraMetaEngine::removeSaveState(const char *target, int slot) const { return; Common::String filename = Kyra::KyraEngine_v1::getSavegameFilename(target, slot); - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } SaveStateDescriptor KyraMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String filename = Kyra::KyraEngine_v1::getSavegameFilename(target, slot); - Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename.c_str()); + Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename); if (in) { Kyra::KyraEngine_v1::SaveHeader header; diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index f2661ab4b4..faea2c9a72 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -298,7 +298,7 @@ int GUI::redrawShadedButtonCallback(Button *button) { void GUI::updateSaveList() { Common::String pattern = _vm->_targetName + ".???"; - Common::StringList saveFileList = _vm->_saveFileMan->listSavefiles(pattern.c_str()); + Common::StringList saveFileList = _vm->_saveFileMan->listSavefiles(pattern); _saveSlots.clear(); for (Common::StringList::const_iterator i = saveFileList.begin(); i != saveFileList.end(); ++i) { diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index ed3082c727..7e3d2b5afb 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -727,7 +727,7 @@ int GUI_v2::deleteMenu(Button *caller) { break; Common::String oldName = _vm->getSavegameFilename(*i); Common::String newName = _vm->getSavegameFilename(*i-1); - _vm->_saveFileMan->renameSavefile(oldName.c_str(), newName.c_str()); + _vm->_saveFileMan->renameSavefile(oldName, newName); } _saveMenu.menuNameId = _vm->gameFlags().isTalkie ? 9 : 17; return 0; diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index 51df16b8d1..268c212008 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -221,7 +221,7 @@ SaveStateList LureMetaEngine::listSaves(const char *target) const { Common::String saveDesc; Common::String pattern = "lure.???"; - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -230,7 +230,7 @@ SaveStateList LureMetaEngine::listSaves(const char *target) const { int slotNum = atoi(file->c_str() + file->size() - 3); if (slotNum >= 0 && slotNum <= 999) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { saveDesc = Lure::getSaveName(in); saveList.push_back(SaveStateDescriptor(slotNum, saveDesc)); @@ -251,7 +251,7 @@ void LureMetaEngine::removeSaveState(const char *target, int slot) const { Common::String filename = target; filename += extension; - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } #if PLUGIN_ENABLED_DYNAMIC(LURE) diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 6e5be94c81..ec483bad84 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -286,7 +286,7 @@ SaveStateList ParallactionMetaEngine::listSaves(const char *target) const { Common::String pattern = target; pattern += ".0??"; - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -295,7 +295,7 @@ SaveStateList ParallactionMetaEngine::listSaves(const char *target) const { int slotNum = atoi(file->c_str() + file->size() - 2); if (slotNum >= 0 && slotNum <= 99) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { Common::String saveDesc = in->readLine(); saveList.push_back(SaveStateDescriptor(slotNum, saveDesc)); @@ -316,7 +316,7 @@ void ParallactionMetaEngine::removeSaveState(const char *target, int slot) const Common::String filename = target; filename += extension; - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } #if PLUGIN_ENABLED_DYNAMIC(PARALLACTION) diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 784fc8ac8a..5db0e732ee 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -88,12 +88,12 @@ Common::String SaveLoad::genSaveFileName(uint slot) { Common::InSaveFile *SaveLoad::getInSaveFile(uint slot) { Common::String name = genSaveFileName(slot); - return _saveFileMan->openForLoading(name.c_str()); + return _saveFileMan->openForLoading(name); } Common::OutSaveFile *SaveLoad::getOutSaveFile(uint slot) { Common::String name = genSaveFileName(slot); - return _saveFileMan->openForSaving(name.c_str()); + return _saveFileMan->openForSaving(name); } @@ -307,7 +307,7 @@ void SaveLoadChooser::reflowLayout() { int SaveLoad::buildSaveFileList(Common::StringList& l) { Common::String pattern = _saveFilePrefix + ".???"; - Common::StringList filenames = _saveFileMan->listSavefiles(pattern.c_str()); + Common::StringList filenames = _saveFileMan->listSavefiles(pattern); Common::String s; @@ -439,7 +439,7 @@ void SaveLoad_ns::renameOldSavefiles() { for (i = 0; i < NUM_SAVESLOTS; i++) { exists[i] = false; Common::String name = genOldSaveFileName(i); - Common::InSaveFile *f = _saveFileMan->openForLoading(name.c_str()); + Common::InSaveFile *f = _saveFileMan->openForLoading(name); if (f) { exists[i] = true; num++; @@ -468,7 +468,7 @@ void SaveLoad_ns::renameOldSavefiles() { if (exists[i]) { Common::String oldName = genOldSaveFileName(i); Common::String newName = genSaveFileName(i); - if (_saveFileMan->renameSavefile(oldName.c_str(), newName.c_str())) { + if (_saveFileMan->renameSavefile(oldName, newName)) { success++; } else { warning("Error %i (%s) occurred while renaming %s to %s", _saveFileMan->getError(), diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 6d7f9deda4..3c984c20fa 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -141,7 +141,7 @@ SaveStateList QueenMetaEngine::listSaves(const char *target) const { char saveDesc[32]; Common::String pattern("queen.s??"); - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -150,7 +150,7 @@ SaveStateList QueenMetaEngine::listSaves(const char *target) const { int slotNum = atoi(file->c_str() + file->size() - 2); if (slotNum >= 0 && slotNum <= 99) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { for (int i = 0; i < 4; i++) in->readUint32BE(); @@ -171,7 +171,7 @@ void QueenMetaEngine::removeSaveState(const char *target, int slot) const { Common::String filename = target; filename += extension; - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } Common::Error QueenMetaEngine::createInstance(OSystem *syst, Engine **engine) const { diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index d15e18e123..b3600b14c4 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -193,7 +193,7 @@ SaveStateList SagaMetaEngine::listSaves(const char *target) const { Common::String pattern = target; pattern += ".s??"; - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -203,7 +203,7 @@ SaveStateList SagaMetaEngine::listSaves(const char *target) const { slotNum = atoi(file->c_str() + file->size() - 2); if (slotNum >= 0 && slotNum <= 99) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { for (int i = 0; i < 3; i++) in->readUint32BE(); @@ -226,7 +226,7 @@ void SagaMetaEngine::removeSaveState(const char *target, int slot) const { Common::String filename = target; filename += extension; - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } SaveStateDescriptor SagaMetaEngine::querySaveMetaInfos(const char *target, int slot) const { diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 7e0cb0d451..84b814e846 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -116,7 +116,7 @@ void file_open(EngineState *s, const char *filename, int mode) { if (mode == _K_FILE_MODE_OPEN_OR_FAIL) { // Try to open file, abort if not possible - inFile = saveFileMan->openForLoading(wrappedName.c_str()); + inFile = saveFileMan->openForLoading(wrappedName); // If no matching savestate exists: fall back to reading from a regular file if (!inFile) inFile = SearchMan.createReadStreamForMember(filename); @@ -124,7 +124,7 @@ void file_open(EngineState *s, const char *filename, int mode) { warning("file_open(_K_FILE_MODE_OPEN_OR_FAIL) failed to open file '%s'", filename); } else if (mode == _K_FILE_MODE_CREATE) { // Create the file, destroying any content it might have had - outFile = saveFileMan->openForSaving(wrappedName.c_str()); + outFile = saveFileMan->openForSaving(wrappedName); if (!outFile) warning("file_open(_K_FILE_MODE_CREATE) failed to create file '%s'", filename); } else if (mode == _K_FILE_MODE_OPEN_OR_CREATE) { @@ -331,7 +331,7 @@ void delete_savegame(EngineState *s, int savedir_nr) { sciprintf("Deleting savegame '%s'\n", filename.c_str()); Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); - saveFileMan->removeSavefile(filename.c_str()); + saveFileMan->removeSavefile(filename); } enum { @@ -444,12 +444,12 @@ void listSavegames(Common::Array<SavegameDesc> &saves) { Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); // Load all saves - Common::StringList saveNames = saveFileMan->listSavefiles(((SciEngine *)g_engine)->getSavegamePattern().c_str()); + Common::StringList saveNames = saveFileMan->listSavefiles(((SciEngine *)g_engine)->getSavegamePattern()); for (Common::StringList::const_iterator iter = saveNames.begin(); iter != saveNames.end(); ++iter) { Common::String filename = *iter; Common::SeekableReadStream *in; - if ((in = saveFileMan->openForLoading(filename.c_str()))) { + if ((in = saveFileMan->openForLoading(filename))) { SavegameMetadata meta; if (!get_savegame_metadata(in, &meta)) { // invalid @@ -490,7 +490,7 @@ reg_t kCheckSaveGame(EngineState *s, int funct_nr, int argc, reg_t *argv) { Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); Common::String filename = ((Sci::SciEngine*)g_engine)->getSavegameName(savedir_nr); Common::SeekableReadStream *in; - if ((in = saveFileMan->openForLoading(filename.c_str()))) { + if ((in = saveFileMan->openForLoading(filename))) { // found a savegame file SavegameMetadata meta; @@ -525,7 +525,7 @@ reg_t kGetSaveFiles(EngineState *s, int funct_nr, int argc, reg_t *argv) { for (uint i = 0; i < saves.size(); i++) { Common::String filename = ((Sci::SciEngine*)g_engine)->getSavegameName(saves[i].id); Common::SeekableReadStream *in; - if ((in = saveFileMan->openForLoading(filename.c_str()))) { + if ((in = saveFileMan->openForLoading(filename))) { // found a savegame file SavegameMetadata meta; @@ -605,7 +605,7 @@ reg_t kSaveGame(EngineState *s, int funct_nr, int argc, reg_t *argv) { Common::String filename = ((Sci::SciEngine*)g_engine)->getSavegameName(savedir_id); Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); Common::OutSaveFile *out; - if (!(out = saveFileMan->openForSaving(filename.c_str()))) { + if (!(out = saveFileMan->openForSaving(filename))) { warning("Error opening savegame \"%s\" for writing", filename.c_str()); s->r_acc = NULL_REG; return NULL_REG; @@ -646,7 +646,7 @@ reg_t kRestoreGame(EngineState *s, int funct_nr, int argc, reg_t *argv) { Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); Common::String filename = ((Sci::SciEngine*)g_engine)->getSavegameName(savedir_nr); Common::SeekableReadStream *in; - if ((in = saveFileMan->openForLoading(filename.c_str()))) { + if ((in = saveFileMan->openForLoading(filename))) { // found a savegame file EngineState *newstate = gamestate_restore(s, in); @@ -781,7 +781,7 @@ reg_t kFileIO(EngineState *s, int funct_nr, int argc, reg_t *argv) { Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); const Common::String wrappedName = ((Sci::SciEngine*)g_engine)->wrapFilename(name); - saveFileMan->removeSavefile(wrappedName.c_str()); + saveFileMan->removeSavefile(wrappedName); // TODO/FIXME: Should we return something (like, a bool indicating // whether deleting the save succeeded or failed)? break; diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index c73a21e067..4e4175876b 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -994,7 +994,7 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const { Common::String pattern = target; pattern += ".s??"; - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -1003,7 +1003,7 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const { int slotNum = atoi(file->c_str() + file->size() - 2); if (slotNum >= 0 && slotNum <= 99) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { Scumm::getSavegameName(in, saveDesc, 0); // FIXME: heversion?!? saveList.push_back(SaveStateDescriptor(slotNum, saveDesc)); @@ -1017,12 +1017,12 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const { void ScummMetaEngine::removeSaveState(const char *target, int slot) const { Common::String filename = ScummEngine::makeSavegameName(target, slot, false); - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } SaveStateDescriptor ScummMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String filename = ScummEngine::makeSavegameName(target, slot, false); - Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename.c_str()); + Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename); if (!in) return SaveStateDescriptor(); diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 4fd1b40134..cef13341b5 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -158,7 +158,7 @@ bool ScummEngine::saveState(int slot, bool compat) { } else { filename = makeSavegameName(slot, compat); } - if (!(out = _saveFileMan->openForSaving(filename.c_str()))) + if (!(out = _saveFileMan->openForSaving(filename))) return false; saveFailed = false; @@ -222,7 +222,7 @@ bool ScummEngine_v4::savePreparedSavegame(int slot, char *desc) { // open savegame file if (success) { filename = makeSavegameName(slot, false); - if (!(out = _saveFileMan->openForSaving(filename.c_str()))) { + if (!(out = _saveFileMan->openForSaving(filename))) { success = false; } } @@ -284,7 +284,7 @@ bool ScummEngine::loadState(int slot, bool compat) { } else { filename = makeSavegameName(slot, compat); } - if (!(in = _saveFileMan->openForLoading(filename.c_str()))) + if (!(in = _saveFileMan->openForLoading(filename))) return false; if (!loadSaveGameHeader(in, hdr)) { @@ -562,7 +562,7 @@ void ScummEngine::listSavegames(bool *marks, int num) { prefix.setChar('*', prefix.size()-2); prefix.setChar(0, prefix.size()-1); memset(marks, false, num * sizeof(bool)); //assume no savegames for this title - files = _saveFileMan->listSavefiles(prefix.c_str()); + files = _saveFileMan->listSavefiles(prefix); for (Common::StringList::const_iterator file = files.begin(); file != files.end(); ++file) { //Obtain the last 2 digits of the filename, since they correspond to the save slot @@ -584,7 +584,7 @@ bool ScummEngine::getSavegameName(int slot, Common::String &desc) { desc.clear(); Common::String filename = makeSavegameName(slot, false); - in = _saveFileMan->openForLoading(filename.c_str()); + in = _saveFileMan->openForLoading(filename); if (in) { result = Scumm::getSavegameName(in, desc, _game.heversion); delete in; @@ -626,7 +626,7 @@ Graphics::Surface *ScummEngine::loadThumbnailFromSlot(const char *target, int sl return 0; Common::String filename = ScummEngine::makeSavegameName(target, slot, false); - if (!(in = g_system->getSavefileManager()->openForLoading(filename.c_str()))) { + if (!(in = g_system->getSavefileManager()->openForLoading(filename))) { return 0; } @@ -664,7 +664,7 @@ bool ScummEngine::loadInfosFromSlot(const char *target, int slot, InfoStuff *stu return 0; Common::String filename = makeSavegameName(target, slot, false); - if (!(in = g_system->getSavefileManager()->openForLoading(filename.c_str()))) { + if (!(in = g_system->getSavefileManager()->openForLoading(filename))) { return false; } diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp index a8702a5d79..3075b85207 100644 --- a/engines/scumm/script_v4.cpp +++ b/engines/scumm/script_v4.cpp @@ -363,7 +363,7 @@ void ScummEngine_v4::saveIQPoints() { Common::OutSaveFile *file; Common::String filename = _targetName + ".iq"; - file = _saveFileMan->openForSaving(filename.c_str()); + file = _saveFileMan->openForSaving(filename); if (file != NULL) { byte *ptr = getResourceAddress(rtString, STRINGID_IQ_EPISODE); if (ptr) { @@ -379,7 +379,7 @@ void ScummEngine_v4::loadIQPoints(byte *ptr, int size) { Common::InSaveFile *file; Common::String filename = _targetName + ".iq"; - file = _saveFileMan->openForLoading(filename.c_str()); + file = _saveFileMan->openForLoading(filename); if (file != NULL) { byte *tmp = (byte*)malloc(size); int nread = file->read(tmp, size); @@ -464,7 +464,7 @@ void ScummEngine_v4::o4_saveLoadGame() { listSavegames(avail_saves, ARRAYSIZE(avail_saves)); Common::String filename = makeSavegameName(slot, false); - if (avail_saves[slot] && (file = _saveFileMan->openForLoading(filename.c_str()))) { + if (avail_saves[slot] && (file = _saveFileMan->openForLoading(filename))) { result = 6; // save file exists delete file; } else diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index 45fe6a9022..a0d012f158 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -1756,7 +1756,7 @@ void ScummEngine_v5::o5_roomOps() { error("SO_SAVE_STRING: Unsupported filename %s\n", filename.c_str()); } - Common::OutSaveFile *file = _saveFileMan->openForSaving(filename.c_str()); + Common::OutSaveFile *file = _saveFileMan->openForSaving(filename); if (file != NULL) { byte *ptr; ptr = getResourceAddress(rtString, a); @@ -1781,7 +1781,7 @@ void ScummEngine_v5::o5_roomOps() { error("SO_LOAD_STRING: Unsupported filename %s\n", filename.c_str()); } - Common::InSaveFile *file = _saveFileMan->openForLoading(filename.c_str()); + Common::InSaveFile *file = _saveFileMan->openForLoading(filename); if (file != NULL) { byte *ptr; int len = 256, cnt = 0; diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index 3f01177cec..55c61b8665 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -210,7 +210,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const { ext.toUppercase(); if (isdigit(ext[0]) && isdigit(ext[1]) && isdigit(ext[2])){ int slotNum = atoi(ext.c_str()); - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { saveList.push_back(SaveStateDescriptor(slotNum+1, savenames[slotNum])); delete in; diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index 3ff943a3f0..756ce3a5cc 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -791,7 +791,7 @@ bool Control::restoreFromFile(void) { void Control::readSavegameDescriptions(void) { char saveName[40]; Common::String pattern = "sword1.???"; - Common::StringList filenames = _saveFileMan->listSavefiles(pattern.c_str()); + Common::StringList filenames = _saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) _saveNames.clear(); @@ -809,7 +809,7 @@ void Control::readSavegameDescriptions(void) { if (slotNum >= 0 && slotNum <= 999) { num++; - Common::InSaveFile *in = _saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = _saveFileMan->openForLoading(*file); if (in) { in->readUint32LE(); // header in->read(saveName, 40); @@ -847,7 +847,7 @@ int Control::displayMessage(const char *altButton, const char *message, ...) { bool Control::savegamesExist(void) { Common::String pattern = "sword1.???"; - Common::StringList saveNames = _saveFileMan->listSavefiles(pattern.c_str()); + Common::StringList saveNames = _saveFileMan->listSavefiles(pattern); return saveNames.size() > 0; } diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp index c51d311e16..d78c6259f9 100644 --- a/engines/sword1/detection.cpp +++ b/engines/sword1/detection.cpp @@ -221,7 +221,7 @@ SaveStateList SwordMetaEngine::listSaves(const char *target) const { slotNum = atoi(file->c_str() + file->size() - 3); if (slotNum >= 0 && slotNum <= 999) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { in->readUint32LE(); // header in->read(saveName, 40); diff --git a/engines/sword2/saveload.cpp b/engines/sword2/saveload.cpp index 106bb97275..253aad5644 100644 --- a/engines/sword2/saveload.cpp +++ b/engines/sword2/saveload.cpp @@ -389,7 +389,7 @@ uint32 Sword2Engine::getSaveDescription(uint16 slotNo, byte *description) { bool Sword2Engine::saveExists() { Common::String pattern = _targetName + ".???"; - Common::StringList filenames = _saveFileMan->listSavefiles(pattern.c_str()); + Common::StringList filenames = _saveFileMan->listSavefiles(pattern); return !filenames.empty(); } diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index d0e7e61ef6..c840a50f0a 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -188,7 +188,7 @@ SaveStateList Sword2MetaEngine::listSaves(const char *target) const { Common::String pattern = target; pattern += ".???"; - filenames = saveFileMan->listSavefiles(pattern.c_str()); + filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -197,7 +197,7 @@ SaveStateList Sword2MetaEngine::listSaves(const char *target) const { int slotNum = atoi(file->c_str() + file->size() - 3); if (slotNum >= 0 && slotNum <= 999) { - Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str()); + Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { in->readUint32LE(); in->read(saveDesc, SAVE_DESCRIPTION_LEN); @@ -219,7 +219,7 @@ void Sword2MetaEngine::removeSaveState(const char *target, int slot) const { Common::String filename = target; filename += extension; - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } Common::Error Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) const { diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 2bcf45e582..a36c35f10e 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -569,7 +569,7 @@ extern bool MoviePlaying(); SaveStateList TinselMetaEngine::listSaves(const char *target) const { Common::String pattern = target; pattern = pattern + ".???"; - Common::StringList files = g_system->getSavefileManager()->listSavefiles(pattern.c_str()); + Common::StringList files = g_system->getSavefileManager()->listSavefiles(pattern); sort(files.begin(), files.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; @@ -579,7 +579,7 @@ SaveStateList TinselMetaEngine::listSaves(const char *target) const { slotNum = atoi(file->c_str() + file->size() - 3); const Common::String &fname = *file; - Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fname.c_str()); + Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fname); if (in) { in->readUint32LE(); // skip id in->readUint32LE(); // skip size diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index 4d305e15cf..62bcc732a8 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -309,7 +309,7 @@ int getList(Common::SaveFileManager *saveFileMan, const Common::String &target) int i; const Common::String pattern = target + ".???"; - Common::StringList files = saveFileMan->listSavefiles(pattern.c_str()); + Common::StringList files = saveFileMan->listSavefiles(pattern); numSfiles = 0; @@ -318,7 +318,7 @@ int getList(Common::SaveFileManager *saveFileMan, const Common::String &target) break; const Common::String &fname = *file; - Common::InSaveFile *f = saveFileMan->openForLoading(fname.c_str()); + Common::InSaveFile *f = saveFileMan->openForLoading(fname); if (f == NULL) { continue; } diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index dcaab80d6e..75bc5c2a6e 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -168,7 +168,7 @@ bool ToucheMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGa SaveStateList ToucheMetaEngine::listSaves(const char *target) const { Common::String pattern = Touche::generateGameStateFileName(target, 0, true); - Common::StringList filenames = g_system->getSavefileManager()->listSavefiles(pattern.c_str()); + Common::StringList filenames = g_system->getSavefileManager()->listSavefiles(pattern); bool slotsTable[Touche::kMaxSaveStates]; memset(slotsTable, 0, sizeof(slotsTable)); SaveStateList saveList; @@ -181,7 +181,7 @@ SaveStateList ToucheMetaEngine::listSaves(const char *target) const { for (int slot = 0; slot < Touche::kMaxSaveStates; ++slot) { if (slotsTable[slot]) { Common::String file = Touche::generateGameStateFileName(target, slot); - Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(file.c_str()); + Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(file); if (in) { char description[64]; Touche::readGameStateDescription(in, description, sizeof(description) - 1); @@ -201,7 +201,7 @@ int ToucheMetaEngine::getMaximumSaveSlot() const { void ToucheMetaEngine::removeSaveState(const char *target, int slot) const { Common::String filename = Touche::generateGameStateFileName(target, slot); - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } #if PLUGIN_ENABLED_DYNAMIC(TOUCHE) diff --git a/engines/touche/menu.cpp b/engines/touche/menu.cpp index 6085e623fd..abc7944ccc 100644 --- a/engines/touche/menu.cpp +++ b/engines/touche/menu.cpp @@ -377,11 +377,11 @@ void ToucheEngine::handleOptions(int forceDisplay) { menuData.saveLoadDescriptionsTable[i][0] = 0; } Common::String gameStateFileName = generateGameStateFileName(_targetName.c_str(), 0, true); - Common::StringList filenames = _saveFileMan->listSavefiles(gameStateFileName.c_str()); + Common::StringList filenames = _saveFileMan->listSavefiles(gameStateFileName); for (Common::StringList::const_iterator it = filenames.begin(); it != filenames.end(); ++it) { int i = getGameStateFileSlot(it->c_str()); if (i >= 0 && i < kMaxSaveStates) { - Common::InSaveFile *f = _saveFileMan->openForLoading(it->c_str()); + Common::InSaveFile *f = _saveFileMan->openForLoading(*it); if (f) { readGameStateDescription(f, menuData.saveLoadDescriptionsTable[i], 32); delete f; diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp index daf9d25ce8..69b8f9ba43 100644 --- a/engines/touche/saveload.cpp +++ b/engines/touche/saveload.cpp @@ -324,7 +324,7 @@ void ToucheEngine::loadGameStateData(Common::ReadStream *stream) { Common::Error ToucheEngine::saveGameState(int num, const char *description) { bool saveOk = false; Common::String gameStateFileName = generateGameStateFileName(_targetName.c_str(), num); - Common::OutSaveFile *f = _saveFileMan->openForSaving(gameStateFileName.c_str()); + Common::OutSaveFile *f = _saveFileMan->openForSaving(gameStateFileName); if (f) { f->writeUint16LE(kCurrentGameStateVersion); f->writeUint16LE(0); @@ -347,7 +347,7 @@ Common::Error ToucheEngine::saveGameState(int num, const char *description) { Common::Error ToucheEngine::loadGameState(int num) { bool loadOk = false; Common::String gameStateFileName = generateGameStateFileName(_targetName.c_str(), num); - Common::InSaveFile *f = _saveFileMan->openForLoading(gameStateFileName.c_str()); + Common::InSaveFile *f = _saveFileMan->openForLoading(gameStateFileName); if (f) { uint16 version = f->readUint16LE(); if (version < kCurrentGameStateVersion) { diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index 00716a30eb..29b1e29e5a 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -164,7 +164,7 @@ public: virtual SaveStateList listSaves(const char *target) const { Common::String pattern = Tucker::generateGameStateFileName(target, 0, true); - Common::StringList filenames = g_system->getSavefileManager()->listSavefiles(pattern.c_str()); + Common::StringList filenames = g_system->getSavefileManager()->listSavefiles(pattern); bool slotsTable[Tucker::kLastSaveSlot + 1]; memset(slotsTable, 0, sizeof(slotsTable)); SaveStateList saveList; @@ -172,7 +172,7 @@ public: int slot; const char *ext = strrchr(file->c_str(), '.'); if (ext && (slot = atoi(ext + 1)) >= 0 && slot <= Tucker::kLastSaveSlot) { - Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(file->c_str()); + Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file); if (in) { slotsTable[slot] = true; delete in; @@ -195,7 +195,7 @@ public: virtual void removeSaveState(const char *target, int slot) const { Common::String filename = Tucker::generateGameStateFileName(target, slot); - g_system->getSavefileManager()->removeSavefile(filename.c_str()); + g_system->getSavefileManager()->removeSavefile(filename); } }; diff --git a/engines/tucker/saveload.cpp b/engines/tucker/saveload.cpp index 2b23cf86e0..cf7f985416 100644 --- a/engines/tucker/saveload.cpp +++ b/engines/tucker/saveload.cpp @@ -80,7 +80,7 @@ void TuckerEngine::saveOrLoadGameStateData(S &s) { Common::Error TuckerEngine::loadGameState(int num) { Common::Error ret = Common::kNoError; Common::String gameStateFileName = generateGameStateFileName(_targetName.c_str(), num); - Common::InSaveFile *f = _saveFileMan->openForLoading(gameStateFileName.c_str()); + Common::InSaveFile *f = _saveFileMan->openForLoading(gameStateFileName); if (f) { uint16 version = f->readUint16LE(); if (version < kCurrentGameStateVersion) { @@ -106,7 +106,7 @@ Common::Error TuckerEngine::loadGameState(int num) { Common::Error TuckerEngine::saveGameState(int num, const char *description) { Common::Error ret = Common::kNoError; Common::String gameStateFileName = generateGameStateFileName(_targetName.c_str(), num); - Common::OutSaveFile *f = _saveFileMan->openForSaving(gameStateFileName.c_str()); + Common::OutSaveFile *f = _saveFileMan->openForSaving(gameStateFileName); if (f) { f->writeUint16LE(kCurrentGameStateVersion); f->writeUint16LE(0); |