aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2009-05-29 14:38:22 +0000
committerMax Horn2009-05-29 14:38:22 +0000
commitfb79b185717c9aae7c793e7f07d5d6b94aec4abf (patch)
tree6df973c3f64d5712d6df36caa0af30b6b6012561 /engines/scumm
parent518e005ec27ef323275b364a3cd16d24d7491674 (diff)
downloadscummvm-rg350-fb79b185717c9aae7c793e7f07d5d6b94aec4abf.tar.gz
scummvm-rg350-fb79b185717c9aae7c793e7f07d5d6b94aec4abf.tar.bz2
scummvm-rg350-fb79b185717c9aae7c793e7f07d5d6b94aec4abf.zip
Changed SaveFileManager methods to take Common::String params (instead of char pointers)
svn-id: r41000
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/detection.cpp8
-rw-r--r--engines/scumm/saveload.cpp14
-rw-r--r--engines/scumm/script_v4.cpp6
-rw-r--r--engines/scumm/script_v5.cpp4
4 files changed, 16 insertions, 16 deletions
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;