Skip to content

Commit

Permalink
Revise file sort upon packing
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowth117 committed Oct 11, 2022
1 parent 6282504 commit 00e77cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Zamboni/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,19 @@ private static bool writeGroupToDirectory(byte[][] groupToWrite, string director
{
string str = IceFile.getFileName(groupToWrite[index], index);
byte[] file;
int iceHeaderSize = -1;
if (str == "namelessFile.bin" || str.Contains("namelessNIFLFile_"))
{
file = groupToWrite[index];
}
else
{
int iceDataSize = BitConverter.ToInt32(groupToWrite[index], 0x8);
int iceHeaderSize = BitConverter.ToInt32(groupToWrite[index], 0xC);
iceHeaderSize = BitConverter.ToInt32(groupToWrite[index], 0xC);
file = new byte[iceDataSize];
Array.ConstrainedCopy(groupToWrite[index], iceHeaderSize, file, 0, iceDataSize);
}
Debug.WriteLine($"{str} - {file.Length}");
Debug.WriteLine($"{str}");
System.IO.File.WriteAllBytes(directory + "\\" + str, file);
file = null;
groupToWrite[index] = null;
Expand Down
4 changes: 2 additions & 2 deletions Zamboni/UILogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ public static void loadFilesFromDirectory(string path, bool searchSub, List<stri
{
files = Directory.GetFiles(path);
}
Array.Sort(files);
//Array.Sort(files, asciiSort);
Array.Sort(files, string.CompareOrdinal);
var group1temp = new List<byte[]>();
var group2temp = new List<byte[]>();

foreach(var currfile in files)
{
Debug.WriteLine(Path.GetFileName(currfile));
List<byte> file = new List<byte>(System.IO.File.ReadAllBytes(currfile));
var realName = Path.GetFileName(currfile);

Expand Down

0 comments on commit 00e77cb

Please sign in to comment.