aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/gui.cpp4
-rw-r--r--engines/kyra/gui.h2
-rw-r--r--engines/kyra/gui_lol.cpp6
-rw-r--r--engines/kyra/gui_lol.h2
4 files changed, 12 insertions, 2 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index 7fd9880dce..27f09b645e 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -388,6 +388,10 @@ void GUI::updateSaveList(bool excludeQuickSaves) {
if (_saveSlots.begin() == _saveSlots.end())
return;
+ sortSaveSlots();
+}
+
+void GUI::sortSaveSlots() {
Common::sort(_saveSlots.begin(), _saveSlots.end(), Common::Less<int>());
if (_saveSlots.size() > 2)
Common::sort(_saveSlots.begin()+1, _saveSlots.end(), Common::Greater<int>());
diff --git a/engines/kyra/gui.h b/engines/kyra/gui.h
index c04892636b..6e9606f1de 100644
--- a/engines/kyra/gui.h
+++ b/engines/kyra/gui.h
@@ -207,6 +207,8 @@ protected:
void updateSaveList(bool excludeQuickSaves = false);
int getNextSavegameSlot();
+ virtual void sortSaveSlots();
+
uint32 _lastScreenUpdate;
Common::KeyState _keyPressed;
void checkTextfieldInput();
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp
index 2017a6e6ba..fefcaf762f 100644
--- a/engines/kyra/gui_lol.cpp
+++ b/engines/kyra/gui_lol.cpp
@@ -2618,8 +2618,6 @@ void GUI_LoL::updateSavegameList() {
_savegameListSize = _saveSlots.size();
if (_savegameListSize) {
- Common::sort(_saveSlots.begin(), _saveSlots.end(), Common::Greater<int>());
-
LoLEngine::SaveHeader header;
Common::InSaveFile *in;
@@ -2642,6 +2640,10 @@ void GUI_LoL::updateSavegameList() {
}
}
+void GUI_LoL::sortSaveSlots() {
+ Common::sort(_saveSlots.begin(), _saveSlots.end(), Common::Greater<int>());
+}
+
void GUI_LoL::printMenuText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 flags) {
_screen->fprintString("%s", x, y, c0, c1, _vm->gameFlags().use16ColorMode ? (flags & 3) : flags , str);
}
diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h
index 0686926534..af487402f6 100644
--- a/engines/kyra/gui_lol.h
+++ b/engines/kyra/gui_lol.h
@@ -175,6 +175,8 @@ private:
char **_savegameList;
int _savegameListSize;
bool _savegameListUpdateNeeded;
+
+ virtual void sortSaveSlots();
};
} // End of namespace Kyra