aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorFilippos Karapetis2008-11-09 19:14:39 +0000
committerFilippos Karapetis2008-11-09 19:14:39 +0000
commit765e37dc2ed7e18b3543fa9d3b52fbd51f41e7cb (patch)
tree6a6c718d6dc88b65c196af4d40e6738b742c1bb6 /gui
parent8b0f38acd1ebe2f8d7bd83dbec561ac7b3c4d09d (diff)
downloadscummvm-rg350-765e37dc2ed7e18b3543fa9d3b52fbd51f41e7cb.tar.gz
scummvm-rg350-765e37dc2ed7e18b3543fa9d3b52fbd51f41e7cb.tar.bz2
scummvm-rg350-765e37dc2ed7e18b3543fa9d3b52fbd51f41e7cb.zip
- The save list iterator should now be synced correctly
- Numbering of save slots starts from 0 again, not 1 svn-id: r34968
Diffstat (limited to 'gui')
-rw-r--r--gui/launcher.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 76bcf0c3be..c11cc58ae1 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -483,6 +483,7 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
// Add choice list
_list = new GUI::ListWidget(this, "ScummSaveLoad.List");
+ _list->setNumberingMode(GUI::kListNumberingZero);
setSaveMode(false);
_gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10);
@@ -542,7 +543,6 @@ const Common::String &SaveLoadChooser::getResultString() const {
void SaveLoadChooser::setSaveMode(bool saveMode) {
_list->setEditable(saveMode);
- _list->setNumberingMode(GUI::kListNumberingOne);
}
void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
@@ -752,12 +752,19 @@ void SaveLoadChooser::updateSaveList() {
for (SaveStateList::const_iterator x = _saveList.begin(); x != _saveList.end(); ++x) {
// Handle gaps in the list of save games
saveSlot = atoi(x->save_slot().c_str());
- while (curSlot < saveSlot) {
- SaveStateDescriptor dummySave(curSlot, "");
- _saveList.insert_at(curSlot, dummySave);
- saveNames.push_back(dummySave.description());
- ++x; // sync the save list iterator
- curSlot++;
+ if (curSlot < saveSlot) {
+ while (curSlot < saveSlot) {
+ SaveStateDescriptor dummySave(curSlot, "");
+ _saveList.insert_at(curSlot, dummySave);
+ saveNames.push_back(dummySave.description());
+ curSlot++;
+ }
+
+ // Sync the save list iterator
+ for (x = _saveList.begin(); x != _saveList.end(); ++x) {
+ if (atoi(x->save_slot().c_str()) == saveSlot)
+ break;
+ }
}
saveNames.push_back(x->description());