[Scummvm-cvs-logs] SF.net SVN: scummvm:[33914] scummvm/branches/gsoc2008-rtl
cpage88 at users.sourceforge.net
cpage88 at users.sourceforge.net
Fri Aug 15 21:44:18 CEST 2008
Revision: 33914
http://scummvm.svn.sourceforge.net/scummvm/?rev=33914&view=rev
Author: cpage88
Date: 2008-08-15 19:44:17 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
Fixes for Cine engine loading from launcher
Modified Paths:
--------------
scummvm/branches/gsoc2008-rtl/engines/cine/detection.cpp
scummvm/branches/gsoc2008-rtl/gui/launcher.cpp
Modified: scummvm/branches/gsoc2008-rtl/engines/cine/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/cine/detection.cpp 2008-08-15 19:41:34 UTC (rev 33913)
+++ scummvm/branches/gsoc2008-rtl/engines/cine/detection.cpp 2008-08-15 19:44:17 UTC (rev 33914)
@@ -554,14 +554,23 @@
SaveStateList CineMetaEngine::listSaves(const char *target) const {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
SaveStateList saveList;
+
+ Common::String pattern = target;
+ pattern += ".?";
+ Common::StringList filenames = saveFileMan->listSavefiles(pattern.c_str());
+ 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());
if (in) {
int8 ch;
- int slotNum = 0;
char saveDesc[20];
do {
+ // Obtain the last digit of the filename, since they correspond to the save slot
+ int slotNum = atoi(file->c_str() + file->size() - 1);
+
uint pos = 0;
do {
ch = in->readByte();
@@ -575,8 +584,8 @@
}
} while (ch >= 32 && !in->eos());
if (saveDesc[0] != 0) {
- saveList.push_back(SaveStateDescriptor(slotNum, Common::String(saveDesc), filename));
- slotNum++;
+ saveList.push_back(SaveStateDescriptor(slotNum, Common::String(saveDesc), *file));
+ file++;
}
} while (!in->eos());
}
Modified: scummvm/branches/gsoc2008-rtl/gui/launcher.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/gui/launcher.cpp 2008-08-15 19:41:34 UTC (rev 33913)
+++ scummvm/branches/gsoc2008-rtl/gui/launcher.cpp 2008-08-15 19:44:17 UTC (rev 33914)
@@ -968,12 +968,14 @@
if (_loadDialog->delSave()) {
String filename = saveList[idx].filename();
printf("Deleting file: %s\n", filename.c_str());
- //saveFileMan->removeSavefile(filename.c_str());
+ saveFileMan->removeSavefile(filename.c_str());
}
// Load the savegame
else {
int slot = atoi(saveList[idx].save_slot().c_str());
+ const char *file = saveList[idx].filename().c_str();
printf("Loading slot: %d\n", slot);
+ printf("Loading file: %s\n", file);
ConfMan.setInt("save_slot", slot);
ConfMan.setActiveDomain(_domains[item]);
close();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list