aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-01 19:52:50 +0000
committerMartin Kiewitz2010-01-01 19:52:50 +0000
commit7b0c1f262f3774dec945b6e9419ee668851e493d (patch)
tree83c9525d93bb58a36d7939da7c7c8697dee3abe5 /engines/sci/engine
parente757e7a60a2c18faa81dea0486a0f127e77adac4 (diff)
downloadscummvm-rg350-7b0c1f262f3774dec945b6e9419ee668851e493d.tar.gz
scummvm-rg350-7b0c1f262f3774dec945b6e9419ee668851e493d.tar.bz2
scummvm-rg350-7b0c1f262f3774dec945b6e9419ee668851e493d.zip
SCI: fixing bad sorting of saved games due MMDDYYYY date saving
svn-id: r46846
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kfile.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 796f5d4089..cfee0ed47d 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -265,6 +265,8 @@ void listSavegames(Common::Array<SavegameDesc> &saves) {
SavegameDesc desc;
desc.id = strtol(filename.end() - 3, NULL, 10);
desc.date = meta.savegame_date;
+ // We need to fix date in here, because we save DDMMYYYY instead of YYYYMMDD, so sorting wouldnt work
+ desc.date = ((desc.date & 0xFFFF) << 16) | ((desc.date & 0xFF0000) >> 8) | ((desc.date & 0xFF000000) >> 24);
desc.time = meta.savegame_time;
debug(3, "Savegame in file %s ok, id %d", filename.c_str(), desc.id);