Skip to content

Commit

Permalink
Fixed sort *.gro files in Mods directory (for Windows).
Browse files Browse the repository at this point in the history
  • Loading branch information
tx00100xt committed Dec 17, 2022
1 parent abe6ed0 commit 1c681e8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions SamTFE/Sources/Engine/Base/Unzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,24 @@ int qsort_ArchiveCTFileName_reverse(const void *elem1, const void *elem2 )
// get the filenames
const CTFileName &fnm1 = *(CTFileName *)elem1;
const CTFileName &fnm2 = *(CTFileName *)elem2;

#ifdef PLATFORM_WIN32
// find if any is in a mod or on CD
BOOL bMod1 = fnm1.HasPrefix(_fnmApplicationPath+"Mods\\");
BOOL bCD1 = fnm1.HasPrefix(_fnmCDPath);
BOOL bModCD1 = fnm1.HasPrefix(_fnmCDPath+"Mods\\");
BOOL bMod2 = fnm2.HasPrefix(_fnmApplicationPath+"Mods\\");
BOOL bCD2 = fnm2.HasPrefix(_fnmCDPath);
BOOL bModCD2 = fnm2.HasPrefix(_fnmCDPath+"Mods\\");
#else
// find if any is in a mod or on CD
BOOL bMod1 = fnm1.HasPrefix(_fnmApplicationPath+"Mods/");
BOOL bCD1 = fnm1.HasPrefix(_fnmCDPath);
BOOL bModCD1 = fnm1.HasPrefix(_fnmCDPath+"Mods/");
BOOL bMod2 = fnm2.HasPrefix(_fnmApplicationPath+"Mods/");
BOOL bCD2 = fnm2.HasPrefix(_fnmCDPath);
BOOL bModCD2 = fnm2.HasPrefix(_fnmCDPath+"Mods/");
#endif

// calculate priorities based on location of gro file
INDEX iPriority1 = 0;
Expand Down
11 changes: 11 additions & 0 deletions SamTSE/Sources/Engine/Base/Unzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,24 @@ int qsort_ArchiveCTFileName_reverse(const void *elem1, const void *elem2 )
// get the filenames
const CTFileName &fnm1 = *(CTFileName *)elem1;
const CTFileName &fnm2 = *(CTFileName *)elem2;

#ifdef PLATFORM_WIN32
// find if any is in a mod or on CD
BOOL bMod1 = fnm1.HasPrefix(_fnmApplicationPath+"Mods\\");
BOOL bCD1 = fnm1.HasPrefix(_fnmCDPath);
BOOL bModCD1 = fnm1.HasPrefix(_fnmCDPath+"Mods\\");
BOOL bMod2 = fnm2.HasPrefix(_fnmApplicationPath+"Mods\\");
BOOL bCD2 = fnm2.HasPrefix(_fnmCDPath);
BOOL bModCD2 = fnm2.HasPrefix(_fnmCDPath+"Mods\\");
#else
// find if any is in a mod or on CD
BOOL bMod1 = fnm1.HasPrefix(_fnmApplicationPath+"Mods/");
BOOL bCD1 = fnm1.HasPrefix(_fnmCDPath);
BOOL bModCD1 = fnm1.HasPrefix(_fnmCDPath+"Mods/");
BOOL bMod2 = fnm2.HasPrefix(_fnmApplicationPath+"Mods/");
BOOL bCD2 = fnm2.HasPrefix(_fnmCDPath);
BOOL bModCD2 = fnm2.HasPrefix(_fnmCDPath+"Mods/");
#endif

// calculate priorities based on location of gro file
INDEX iPriority1 = 0;
Expand Down

0 comments on commit 1c681e8

Please sign in to comment.