[Scummvm-cvs-logs] SF.net SVN: scummvm:[34932] scummvm/trunk
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Nov 7 20:43:01 CET 2008
Revision: 34932
http://scummvm.svn.sourceforge.net/scummvm/?rev=34932&view=rev
Author: thebluegr
Date: 2008-11-07 19:43:01 +0000 (Fri, 07 Nov 2008)
Log Message:
-----------
Saving a game from GMM is now working for the SAGA engine, though the description is not set correctly yet
Modified Paths:
--------------
scummvm/trunk/engines/dialogs.cpp
scummvm/trunk/engines/saga/detection.cpp
scummvm/trunk/engines/saga/saga.h
scummvm/trunk/gui/launcher.cpp
Modified: scummvm/trunk/engines/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/dialogs.cpp 2008-11-07 15:35:18 UTC (rev 34931)
+++ scummvm/trunk/engines/dialogs.cpp 2008-11-07 19:43:01 UTC (rev 34932)
@@ -118,6 +118,7 @@
_aboutDialog = new GUI::AboutDialog();
_optionsDialog = new ConfigDialog();
_loadDialog = new GUI::SaveLoadChooser("Load game:", "Load");
+ _loadDialog->setSaveMode(false);
_saveDialog = new GUI::SaveLoadChooser("Save game:", "Save");
_saveDialog->setSaveMode(true);
}
@@ -155,7 +156,6 @@
}
break;
case kSaveCmd:
- /*
{
Common::String gameId = ConfMan.get("gameid");
@@ -165,7 +165,9 @@
int slot = _saveDialog->runModal(plugin, ConfMan.getActiveDomainName());
if (slot >= 0) {
- Common::String result(_saveDialog->getResultString());
+ // FIXME: at this point, the save list's selItem is -1!
+ //Common::String result(_saveDialog->getResultString());
+ Common::String result;
char *desc;
if (result.empty()) {
// If the user was lazy and entered no save name, come up with a default name.
@@ -180,7 +182,6 @@
}
}
- */
break;
case kOptionsCmd:
_optionsDialog->runModal();
Modified: scummvm/trunk/engines/saga/detection.cpp
===================================================================
--- scummvm/trunk/engines/saga/detection.cpp 2008-11-07 15:35:18 UTC (rev 34931)
+++ scummvm/trunk/engines/saga/detection.cpp 2008-11-07 19:43:01 UTC (rev 34932)
@@ -187,9 +187,10 @@
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
SaveStateList saveList;
+ int slotNum = 0;
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
// Obtain the last 2 digits of the filename, since they correspond to the save slot
- int slotNum = atoi(file->c_str() + file->size() - 2);
+ slotNum = atoi(file->c_str() + file->size() - 2);
if (slotNum >= 0 && slotNum <= 99) {
Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
@@ -199,10 +200,20 @@
in->read(saveDesc, SAVE_TITLE_SIZE);
saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
delete in;
+ } else {
+ // handle gaps
+ *saveDesc = 0;
+ saveList.push_back(SaveStateDescriptor(slotNum, saveDesc));
}
}
}
+ // Fill the rest of the list with empty slots
+ *saveDesc = 0;
+ for (int i = slotNum + 1; i <= 99; i++) {
+ saveList.push_back(SaveStateDescriptor(i, saveDesc));
+ }
+
return saveList;
}
@@ -265,4 +276,9 @@
return Common::kNoError; // TODO: return success/failure
}
+Common::Error SagaEngine::saveGameState(int slot, const char *desc) {
+ save(calcSaveFileName((uint)slot), desc);
+ return Common::kNoError; // TODO: return success/failure
+}
+
} // End of namespace Saga
Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h 2008-11-07 15:35:18 UTC (rev 34931)
+++ scummvm/trunk/engines/saga/saga.h 2008-11-07 19:43:01 UTC (rev 34932)
@@ -653,6 +653,7 @@
int getDisplayWidth() const;
int getDisplayHeight() const;
Common::Error loadGameState(int slot);
+ Common::Error saveGameState(int slot, const char *desc);
bool canLoadGameStateCurrently();
bool canSaveGameStateCurrently();
const GameDisplayInfo &getDisplayInfo();
Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp 2008-11-07 15:35:18 UTC (rev 34931)
+++ scummvm/trunk/gui/launcher.cpp 2008-11-07 19:43:01 UTC (rev 34932)
@@ -565,7 +565,6 @@
case GUI::kListSelectionChangedCmd: {
updateSelection(true);
- /*
if (_list->isEditable()) {
_list->startEditMode();
}
@@ -574,7 +573,6 @@
// because we then just assign a default name.
_chooseButton->setEnabled(selItem >= 0 && (_list->isEditable() || !getResultString().empty()));
_chooseButton->draw();
- */
} break;
case kDelCmd:
if (selItem >= 0 && _delSupport) {
@@ -742,11 +740,7 @@
StringList saveNames;
for (SaveStateList::const_iterator x = _saveList.begin(); x != _saveList.end(); ++x) {
- Common::String description = x->save_slot();
- description += ". ";
- description += x->description();
-
- saveNames.push_back(description);
+ saveNames.push_back(x->description());
}
_list->setList(saveNames);
}
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