- sort the game selection list by definition order in grpinfo.txt.

This is to have consistent ordering, independent of where the files are found.
Game order is: Duke, Blood, Shadow Warrior, Redneck Rampage, Nam, WW2GI, Exhumed, all the official mission packs are grouped below the game they belong to.
This commit is contained in:
Christoph Oelckers 2021-03-12 23:45:03 +01:00
parent 25bf0854cf
commit f4b27bbd27
3 changed files with 92 additions and 95 deletions

View file

@ -143,6 +143,7 @@ struct GrpInfo
int flags = 0;
bool loaddirectory = false;
bool isAddon = false;
int index = -1;
TArray<FString> mustcontain;
TArray<FString> tobedeleted;
TArray<FString> loadfiles;
@ -154,7 +155,6 @@ struct GrpEntry
{
FString FileName;
GrpInfo FileInfo;
uint32_t FileIndex;
};
extern int g_gameType;
const char* G_DefaultDefFile(void);

View file

@ -709,6 +709,9 @@ TArray<GrpEntry> GrpScan()
auto cachedCRCs = LoadCRCCache();
auto numCRCs = cachedCRCs.Size();
for (unsigned i = 0; i < allGroups.Size(); i++)
allGroups[i].index = i;
// Remove all unnecessary content from the file list. Since this contains all data from the search path's directories it can be quite large.
// Sort both lists by file size so that we only need to pass over each list once to weed out all unrelated content. Go backward to avoid too much item movement
// (most will be deleted anyway.)
@ -756,7 +759,6 @@ TArray<GrpEntry> GrpScan()
auto& fg = foundGames.Last();
fg.FileInfo = *grp;
fg.FileName = fe->FileName;
fg.FileIndex = fe->Index;
break;
}
}
@ -812,7 +814,6 @@ TArray<GrpEntry> GrpScan()
auto& fg = foundGames.Last();
fg.FileInfo = *grp;
fg.FileName = entry->FileName;
fg.FileIndex = entry->Index;
for (auto addon : addonList)
{
if (CheckAddon(addon, grp, entry->FileName))
@ -820,7 +821,6 @@ TArray<GrpEntry> GrpScan()
foundGames.Reserve(1);
auto& fga = foundGames.Last();
fga.FileInfo = *addon;
fga.FileIndex = entry->Index;
}
}
}
@ -850,7 +850,7 @@ TArray<GrpEntry> GrpScan()
{
auto A = (const GrpEntry*)a;
auto B = (const GrpEntry*)b;
return (int)A->FileIndex - (int)B->FileIndex;
return (int)A->FileInfo.index - (int)B->FileInfo.index;
});
// Finally, scan the list for duplicstes. Only the first occurence should count.

View file

