Added FragGlassWindow flags lo/hi bytes for research purposes

This commit is contained in:
dexy 2021-05-05 19:03:32 +10:00
parent 5426ceada8
commit 4e987e523a
2 changed files with 18 additions and 17 deletions

View File

@ -3955,7 +3955,7 @@ namespace CodeWalker.GameFiles
bool savetest = false; bool savetest = false;
var errorfiles = new List<RpfEntry>(); var errorfiles = new List<RpfEntry>();
var sb = new StringBuilder(); var sb = new StringBuilder();
int[] flagcheck = new int[16]; var flagdict = new Dictionary<uint, int>();
foreach (RpfFile file in AllRpfs) foreach (RpfFile file in AllRpfs)
{ {
foreach (RpfEntry entry in file.AllEntries) foreach (RpfEntry entry in file.AllEntries)
@ -3996,27 +3996,26 @@ namespace CodeWalker.GameFiles
{ continue; } { continue; }
} }
var groups = yft?.Fragment?.PhysicsLODGroup?.PhysicsLOD1?.Groups?.data_items;
if (groups != null) if (yft?.Fragment?.GlassWindows?.data_items != null)
{ {
foreach (var g in groups) var lastf = -1;
for (int i = 0; i < yft.Fragment.GlassWindows.data_items.Length; i++)
{ {
ushort f = (ushort)(g.UnkByte52 + (g.UnkByte53 << 8)); var w = yft.Fragment.GlassWindows.data_items[i];
for (int i = 0; i < 16; i++) if (w.Flags == lastf) continue;
lastf = w.Flags;
flagdict.TryGetValue(w.Flags, out int n);
if (n < 10)
{ {
if (flagcheck[i]>=3) continue; flagdict[w.Flags] = n + 1;
var t = 1 << i; sb.AppendLine(entry.Path + " Window " + i.ToString() + ": Flags " + w.Flags.ToString() + ", Low:" + w.FlagsLo.ToString() + ", High:" + w.FlagsHi.ToString());
if ((f & t) > 0) }
{
sb.AppendLine(entry.Path + ": " + g.Name.ToString() + ", UnkByte52:" + g.UnkByte52.ToString() + ", UnkByte53:" + g.UnkByte53.ToString() + " zflag:" + (i+1).ToString());
flagcheck[i]++;
} }
} }
} }
} }
}
}
//catch (Exception ex) //catch (Exception ex)
//{ //{
// UpdateStatus("Error! " + ex.ToString()); // UpdateStatus("Error! " + ex.ToString());

View File

@ -1162,6 +1162,8 @@ namespace CodeWalker.GameFiles
public float UnkFloat22 { get; set; } public float UnkFloat22 { get; set; }
public uint UnkUint4 = 0x7f800001; // 0x7f800001 public uint UnkUint4 = 0x7f800001; // 0x7f800001
public byte FlagsLo { get { return (byte)((Flags >> 0) & 0xFF); } }
public byte FlagsHi { get { return (byte)((Flags >> 8) & 0xFF); } }
public FragPhysTypeGroup Group { get; set; } public FragPhysTypeGroup Group { get; set; }
public FragPhysicsLOD GroupLOD { get; set; } public FragPhysicsLOD GroupLOD { get; set; }