[Scummvm-cvs-logs] scummvm master -> a74341508fc0bf4f49f4df3c546637020b36840e

lordhoto lordhoto at gmail.com
Tue Jan 26 17:02:07 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a74341508f KYRA: Cleanup listing of actual save slots in GUI::updateSaveFileList.


Commit: a74341508fc0bf4f49f4df3c546637020b36840e
    https://github.com/scummvm/scummvm/commit/a74341508fc0bf4f49f4df3c546637020b36840e
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2016-01-26T17:00:38+01:00

Commit Message:
KYRA: Cleanup listing of actual save slots in GUI::updateSaveFileList.

Changed paths:
    engines/kyra/gui.cpp



diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index e95d78c..d9c2f91 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -47,23 +47,16 @@ GUI::~GUI() {
 }
 
 void GUI::updateSaveFileList(Common::String targetName, bool excludeQuickSaves) {
-	Common::String pattern = targetName + ".???";
+	Common::String pattern = targetName + ".###";
 	Common::StringArray saveFileList = _vm->_saveFileMan->listSavefiles(pattern);
 	_saveSlots.clear();
 
 	for (Common::StringArray::const_iterator i = saveFileList.begin(); i != saveFileList.end(); ++i) {
-		char s1 = 0, s2 = 0, s3 = 0;
-		s1 = (*i)[i->size() - 3];
-		s2 = (*i)[i->size() - 2];
-		s3 = (*i)[i->size() - 1];
-		if (!Common::isDigit(s1) || !Common::isDigit(s2) || !Common::isDigit(s3))
+		// The last 3 digits of the filename correspond to the save slot.
+		const int slotNum = atoi(i->c_str() + i->size() - 3);
+		if (excludeQuickSaves && slotNum >= 990)
 			continue;
-		s1 -= '0';
-		s2 -= '0';
-		s3 -= '0';
-		if (excludeQuickSaves && s1 == 9 && s2 == 9)
-			continue;
-		_saveSlots.push_back(s1 * 100 + s2 * 10 + s3);
+		_saveSlots.push_back(slotNum);
 	}
 
 	if (_saveSlots.begin() == _saveSlots.end())






More information about the Scummvm-git-logs mailing list