Dat151 progress

This commit is contained in:
dexy 2018-12-27 11:53:53 +11:00
parent 77d9c4e4c8
commit 2d77d76e0c
2 changed files with 24 additions and 3 deletions

View File

@ -762,9 +762,20 @@ namespace CodeWalker.GameFiles
}
//var sorted = RelDatasSorted.ToList();
//for the correct index ordering, needs to be in order of hashes, but with bits rotated right by 8 (why!?)
var sorted = RelDatasSorted.ToList();
//sorted.Sort((a, b) => { return ((uint)a.NameHash).CompareTo((uint)b.NameHash); });
//RelDatas = sorted.ToArray();
sorted.Sort((a, b) =>
{
var ah = (uint)a.NameHash;
var bh = (uint)b.NameHash;
var av = (ah >> 8) | (ah << 24);
var bv = (bh >> 8) | (bh << 24);
return av.CompareTo(bv);
});
RelDatas = sorted.ToArray();
var hashes = new RelIndexHash[RelDatas.Length];
for (int i = 0; i < RelDatas.Length; i++)

View File

@ -2121,6 +2121,7 @@ namespace CodeWalker.GameFiles
StringBuilder sb = new StringBuilder();
StringBuilder sbh = new StringBuilder();
StringBuilder sbi = new StringBuilder();
foreach (RpfFile rpf in RpfMan.AllRpfs)
{
@ -2222,7 +2223,7 @@ namespace CodeWalker.GameFiles
{
for (int i = 0; i < data.Length; i++) //raw file test
if (data[i] != rel.RawFileData[i])
{ }
{ break; }
}
}
@ -2235,6 +2236,15 @@ namespace CodeWalker.GameFiles
if (rel2.RelDatas == null)
{ }
//sbi.Clear();
//foreach (var rd in rel.RelDatas)
//{
// sbi.AppendLine(new FlagsUint(rd.NameHash).Bin);
//}
//string indexbinstr = sbi.ToString();
}
}