[Scummvm-cvs-logs] SF.net SVN: scummvm:[34968] scummvm/trunk/gui/launcher.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Nov 9 20:14:39 CET 2008


Revision: 34968
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34968&view=rev
Author:   thebluegr
Date:     2008-11-09 19:14:39 +0000 (Sun, 09 Nov 2008)

Log Message:
-----------
- The save list iterator should now be synced correctly
- Numbering of save slots starts from 0 again, not 1

Modified Paths:
--------------
    scummvm/trunk/gui/launcher.cpp

Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp	2008-11-09 18:38:25 UTC (rev 34967)
+++ scummvm/trunk/gui/launcher.cpp	2008-11-09 19:14:39 UTC (rev 34968)
@@ -483,6 +483,7 @@
 
 	// 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 @@
 
 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 @@
 	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());


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