public MULT(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color)) { ParentFile = FE; byte[] SrcData = ParentFile.GetFileData(); Offset = SrcOffset; _Translation = new Vector2( Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x04))); _Rotation = ((short)(Helpers.Read16(SrcData, SrcOffset + 0x08)) / 182.04444444444444f).Clamp(-180, 179); _RoomNumber = SrcData[SrcOffset + 0x0A]; _Unknown2 = SrcData[SrcOffset + 0x0B]; SrcOffset += 0x0C; RenderColor = Color; Node = Helpers.CreateTreeNode(string.Format("{0:X6}: {1}", Offset, new Vector2(_Translation.X / 100000, _Translation.Y / 100000)), this, string.Format("{0}", _Translation)); ParentNode.BackColor = RenderColor; ParentNode.Nodes.Add(Node); GLID = GL.GenLists(1); GL.NewList(GLID, ListMode.Compile); Helpers.DrawFramedCube(new Vector3d(15, 15, 15)); GL.EndList(); }
public RPPN(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color)) { ParentFile = FE; byte[] SrcData = ParentFile.GetFileData(); Offset = SrcOffset; _Unknown = Helpers.Read32(SrcData, SrcOffset); _Position = new Vector3( Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x04)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x08)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x0C))); SrcOffset += 0x10; RenderColor = Color; Node = Helpers.CreateTreeNode(string.Format("{0}", _Position), this); ParentNode.BackColor = RenderColor; ParentNode.Nodes.Add(Node); GLID = GL.GenLists(1); GL.NewList(GLID, ListMode.Compile); Helpers.DrawFramedSphere(new Vector3d(0, 0, 0), 25.0f, 10); GL.EndList(); }
public LGTV(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color)) { ParentFile = FE; byte[] SrcData = ParentFile.GetFileData(); Offset = SrcOffset; _Unknown1 = new Vector3( Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x04)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x08))); _Unknown2 = new Vector3( Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x0C)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x10)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x14))); _Unknown3 = Helpers.Read32(SrcData, SrcOffset + 0x18); SrcOffset += 0x1C; RenderColor = Color; Node = Helpers.CreateTreeNode(string.Format("{0:X6}", Offset), this, string.Format("{0}\n{1}\n0x{2:X8}", _Unknown1, _Unknown2, _Unknown3)); ParentNode.BackColor = RenderColor; ParentNode.Nodes.Add(Node); }
public TGDR(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); _Parameters = Helpers.Read32(SrcData, SrcOffset + 8); _Position = new Vector3( Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x0C)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x10)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x14))); _Unknown1 = Helpers.Read16(SrcData, SrcOffset + 0x18); _RotationY = ((short)Helpers.Read16(SrcData, SrcOffset + 0x1A) / 182.04444444444444).Clamp(-180, 179); _Unknown2 = Helpers.Read16(SrcData, SrcOffset + 0x1C); _Unknown3 = Helpers.Read16(SrcData, SrcOffset + 0x1E); _Unknown4 = Helpers.Read32(SrcData, SrcOffset + 0x20); SrcOffset += 0x24; 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(); }
public MULT(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color)) { ParentFile = FE; byte[] SrcData = ParentFile.GetFileData(); Offset = SrcOffset; _HVTranslation = new Vector2( Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset)), Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x04))); _Unknown1 = Helpers.Read16(SrcData, SrcOffset + 0x08); _RoomNumber = SrcData[SrcOffset + 0x0A]; _Unknown2 = SrcData[SrcOffset + 0x0B]; SrcOffset += 0x0C; RenderColor = Color; Node = Helpers.CreateTreeNode(string.Format("{0:X6}: {1}", Offset, new Vector2(_HVTranslation.X / 100000, _HVTranslation.Y / 100000)), this, string.Format("{0}", _HVTranslation)); ParentNode.BackColor = RenderColor; ParentNode.Nodes.Add(Node); }
public FileChunk(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, ZeldaArc ParentZA = null) { byte[] SrcData = FE.GetFileData(); Tag = Helpers.ReadString(SrcData, SrcOffset, 4); Elements = Helpers.Read32(SrcData, SrcOffset + 4); Offset = Helpers.Read32(SrcData, SrcOffset + 8); Data = new object[Elements]; TreeNode NewNode = Helpers.CreateTreeNode(Tag, this, string.Format("Offset: {0:X6}\n{1} elements", Offset, Elements)); int ReadOffset = (int)Offset; for (int i = 0; i < Elements; i++) { switch (Tag) { /* Typically in DZR */ case "ACTR": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.GreenYellow, ParentZA); continue; case "TGOB": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.GreenYellow, ParentZA); continue; case "PLYR": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.Orange); continue; case "PPNT": /* Found in DmSpot0's Stage DZS for some reason... */ case "RPPN": Data[i] = new RPPN(FE, ref ReadOffset, NewNode, System.Drawing.Color.LightSkyBlue); continue; case "SHIP": Data[i] = new SHIP(FE, ref ReadOffset, NewNode, System.Drawing.Color.BlueViolet); continue; case "TGDR": case "DOOR": case "Door": Data[i] = new TGDR(FE, ref ReadOffset, NewNode, System.Drawing.Color.HotPink, ParentZA); continue; case "LGTV": Data[i] = new LGTV(FE, ref ReadOffset, NewNode, System.Drawing.Color.DarkGray); continue; /* ????? */ /* Typically in DZS */ case "MULT": Data[i] = new MULT(FE, ref ReadOffset, NewNode, System.Drawing.Color.LightGray); continue; case "TRES": Data[i] = new TRES(FE, ref ReadOffset, NewNode, System.Drawing.Color.SaddleBrown); continue; //case "EnvR": Data[i] = new EnvRChunk(FE, ref ReadOffset, NewNode, System.Drawing.Color.DarkSlateGray); continue; } switch (Tag.Substring(0, 3)) { case "ACT": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.GreenYellow, ParentZA); break; case "PLY": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.Orange); break; case "SCO": Data[i] = new TGDR(FE, ref ReadOffset, NewNode, System.Drawing.Color.Yellow, ParentZA); break; case "TRE": Data[i] = new TRES(FE, ref ReadOffset, NewNode, System.Drawing.Color.SaddleBrown); break; default: Data[i] = new Generic(FE, ref ReadOffset, NewNode); NewNode.Tag = Data[i]; break; } } ParentNode.Nodes.Add(NewNode); SrcOffset += 12; }
public DZB(RARC.FileEntry FE, TreeNode TN) { Root = TN; Name = FE.FileName; Load(FE.GetFileData()); }