Properly sort multi-disc games by title.

This commit is contained in:
Rachel Bryk 2013-01-25 03:07:50 -05:00
parent 10418d449f
commit 2cc1a97a66
1 changed files with 12 additions and 0 deletions

View File

@ -94,6 +94,18 @@ static int CompareGameListItems(const GameListItem* iso1, const GameListItem* is
switch(sortData)
{
case CGameListCtrl::COLUMN_TITLE:
if (!strcasecmp(iso1->GetName(indexOne).c_str(),iso2->GetName(indexOther).c_str()))
{
File::IOFile file(iso1->GetFileName(),"rb");
u8 discNum;
file.Seek(6,0);
file.ReadBytes(&discNum, 1);
file.Close();
if (discNum == 1)
return 1 * t;
else
return -1 * t;
}
return strcasecmp(iso1->GetName(indexOne).c_str(),
iso2->GetName(indexOther).c_str()) * t;
case CGameListCtrl::COLUMN_NOTES: