[Scummvm-cvs-logs] SF.net SVN: scummvm:[35455] scummvm/trunk/engines/tinsel
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Dec 21 00:15:46 CET 2008
Revision: 35455
http://scummvm.svn.sourceforge.net/scummvm/?rev=35455&view=rev
Author: lordhoto
Date: 2008-12-20 23:15:46 +0000 (Sat, 20 Dec 2008)
Log Message:
-----------
- Added comment about error check when loading save on startup
- Updated code to properly test the last three digits of save filenames instead of only the last two
Modified Paths:
--------------
scummvm/trunk/engines/tinsel/detection.cpp
scummvm/trunk/engines/tinsel/tinsel.cpp
Modified: scummvm/trunk/engines/tinsel/detection.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/detection.cpp 2008-12-20 23:11:56 UTC (rev 35454)
+++ scummvm/trunk/engines/tinsel/detection.cpp 2008-12-20 23:15:46 UTC (rev 35455)
@@ -486,8 +486,8 @@
SaveStateList saveList;
int slotNum = 0;
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
- slotNum = atoi(file->c_str() + file->size() - 2);
+ // Obtain the last 3 digits of the filename, since they correspond to the save slot
+ slotNum = atoi(file->c_str() + file->size() - 3);
const Common::String &fname = *file;
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fname.c_str());
@@ -563,7 +563,7 @@
const int numStates = Tinsel::getList();
for (int i = 0; i < numStates; ++i) {
const char *fileName = Tinsel::ListEntry(i, Tinsel::LE_NAME);
- const int saveSlot = atoi(fileName + strlen(fileName) - 2);
+ const int saveSlot = atoi(fileName + strlen(fileName) - 3);
if (saveSlot == slot) {
listSlot = i;
Modified: scummvm/trunk/engines/tinsel/tinsel.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.cpp 2008-12-20 23:11:56 UTC (rev 35454)
+++ scummvm/trunk/engines/tinsel/tinsel.cpp 2008-12-20 23:15:46 UTC (rev 35455)
@@ -992,6 +992,9 @@
//dumpMusic(); // dumps all of the game's music in external XMIDI files
// Load game from specified slot, if any
+ //
+ // TODO: We might want to think about taking care of possible errors
+ // when loading the save state.
if (ConfMan.hasKey("save_slot"))
loadGameState(ConfMan.getInt("save_slot"));
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