public TRES(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color), ZeldaArc ParentZA = null)
{
ParentFile = FE;
byte[] SrcData = ParentFile.GetFileData();
Offset = SrcOffset;
_Name = Helpers.ReadString(SrcData, SrcOffset, 8);
_ChestType = Helpers.Read16(SrcData, SrcOffset + 0x09);
_Position = new Vector3(
Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x0C)),
Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x10)),
Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x14)));
_Rotation = ((short)(Helpers.Read16(SrcData, SrcOffset + 0x1A)) / 182.04444444444444f).Clamp(-180, 179);
_Contents = Helpers.Read8(SrcData, SrcOffset + 0x1C);
SrcOffset += 0x20;
RenderColor = Color;
Node = Helpers.CreateTreeNode(string.Format("{0:X6}: {1}", Offset, _Name), this);
ParentNode.BackColor = RenderColor;
ParentNode.Nodes.Add(Node);
GLID = GL.GenLists(1);
GL.NewList(GLID, ListMode.Compile);
if (ParentZA != null)
{
MatchedModel = ParentZA.J3Dxs.Find(x => x.FileEntry.FileName.StartsWith(_Name));
MatchedCollision = ParentZA.DZBs.Find(x => x.Name.StartsWith(_Name));
}
Helpers.DrawFramedCube(new Vector3d(15, 15, 15));
GL.EndList();
}