@ -286,95 +286,6 @@ grpinfo
gamefilter "Duke.Zone"
}
grpinfo
{
name "NAM"
size 43448927
crc NAM_CRC
flags GAMEFLAG_NAM
dependency 0
gamefilter "Nam.Nam"
}
grpinfo
{
name "NAPALM"
size 44365728
crc NAPALM_CRC
flags GAMEFLAG_NAM|GAMEFLAG_NAPALM
dependency 0
gamefilter "Nam.Napalm"
}
grpinfo
{
name "WWII GI"
size 77939508
crc WW2GI_CRC
flags GAMEFLAG_WW2GI
dependency 0
gamefilter "WW2GI.WW2GI"
}
grpinfo
{
name "Platoon Leader"
scriptname "PLATOONL.DEF"
size 37852572
crc PLATOONL_CRC
flags GAMEFLAG_WW2GI|GAMEFLAG_ADDON
dependency WW2GI_CRC
gamefilter "WW2GI.Platoon"
}
grpinfo
{
name "Redneck Rampage"
size 141174222
crc RR_CRC
defname "rr.def"
flags GAMEFLAG_RR
dependency 0
gamefilter "Redneck.Redneck"
}
grpinfo
{
name "Redneck Rampage Rides Again"
size 191798609
crc RRRA_CRC
defname "rrra.def"
flags GAMEFLAG_RRRA
dependency 0
gamefilter "Redneck.RidesAgain"
}
grpinfo
{
// This is for detecting zipped versions of the mod.
name "Redneck Rampage: Suckin' Grits on Route 66"
scriptname "GAME66.CON"
mustcontain "TILESA66.ART", "TILESB66.ART", "ROUTE66/CARNIVAL.MAP", "ROUTE66/TRUCKSTP.MAP", "GAME66.CON"
flags GAMEFLAG_RR|GAMEFLAG_ADDON
dependency RR_CRC
loadart "TILESA66.ART", "TILESB66.ART" // replaces TILES009 and TILES023.
gamefilter "Redneck.Route66"
deletecontent "turd66.anm*turdmov.anm", "turd66.voc*turdmov.voc", "end66.anm*rr_outro.anm", "end66.voc*rr_outro.voc" // This renames instead of deleting
}
addon
{
// this is for detecting the files within the game directory.
name "Redneck Rampage: Suckin' Grits on Route 66"
scriptname "GAME66.CON"
mustcontain "TILESA66.ART", "TILESB66.ART", "ROUTE66/CARNIVAL.MAP", "ROUTE66/TRUCKSTP.MAP", "GAME66.CON"
flags GAMEFLAG_RR|GAMEFLAG_ADDON
dependency RR_CRC
loadart "TILESA66.ART", "TILESB66.ART" // replaces TILES009 and TILES023.
gamefilter "Redneck.Route66"
deletecontent "turd66.anm*turdmov.anm", "turd66.voc*turdmov.voc", "end66.anm*rr_outro.anm", "end66.voc*rr_outro.voc" // This renames instead of deleting
}
grpinfo
{
name "Blood 1.0"
@ -639,8 +550,94 @@ grpinfo
gamefilter "ShadowWarrior.TwinDragon"
}
grpinfo
{
name "Redneck Rampage"
size 141174222
crc RR_CRC
defname "rr.def"
flags GAMEFLAG_RR
dependency 0
gamefilter "Redneck.Redneck"
}
grpinfo
{
name "Redneck Rampage Rides Again"
size 191798609
crc RRRA_CRC
defname "rrra.def"
flags GAMEFLAG_RRRA
dependency 0
gamefilter "Redneck.RidesAgain"
}
grpinfo
{
// This is for detecting zipped versions of the mod.
name "Redneck Rampage: Suckin' Grits on Route 66"
scriptname "GAME66.CON"
mustcontain "TILESA66.ART", "TILESB66.ART", "ROUTE66/CARNIVAL.MAP", "ROUTE66/TRUCKSTP.MAP", "GAME66.CON"
flags GAMEFLAG_RR|GAMEFLAG_ADDON
dependency RR_CRC
loadart "TILESA66.ART", "TILESB66.ART" // replaces TILES009 and TILES023.
gamefilter "Redneck.Route66"
deletecontent "turd66.anm*turdmov.anm", "turd66.voc*turdmov.voc", "end66.anm*rr_outro.anm", "end66.voc*rr_outro.voc" // This renames instead of deleting
}
addon
{
// this is for detecting the files within the game directory.
name "Redneck Rampage: Suckin' Grits on Route 66"
scriptname "GAME66.CON"
mustcontain "TILESA66.ART", "TILESB66.ART", "ROUTE66/CARNIVAL.MAP", "ROUTE66/TRUCKSTP.MAP", "GAME66.CON"
flags GAMEFLAG_RR|GAMEFLAG_ADDON
dependency RR_CRC
loadart "TILESA66.ART", "TILESB66.ART" // replaces TILES009 and TILES023.
gamefilter "Redneck.Route66"
deletecontent "turd66.anm*turdmov.anm", "turd66.voc*turdmov.voc", "end66.anm*rr_outro.anm", "end66.voc*rr_outro.voc" // This renames instead of deleting
}
grpinfo
{
name "NAM"
size 43448927
crc NAM_CRC
flags GAMEFLAG_NAM
dependency 0
gamefilter "Nam.Nam"
}
grpinfo
{
name "NAPALM"
size 44365728
crc NAPALM_CRC
flags GAMEFLAG_NAM|GAMEFLAG_NAPALM
dependency 0
gamefilter "Nam.Napalm"
}
grpinfo
{
name "WWII GI"
size 77939508
crc WW2GI_CRC
flags GAMEFLAG_WW2GI
dependency 0
gamefilter "WW2GI.WW2GI"
}
grpinfo
{
name "Platoon Leader"
scriptname "PLATOONL.DEF"
size 37852572
crc PLATOONL_CRC
flags GAMEFLAG_WW2GI|GAMEFLAG_ADDON
dependency WW2GI_CRC
gamefilter "WW2GI.Platoon"
}
grpinfo
{