From dc9084fc304a212e3fa456c0535f61f26205ce54 Mon Sep 17 00:00:00 2001 From: dexyfex Date: Sun, 24 Sep 2017 20:14:41 +1000 Subject: [PATCH] Show skeletons in model viewer, Clips progress update --- Forms/ModelForm.Designer.cs | 136 +++--- Forms/ModelForm.cs | 43 +- GameFiles/Resources/Clip.cs | 733 +++++++++----------------------- GameFiles/Resources/Drawable.cs | 58 +-- ProjectForm.Designer.cs | 319 +++++++------- World/Scenarios.cs | 8 + 6 files changed, 518 insertions(+), 779 deletions(-) diff --git a/Forms/ModelForm.Designer.cs b/Forms/ModelForm.Designer.cs index a67d0fe..7aa02b7 100644 --- a/Forms/ModelForm.Designer.cs +++ b/Forms/ModelForm.Designer.cs @@ -46,6 +46,11 @@ this.ToolsDetailsTabPage = new System.Windows.Forms.TabPage(); this.DetailsPropertyGrid = new CodeWalker.WinForms.ReadOnlyPropertyGrid(); this.ToolsOptionsTabPage = new System.Windows.Forms.TabPage(); + this.TimeOfDayLabel = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.TimeOfDayTrackBar = new System.Windows.Forms.TrackBar(); + this.ControlLightDirCheckBox = new System.Windows.Forms.CheckBox(); + this.ShowBoundsCheckBox = new System.Windows.Forms.CheckBox(); this.GridCheckBox = new System.Windows.Forms.CheckBox(); this.GridCountComboBox = new System.Windows.Forms.ComboBox(); this.label2 = new System.Windows.Forms.Label(); @@ -67,11 +72,7 @@ this.ToolsPanelHideButton = new System.Windows.Forms.Button(); this.ToolsDragPanel = new System.Windows.Forms.Panel(); this.ToolsPanelShowButton = new System.Windows.Forms.Button(); - this.ShowBoundsCheckBox = new System.Windows.Forms.CheckBox(); - this.ControlLightDirCheckBox = new System.Windows.Forms.CheckBox(); - this.TimeOfDayLabel = new System.Windows.Forms.Label(); - this.label19 = new System.Windows.Forms.Label(); - this.TimeOfDayTrackBar = new System.Windows.Forms.TrackBar(); + this.SkeletonsCheckBox = new System.Windows.Forms.CheckBox(); this.StatusStrip.SuspendLayout(); this.ConsolePanel.SuspendLayout(); this.ToolsPanel.SuspendLayout(); @@ -252,6 +253,7 @@ // // ToolsOptionsTabPage // + this.ToolsOptionsTabPage.Controls.Add(this.SkeletonsCheckBox); this.ToolsOptionsTabPage.Controls.Add(this.TimeOfDayLabel); this.ToolsOptionsTabPage.Controls.Add(this.label19); this.ToolsOptionsTabPage.Controls.Add(this.TimeOfDayTrackBar); @@ -282,6 +284,61 @@ this.ToolsOptionsTabPage.Text = "Options"; this.ToolsOptionsTabPage.UseVisualStyleBackColor = true; // + // TimeOfDayLabel + // + this.TimeOfDayLabel.AutoSize = true; + this.TimeOfDayLabel.Location = new System.Drawing.Point(78, 109); + this.TimeOfDayLabel.Name = "TimeOfDayLabel"; + this.TimeOfDayLabel.Size = new System.Drawing.Size(34, 13); + this.TimeOfDayLabel.TabIndex = 5; + this.TimeOfDayLabel.Text = "12:00"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(7, 109); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(65, 13); + this.label19.TabIndex = 4; + this.label19.Text = "Time of day:"; + // + // TimeOfDayTrackBar + // + this.TimeOfDayTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.TimeOfDayTrackBar.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.TimeOfDayTrackBar.LargeChange = 60; + this.TimeOfDayTrackBar.Location = new System.Drawing.Point(9, 125); + this.TimeOfDayTrackBar.Maximum = 1440; + this.TimeOfDayTrackBar.Name = "TimeOfDayTrackBar"; + this.TimeOfDayTrackBar.Size = new System.Drawing.Size(188, 45); + this.TimeOfDayTrackBar.TabIndex = 6; + this.TimeOfDayTrackBar.TickFrequency = 60; + this.TimeOfDayTrackBar.Value = 720; + this.TimeOfDayTrackBar.Scroll += new System.EventHandler(this.TimeOfDayTrackBar_Scroll); + // + // ControlLightDirCheckBox + // + this.ControlLightDirCheckBox.AutoSize = true; + this.ControlLightDirCheckBox.Location = new System.Drawing.Point(19, 83); + this.ControlLightDirCheckBox.Name = "ControlLightDirCheckBox"; + this.ControlLightDirCheckBox.Size = new System.Drawing.Size(124, 17); + this.ControlLightDirCheckBox.TabIndex = 3; + this.ControlLightDirCheckBox.Text = "Control light direction"; + this.ControlLightDirCheckBox.UseVisualStyleBackColor = true; + this.ControlLightDirCheckBox.CheckedChanged += new System.EventHandler(this.ControlLightDirCheckBox_CheckedChanged); + // + // ShowBoundsCheckBox + // + this.ShowBoundsCheckBox.AutoSize = true; + this.ShowBoundsCheckBox.Location = new System.Drawing.Point(19, 176); + this.ShowBoundsCheckBox.Name = "ShowBoundsCheckBox"; + this.ShowBoundsCheckBox.Size = new System.Drawing.Size(124, 17); + this.ShowBoundsCheckBox.TabIndex = 7; + this.ShowBoundsCheckBox.Text = "Show Model Bounds"; + this.ShowBoundsCheckBox.UseVisualStyleBackColor = true; + this.ShowBoundsCheckBox.CheckedChanged += new System.EventHandler(this.ShowBoundsCheckBox_CheckedChanged); + // // GridCheckBox // this.GridCheckBox.AutoSize = true; @@ -351,7 +408,7 @@ this.StatusBarCheckBox.Location = new System.Drawing.Point(19, 480); this.StatusBarCheckBox.Name = "StatusBarCheckBox"; this.StatusBarCheckBox.Size = new System.Drawing.Size(74, 17); - this.StatusBarCheckBox.TabIndex = 21; + this.StatusBarCheckBox.TabIndex = 22; this.StatusBarCheckBox.Text = "Status bar"; this.StatusBarCheckBox.UseVisualStyleBackColor = true; this.StatusBarCheckBox.CheckedChanged += new System.EventHandler(this.StatusBarCheckBox_CheckedChanged); @@ -362,7 +419,7 @@ this.ErrorConsoleCheckBox.Location = new System.Drawing.Point(105, 480); this.ErrorConsoleCheckBox.Name = "ErrorConsoleCheckBox"; this.ErrorConsoleCheckBox.Size = new System.Drawing.Size(88, 17); - this.ErrorConsoleCheckBox.TabIndex = 22; + this.ErrorConsoleCheckBox.TabIndex = 23; this.ErrorConsoleCheckBox.Text = "Error console"; this.ErrorConsoleCheckBox.UseVisualStyleBackColor = true; this.ErrorConsoleCheckBox.CheckedChanged += new System.EventHandler(this.ErrorConsoleCheckBox_CheckedChanged); @@ -534,60 +591,18 @@ this.ToolsPanelShowButton.UseVisualStyleBackColor = true; this.ToolsPanelShowButton.Click += new System.EventHandler(this.ToolsPanelShowButton_Click); // - // ShowBoundsCheckBox + // SkeletonsCheckBox // - this.ShowBoundsCheckBox.AutoSize = true; - this.ShowBoundsCheckBox.Location = new System.Drawing.Point(19, 176); - this.ShowBoundsCheckBox.Name = "ShowBoundsCheckBox"; - this.ShowBoundsCheckBox.Size = new System.Drawing.Size(124, 17); - this.ShowBoundsCheckBox.TabIndex = 7; - this.ShowBoundsCheckBox.Text = "Show Model Bounds"; - this.ShowBoundsCheckBox.UseVisualStyleBackColor = true; - this.ShowBoundsCheckBox.CheckedChanged += new System.EventHandler(this.ShowBoundsCheckBox_CheckedChanged); - // - // ControlLightDirCheckBox - // - this.ControlLightDirCheckBox.AutoSize = true; - this.ControlLightDirCheckBox.Location = new System.Drawing.Point(19, 83); - this.ControlLightDirCheckBox.Name = "ControlLightDirCheckBox"; - this.ControlLightDirCheckBox.Size = new System.Drawing.Size(124, 17); - this.ControlLightDirCheckBox.TabIndex = 3; - this.ControlLightDirCheckBox.Text = "Control light direction"; - this.ControlLightDirCheckBox.UseVisualStyleBackColor = true; - this.ControlLightDirCheckBox.CheckedChanged += new System.EventHandler(this.ControlLightDirCheckBox_CheckedChanged); - // - // TimeOfDayLabel - // - this.TimeOfDayLabel.AutoSize = true; - this.TimeOfDayLabel.Location = new System.Drawing.Point(78, 109); - this.TimeOfDayLabel.Name = "TimeOfDayLabel"; - this.TimeOfDayLabel.Size = new System.Drawing.Size(34, 13); - this.TimeOfDayLabel.TabIndex = 5; - this.TimeOfDayLabel.Text = "12:00"; - // - // label19 - // - this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(7, 109); - this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(65, 13); - this.label19.TabIndex = 4; - this.label19.Text = "Time of day:"; - // - // TimeOfDayTrackBar - // - this.TimeOfDayTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.TimeOfDayTrackBar.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.TimeOfDayTrackBar.LargeChange = 60; - this.TimeOfDayTrackBar.Location = new System.Drawing.Point(9, 125); - this.TimeOfDayTrackBar.Maximum = 1440; - this.TimeOfDayTrackBar.Name = "TimeOfDayTrackBar"; - this.TimeOfDayTrackBar.Size = new System.Drawing.Size(188, 45); - this.TimeOfDayTrackBar.TabIndex = 6; - this.TimeOfDayTrackBar.TickFrequency = 60; - this.TimeOfDayTrackBar.Value = 720; - this.TimeOfDayTrackBar.Scroll += new System.EventHandler(this.TimeOfDayTrackBar_Scroll); + this.SkeletonsCheckBox.AutoSize = true; + this.SkeletonsCheckBox.Checked = true; + this.SkeletonsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.SkeletonsCheckBox.Location = new System.Drawing.Point(19, 444); + this.SkeletonsCheckBox.Name = "SkeletonsCheckBox"; + this.SkeletonsCheckBox.Size = new System.Drawing.Size(103, 17); + this.SkeletonsCheckBox.TabIndex = 21; + this.SkeletonsCheckBox.Text = "Show Skeletons"; + this.SkeletonsCheckBox.UseVisualStyleBackColor = true; + this.SkeletonsCheckBox.CheckedChanged += new System.EventHandler(this.SkeletonsCheckBox_CheckedChanged); // // ModelForm // @@ -670,5 +685,6 @@ private System.Windows.Forms.Label TimeOfDayLabel; private System.Windows.Forms.Label label19; private System.Windows.Forms.TrackBar TimeOfDayTrackBar; + private System.Windows.Forms.CheckBox SkeletonsCheckBox; } } \ No newline at end of file diff --git a/Forms/ModelForm.cs b/Forms/ModelForm.cs index a4ab2cb..6a89fdc 100644 --- a/Forms/ModelForm.cs +++ b/Forms/ModelForm.cs @@ -122,6 +122,8 @@ namespace CodeWalker.Forms bool renderskeletons = true; List renderskeletonlist = new List(); + List skeletonLineVerts = new List(); + bool CtrlPressed = false; bool ShiftPressed = false; @@ -1416,7 +1418,14 @@ namespace CodeWalker.Forms private void RenderSkeletons(DeviceContext context) { + skeletonLineVerts.Clear(); + const uint cgrn = 4278255360;// (uint)new Color4(0.0f, 1.0f, 0.0f, 1.0f).ToRgba(); + const uint cblu = 4294901760;// (uint)new Color4(0.0f, 0.0f, 1.0f, 1.0f).ToRgba(); + VertexTypePC v1 = new VertexTypePC(); + VertexTypePC v2 = new VertexTypePC(); + v1.Colour = cgrn; + v2.Colour = cblu; foreach (var renderable in renderskeletonlist) { @@ -1435,9 +1444,9 @@ namespace CodeWalker.Forms var pind = pinds[i]; var bone = bones[i]; var pbone = bone.Parent; - //if (pbone == null) continue; + if (pbone == null) continue; //nothing to draw for the root bone - if (xforms != null) + if (xforms != null)//how to use xforms? bind pose? { var xform = (i < xforms.Length) ? xforms[i] : Matrix.Identity; var pxform = (pind < xforms.Length) ? xforms[pind] : Matrix.Identity; @@ -1447,6 +1456,21 @@ namespace CodeWalker.Forms } + //draw line from bone's position to parent position... + Vector3 lbeg = Vector3.Zero; + Vector3 lend = bone.Translation;// bone.Rotation.Multiply(); + while (pbone != null) + { + lbeg = pbone.Rotation.Multiply(lbeg) + pbone.Translation; + lend = pbone.Rotation.Multiply(lend) + pbone.Translation; + pbone = pbone.Parent; + } + + + v1.Position = lbeg; + v2.Position = lend; + skeletonLineVerts.Add(v1); + skeletonLineVerts.Add(v2); } @@ -1455,6 +1479,16 @@ namespace CodeWalker.Forms + + + if (skeletonLineVerts.Count > 0) + { + shaders.SetDepthStencilMode(context, DepthStencilMode.DisableAll); + shaders.Paths.RenderLines(context, skeletonLineVerts, camera, shaders.GlobalLights); + } + + + } @@ -2648,6 +2682,11 @@ namespace CodeWalker.Forms } } + private void SkeletonsCheckBox_CheckedChanged(object sender, EventArgs e) + { + renderskeletons = SkeletonsCheckBox.Checked; + } + private void ErrorConsoleCheckBox_CheckedChanged(object sender, EventArgs e) { ConsolePanel.Visible = ErrorConsoleCheckBox.Checked; diff --git a/GameFiles/Resources/Clip.cs b/GameFiles/Resources/Clip.cs index 5a67d3c..7df5576 100644 --- a/GameFiles/Resources/Clip.cs +++ b/GameFiles/Resources/Clip.cs @@ -60,9 +60,6 @@ namespace CodeWalker.GameFiles public AnimationMap Animations { get; set; } public ResourcePointerArray64 Clips { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); @@ -90,9 +87,6 @@ namespace CodeWalker.GameFiles ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { base.Write(writer, parameters); @@ -116,9 +110,6 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_3Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(base.GetReferences()); @@ -153,9 +144,6 @@ namespace CodeWalker.GameFiles // reference data public ResourcePointerArray64 Animations { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data @@ -179,9 +167,6 @@ namespace CodeWalker.GameFiles ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // update structure data @@ -203,9 +188,6 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_2Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); @@ -232,9 +214,6 @@ namespace CodeWalker.GameFiles public Animation Animation { get; set; } public AnimationMapEntry NextEntry { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data @@ -254,9 +233,6 @@ namespace CodeWalker.GameFiles ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // update structure data @@ -272,9 +248,6 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_1Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); @@ -322,9 +295,6 @@ namespace CodeWalker.GameFiles public ResourceSimpleList64Ptr BoneIdsPtr { get; set; } public AnimationBoneId[] BoneIds { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data @@ -356,9 +326,6 @@ namespace CodeWalker.GameFiles this.BoneIds = reader.ReadStructsAt(this.BoneIdsPtr.EntriesPointer, this.BoneIdsPtr.EntriesCount); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // write structure data @@ -428,9 +395,6 @@ namespace CodeWalker.GameFiles public ushort Unknown_1Eh { get; set; } public byte[] Data { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data @@ -485,9 +449,6 @@ namespace CodeWalker.GameFiles } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // write structure data @@ -523,9 +484,6 @@ namespace CodeWalker.GameFiles public ClipBase Clip { get; set; } public ClipMapEntry Next { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data @@ -545,9 +503,6 @@ namespace CodeWalker.GameFiles ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // update structure data @@ -563,9 +518,6 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_1Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); @@ -594,27 +546,22 @@ namespace CodeWalker.GameFiles public uint Unknown_10h { get; set; } public uint Unknown_14h { get; set; } // 0x00000000 public ulong NamePointer { get; set; } - //public uint Unknown_20h { get; set; } // short, short -> name length (+1) public ushort Unknown_20h { get; set; } // short, name length public ushort Unknown_22h { get; set; } // short, name length +1 public uint Unknown_24h { get; set; } // 0x00000000 public ulong Unknown_28hPtr { get; set; } // 0x50000000 - //public uint Unknown_2Ch { get; set; } // 0x00000000 public uint Unknown_30h { get; set; } public uint Unknown_34h { get; set; } // 0x00000000 - public ulong p2 { get; set; } - public ulong p3 { get; set; } + public ulong TagsPointer { get; set; } + public ulong PropertiesPointer { get; set; } public uint Unknown_48h { get; set; } // 0x00000001 public uint Unknown_4Ch { get; set; } // 0x00000000 // reference data public string Name { get; set; } - public Unknown_CL_200 p2data { get; set; } - public Unknown_CL_001 p3data { get; set; } + public ClipTagList Tags { get; set; } + public ClipPropertyMap Properties { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data @@ -625,29 +572,24 @@ namespace CodeWalker.GameFiles this.Unknown_10h = reader.ReadUInt32(); this.Unknown_14h = reader.ReadUInt32(); this.NamePointer = reader.ReadUInt64(); - //this.Unknown_20h = reader.ReadUInt32(); this.Unknown_20h = reader.ReadUInt16(); this.Unknown_22h = reader.ReadUInt16(); this.Unknown_24h = reader.ReadUInt32(); this.Unknown_28hPtr = reader.ReadUInt64(); - //this.Unknown_2Ch = reader.ReadUInt32(); this.Unknown_30h = reader.ReadUInt32(); this.Unknown_34h = reader.ReadUInt32(); - this.p2 = reader.ReadUInt64(); - this.p3 = reader.ReadUInt64(); + this.TagsPointer = reader.ReadUInt64(); + this.PropertiesPointer = reader.ReadUInt64(); this.Unknown_48h = reader.ReadUInt32(); this.Unknown_4Ch = reader.ReadUInt32(); - // read reference data - //this.Name = reader.ReadBlockAt( - // this.NamePointer // offset - //); + this.Name = reader.ReadStringAt(this.NamePointer); - this.p2data = reader.ReadBlockAt( - this.p2 // offset + this.Tags = reader.ReadBlockAt( + this.TagsPointer // offset ); - this.p3data = reader.ReadBlockAt( - this.p3 // offset + this.Properties = reader.ReadBlockAt( + this.PropertiesPointer // offset ); if ((Unknown_28hPtr != 0) && (Unknown_28hPtr != 0x50000000)) @@ -656,15 +598,12 @@ namespace CodeWalker.GameFiles } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // update structure data //this.NamePointer = (ulong)(this.Name != null ? this.Name.Position : 0); - this.p2 = (ulong)(this.p2data != null ? this.p2data.FilePosition : 0); - this.p3 = (ulong)(this.p3data != null ? this.p3data.FilePosition : 0); + this.TagsPointer = (ulong)(this.Tags != null ? this.Tags.FilePosition : 0); + this.PropertiesPointer = (ulong)(this.Properties != null ? this.Properties.FilePosition : 0); // write structure data writer.Write(this.VFT); @@ -677,24 +616,20 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_20h); writer.Write(this.Unknown_24h); writer.Write(this.Unknown_28hPtr); - //writer.Write(this.Unknown_2Ch); writer.Write(this.Unknown_30h); writer.Write(this.Unknown_34h); - writer.Write(this.p2); - writer.Write(this.p3); + writer.Write(this.TagsPointer); + writer.Write(this.PropertiesPointer); writer.Write(this.Unknown_48h); writer.Write(this.Unknown_4Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); //if (Name != null) list.Add(Name); - if (p2data != null) list.Add(p2data); - if (p3data != null) list.Add(p3data); + if (Tags != null) list.Add(Tags); + if (Properties != null) list.Add(Properties); return list.ToArray(); } @@ -707,7 +642,7 @@ namespace CodeWalker.GameFiles switch (type) { case 1: return new ClipAnimation(); - case 2: return new ClipAnimations(); + case 2: return new ClipAnimationList(); default: return null;// throw new Exception("Unknown type"); } } @@ -738,9 +673,6 @@ namespace CodeWalker.GameFiles // reference data public Animation Animation { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); @@ -757,9 +689,6 @@ namespace CodeWalker.GameFiles ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { base.Write(writer, parameters); @@ -775,9 +704,6 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_6Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); @@ -786,7 +712,7 @@ namespace CodeWalker.GameFiles return list.ToArray(); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipAnimations : ClipBase + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipAnimationList : ClipBase { public override long BlockLength { @@ -806,9 +732,6 @@ namespace CodeWalker.GameFiles // reference data public ResourceSimpleArray Animations { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); @@ -827,9 +750,6 @@ namespace CodeWalker.GameFiles ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { base.Write(writer, parameters); @@ -848,9 +768,6 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_6Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); @@ -876,9 +793,6 @@ namespace CodeWalker.GameFiles // reference data public Animation Animation { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data @@ -894,9 +808,6 @@ namespace CodeWalker.GameFiles ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // update structure data @@ -910,9 +821,6 @@ namespace CodeWalker.GameFiles writer.Write(this.AnimationPointer); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); @@ -922,7 +830,7 @@ namespace CodeWalker.GameFiles } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_001 : ResourceSystemBlock + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyMap : ResourceSystemBlock { public override long BlockLength { @@ -930,59 +838,50 @@ namespace CodeWalker.GameFiles } // structure data - public ulong p1 { get; set; } - public ushort c1 { get; set; } - public ushort c2 { get; set; } + public ulong PropertyEntriesPointer { get; set; } + public ushort PropertyEntriesCount { get; set; } + public ushort PropertyEntriesCapacity { get; set; } public uint Unknown_Ch { get; set; } // 0x01000000 // reference data - public ResourcePointerArray64 p1data { get; set; } + public ResourcePointerArray64 Properties { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data - this.p1 = reader.ReadUInt64(); - this.c1 = reader.ReadUInt16(); - this.c2 = reader.ReadUInt16(); + this.PropertyEntriesPointer = reader.ReadUInt64(); + this.PropertyEntriesCount = reader.ReadUInt16(); + this.PropertyEntriesCapacity = reader.ReadUInt16(); this.Unknown_Ch = reader.ReadUInt32(); // read reference data - this.p1data = reader.ReadBlockAt>( - this.p1, // offset - this.c1 + this.Properties = reader.ReadBlockAt>( + this.PropertyEntriesPointer, // offset + this.PropertyEntriesCount ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // update structure data - this.p1 = (ulong)(this.p1data != null ? this.p1data.FilePosition : 0); + this.PropertyEntriesPointer = (ulong)(this.Properties != null ? this.Properties.FilePosition : 0); //this.c1 = (ushort)(this.p1data != null ? this.p1data.Count : 0); // write structure data - writer.Write(this.p1); - writer.Write(this.c1); - writer.Write(this.c2); + writer.Write(this.PropertyEntriesPointer); + writer.Write(this.PropertyEntriesCount); + writer.Write(this.PropertyEntriesCapacity); writer.Write(this.Unknown_Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); - if (p1data != null) list.Add(p1data); + if (Properties != null) list.Add(Properties); return list.ToArray(); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_002 : ResourceSystemBlock + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyMapEntry : ResourceSystemBlock { public override long BlockLength { @@ -998,12 +897,9 @@ namespace CodeWalker.GameFiles public uint Unknown_1Ch { get; set; } // 0x00000000 // reference data - public Unknown_CL_003 Data { get; set; } - public Unknown_CL_002 Next { get; set; } + public ClipProperty Data { get; set; } + public ClipPropertyMapEntry Next { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data @@ -1015,17 +911,14 @@ namespace CodeWalker.GameFiles this.Unknown_1Ch = reader.ReadUInt32(); // read reference data - this.Data = reader.ReadBlockAt( + this.Data = reader.ReadBlockAt( this.DataPointer // offset ); - this.Next = reader.ReadBlockAt( + this.Next = reader.ReadBlockAt( this.NextPointer // offset ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // update structure data @@ -1041,9 +934,6 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_1Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); @@ -1052,7 +942,7 @@ namespace CodeWalker.GameFiles return list.ToArray(); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_003 : ResourceSystemBlock + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipProperty : ResourceSystemBlock { public override long BlockLength { @@ -1068,9 +958,9 @@ namespace CodeWalker.GameFiles public uint Unknown_14h { get; set; } // 0x00000000 public uint Unknown_18h { get; set; } public uint Unknown_1Ch { get; set; } // 0x00000000 - public ulong p1 { get; set; } - public ushort c1 { get; set; } - public ushort c2 { get; set; } + public ulong AttributesPointer { get; set; } + public ushort AttributesCount { get; set; } + public ushort AttributesCapacity { get; set; } public uint Unknown_2Ch { get; set; } // 0x00000000 public uint Unknown_30h { get; set; } // 0x00000000 public uint Unknown_34h { get; set; } // 0x00000000 @@ -1078,11 +968,8 @@ namespace CodeWalker.GameFiles public uint Unknown_3Ch { get; set; } // 0x00000000 // reference data - public ResourcePointerArray64 p1data { get; set; } + public ResourcePointerArray64 Attributes { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data @@ -1094,9 +981,9 @@ namespace CodeWalker.GameFiles this.Unknown_14h = reader.ReadUInt32(); this.Unknown_18h = reader.ReadUInt32(); this.Unknown_1Ch = reader.ReadUInt32(); - this.p1 = reader.ReadUInt64(); - this.c1 = reader.ReadUInt16(); - this.c2 = reader.ReadUInt16(); + this.AttributesPointer = reader.ReadUInt64(); + this.AttributesCount = reader.ReadUInt16(); + this.AttributesCapacity = reader.ReadUInt16(); this.Unknown_2Ch = reader.ReadUInt32(); this.Unknown_30h = reader.ReadUInt32(); this.Unknown_34h = reader.ReadUInt32(); @@ -1104,19 +991,16 @@ namespace CodeWalker.GameFiles this.Unknown_3Ch = reader.ReadUInt32(); // read reference data - this.p1data = reader.ReadBlockAt>( - this.p1, // offset - this.c1 + this.Attributes = reader.ReadBlockAt>( + this.AttributesPointer, // offset + this.AttributesCount ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // update structure data - this.p1 = (ulong)(this.p1data != null ? this.p1data.FilePosition : 0); + this.AttributesPointer = (ulong)(this.Attributes != null ? this.Attributes.FilePosition : 0); //this.c1 = (ushort)(this.p1data != null ? this.p1data.Count : 0); // write structure data @@ -1128,9 +1012,9 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_14h); writer.Write(this.Unknown_18h); writer.Write(this.Unknown_1Ch); - writer.Write(this.p1); - writer.Write(this.c1); - writer.Write(this.c2); + writer.Write(this.AttributesPointer); + writer.Write(this.AttributesCount); + writer.Write(this.AttributesCapacity); writer.Write(this.Unknown_2Ch); writer.Write(this.Unknown_30h); writer.Write(this.Unknown_34h); @@ -1138,57 +1022,57 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_3Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); - if (p1data != null) list.Add(p1data); + if (Attributes != null) list.Add(Attributes); return list.ToArray(); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_004 : ResourceSystemBlock, IResourceXXSystemBlock + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyAttribute : ResourceSystemBlock, IResourceXXSystemBlock { public override long BlockLength { get { return 16; } } - // structure data public uint VFT { get; set; } public uint Unknown_4h { get; set; } // 0x00000001 - public byte type { get; set; } - public byte Unknown_9h { get; set; } - public ushort Unknown_Ah { get; set; } - public uint Unknown_Ch { get; set; } + public byte Type { get; set; } + public byte Unknown_9h { get; set; } // 0x00 + public ushort Unknown_Ah { get; set; } // 0x0000 + public uint Unknown_Ch { get; set; } // 0x00000000 + public uint Unknown_10h { get; set; } // 0x00000000 + public uint Unknown_14h { get; set; } // 0x00000000 + public MetaHash NameHash { get; set; } + public uint Unknown_1Ch { get; set; } // 0x00000000 - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { - // read structure data this.VFT = reader.ReadUInt32(); this.Unknown_4h = reader.ReadUInt32(); - this.type = reader.ReadByte(); + this.Type = reader.ReadByte(); this.Unknown_9h = reader.ReadByte(); this.Unknown_Ah = reader.ReadUInt16(); this.Unknown_Ch = reader.ReadUInt32(); + this.Unknown_10h = reader.ReadUInt32(); + this.Unknown_14h = reader.ReadUInt32(); + this.NameHash = reader.ReadUInt32(); + this.Unknown_1Ch = reader.ReadUInt32(); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { - // write structure data writer.Write(this.VFT); writer.Write(this.Unknown_4h); - writer.Write(this.type); + writer.Write(this.Type); writer.Write(this.Unknown_9h); writer.Write(this.Unknown_Ah); writer.Write(this.Unknown_Ch); + writer.Write(this.Unknown_10h); + writer.Write(this.Unknown_14h); + writer.Write(this.NameHash); + writer.Write(this.Unknown_1Ch); } public IResourceSystemBlock GetType(ResourceDataReader reader, params object[] parameters) @@ -1199,246 +1083,166 @@ namespace CodeWalker.GameFiles switch (type) { - case 1: return new Unknown_CL_004_type1(); - case 2: return new Unknown_CL_004_type2(); - case 3: return new Unknown_CL_004_type3(); - case 4: return new Unknown_CL_004_type4(); - case 6: return new Unknown_CL_004_type6(); - case 8: return new Unknown_CL_004_type8(); + case 1: return new ClipPropertyAttributeFloat(); + case 2: return new ClipPropertyAttributeInt(); + case 3: return new ClipPropertyAttributeBool(); + case 4: return new ClipPropertyAttributeString(); + case 6: return new ClipPropertyAttributeVector3(); + case 8: return new ClipPropertyAttributeVector4(); + case 12: return new ClipPropertyAttributeHashString(); default: return null;// throw new Exception("Unknown type"); } } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_004_type1 : Unknown_CL_004 + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyAttributeFloat : ClipPropertyAttribute { public override long BlockLength { get { return 48; } } - // structure data - public uint Unknown_10h { get; set; } // 0x00000000 - public uint Unknown_14h { get; set; } // 0x00000000 - public uint Unknown_18h { get; set; } - public uint Unknown_1Ch { get; set; } // 0x00000000 - public uint Unknown_20h { get; set; } + public float Value { get; set; } public uint Unknown_24h { get; set; } // 0x00000000 public uint Unknown_28h { get; set; } // 0x00000000 public uint Unknown_2Ch { get; set; } // 0x00000000 - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); // read structure data - this.Unknown_10h = reader.ReadUInt32(); - this.Unknown_14h = reader.ReadUInt32(); - this.Unknown_18h = reader.ReadUInt32(); - this.Unknown_1Ch = reader.ReadUInt32(); - this.Unknown_20h = reader.ReadUInt32(); + this.Value = reader.ReadSingle(); this.Unknown_24h = reader.ReadUInt32(); this.Unknown_28h = reader.ReadUInt32(); this.Unknown_2Ch = reader.ReadUInt32(); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { base.Write(writer, parameters); // write structure data - writer.Write(this.Unknown_10h); - writer.Write(this.Unknown_14h); - writer.Write(this.Unknown_18h); - writer.Write(this.Unknown_1Ch); - writer.Write(this.Unknown_20h); + writer.Write(this.Value); writer.Write(this.Unknown_24h); writer.Write(this.Unknown_28h); writer.Write(this.Unknown_2Ch); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_004_type2 : Unknown_CL_004 + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyAttributeInt : ClipPropertyAttribute { public override long BlockLength { get { return 48; } } - // structure data - public uint Unknown_10h { get; set; } // 0x00000000 - public uint Unknown_14h { get; set; } // 0x00000000 - public uint Unknown_18h { get; set; } - public uint Unknown_1Ch { get; set; } // 0x00000000 - public uint Unknown_20h { get; set; } + public int Value { get; set; } public uint Unknown_24h { get; set; } // 0x00000000 public uint Unknown_28h { get; set; } // 0x00000000 public uint Unknown_2Ch { get; set; } // 0x00000000 - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); // read structure data - this.Unknown_10h = reader.ReadUInt32(); - this.Unknown_14h = reader.ReadUInt32(); - this.Unknown_18h = reader.ReadUInt32(); - this.Unknown_1Ch = reader.ReadUInt32(); - this.Unknown_20h = reader.ReadUInt32(); + this.Value = reader.ReadInt32(); this.Unknown_24h = reader.ReadUInt32(); this.Unknown_28h = reader.ReadUInt32(); this.Unknown_2Ch = reader.ReadUInt32(); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { base.Write(writer, parameters); // write structure data - writer.Write(this.Unknown_10h); - writer.Write(this.Unknown_14h); - writer.Write(this.Unknown_18h); - writer.Write(this.Unknown_1Ch); - writer.Write(this.Unknown_20h); + writer.Write(this.Value); writer.Write(this.Unknown_24h); writer.Write(this.Unknown_28h); writer.Write(this.Unknown_2Ch); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_004_type3 : Unknown_CL_004 + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyAttributeBool : ClipPropertyAttribute { public override long BlockLength { get { return 48; } } - // structure data - public uint Unknown_10h { get; set; } // 0x00000000 - public uint Unknown_14h { get; set; } // 0x00000000 - public uint Unknown_18h { get; set; } // 0x6D7255E7 - public uint Unknown_1Ch { get; set; } // 0x00000000 - public uint Unknown_20h { get; set; } // 0x00000000 + public uint Value { get; set; } public uint Unknown_24h { get; set; } // 0x00000000 public uint Unknown_28h { get; set; } // 0x00000000 public uint Unknown_2Ch { get; set; } // 0x00000000 - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); // read structure data - this.Unknown_10h = reader.ReadUInt32(); - this.Unknown_14h = reader.ReadUInt32(); - this.Unknown_18h = reader.ReadUInt32(); - this.Unknown_1Ch = reader.ReadUInt32(); - this.Unknown_20h = reader.ReadUInt32(); + this.Value = reader.ReadUInt32(); this.Unknown_24h = reader.ReadUInt32(); this.Unknown_28h = reader.ReadUInt32(); this.Unknown_2Ch = reader.ReadUInt32(); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { base.Write(writer, parameters); // write structure data - writer.Write(this.Unknown_10h); - writer.Write(this.Unknown_14h); - writer.Write(this.Unknown_18h); - writer.Write(this.Unknown_1Ch); - writer.Write(this.Unknown_20h); + writer.Write(this.Value); writer.Write(this.Unknown_24h); writer.Write(this.Unknown_28h); writer.Write(this.Unknown_2Ch); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_004_type4 : Unknown_CL_004 + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyAttributeString : ClipPropertyAttribute { public override long BlockLength { get { return 48; } } - // structure data - public uint Unknown_10h { get; set; } // 0x00000000 - public uint Unknown_14h { get; set; } // 0x00000000 - public uint Unknown_18h { get; set; } - public uint Unknown_1Ch { get; set; } // 0x00000000 - public ulong p1 { get; set; } - public ushort c1 { get; set; } - public ushort c2 { get; set; } + public ulong ValuePointer { get; set; } + public ushort ValueLength1 { get; set; } + public ushort ValueLength2 { get; set; } public uint Unknown_2Ch { get; set; } // 0x00000000 - // reference data - //public ResourceSimpleArray p1data { get; set; } // string (byte array...) - public byte[] p1data { get; set; } // string (byte array...) + public string Value; - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); // read structure data - this.Unknown_10h = reader.ReadUInt32(); - this.Unknown_14h = reader.ReadUInt32(); - this.Unknown_18h = reader.ReadUInt32(); - this.Unknown_1Ch = reader.ReadUInt32(); - this.p1 = reader.ReadUInt64(); - this.c1 = reader.ReadUInt16(); - this.c2 = reader.ReadUInt16(); + this.ValuePointer = reader.ReadUInt64(); + this.ValueLength1 = reader.ReadUInt16(); + this.ValueLength2 = reader.ReadUInt16(); this.Unknown_2Ch = reader.ReadUInt32(); - // read reference data - //this.p1data = reader.ReadBlockAt>( - // this.p1, // offset - // this.c2 + //// read reference data + //this.Value = reader.ReadBlockAt( + // this.ValuePointer // offset //); - this.p1data = reader.ReadBytesAt(this.p1, this.c2); + Value = reader.ReadStringAt(ValuePointer); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { base.Write(writer, parameters); // update structure data - //this.p1 = (ulong)(this.p1data != null ? this.p1data.Position : 0);//todo:fix!~ - ////this.c2 = (ushort)(this.p1data != null ? this.p1data.Count : 0); + //this.ValuePointer = (ulong)(this.Value != null ? this.Value.Position : 0); + //this.ValueLength1 = (ushort)(this.Value != null ? this.Value.Value.Length : 0); + //this.ValueLength2 = (ushort)(this.Value != null ? this.Value.Value.Length + 1 : 0); // write structure data - writer.Write(this.Unknown_10h); - writer.Write(this.Unknown_14h); - writer.Write(this.Unknown_18h); - writer.Write(this.Unknown_1Ch); - writer.Write(this.p1); - writer.Write(this.c1); - writer.Write(this.c2); + writer.Write(this.ValuePointer); + writer.Write(this.ValueLength1); + writer.Write(this.ValueLength2); writer.Write(this.Unknown_2Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(base.GetReferences()); @@ -1446,107 +1250,100 @@ namespace CodeWalker.GameFiles return list.ToArray(); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_004_type6 : Unknown_CL_004 + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyAttributeVector3 : ClipPropertyAttribute { public override long BlockLength { get { return 48; } } - // structure data - public uint Unknown_10h { get; set; } // 0x00000000 - public uint Unknown_14h { get; set; } // 0x00000000 - public uint Unknown_18h { get; set; } - public uint Unknown_1Ch { get; set; } // 0x00000000 - public uint Unknown_20h { get; set; } - public uint Unknown_24h { get; set; } - public uint Unknown_28h { get; set; } - public uint Unknown_2Ch { get; set; } + public float X { get; set; } + public float Y { get; set; } + public float Z { get; set; } + public float Unknown_2Ch { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); // read structure data - this.Unknown_10h = reader.ReadUInt32(); - this.Unknown_14h = reader.ReadUInt32(); - this.Unknown_18h = reader.ReadUInt32(); - this.Unknown_1Ch = reader.ReadUInt32(); - this.Unknown_20h = reader.ReadUInt32(); - this.Unknown_24h = reader.ReadUInt32(); - this.Unknown_28h = reader.ReadUInt32(); - this.Unknown_2Ch = reader.ReadUInt32(); + this.X = reader.ReadSingle(); + this.Y = reader.ReadSingle(); + this.Z = reader.ReadSingle(); + this.Unknown_2Ch = reader.ReadSingle(); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { base.Write(writer, parameters); - // write structure data - writer.Write(this.Unknown_10h); - writer.Write(this.Unknown_14h); - writer.Write(this.Unknown_18h); - writer.Write(this.Unknown_1Ch); - writer.Write(this.Unknown_20h); - writer.Write(this.Unknown_24h); - writer.Write(this.Unknown_28h); + // write structure data + writer.Write(this.X); + writer.Write(this.Y); + writer.Write(this.Z); writer.Write(this.Unknown_2Ch); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_004_type8 : Unknown_CL_004 + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyAttributeVector4 : ClipPropertyAttribute { public override long BlockLength { get { return 48; } } - // structure data - public uint Unknown_10h { get; set; } // 0x00000000 - public uint Unknown_14h { get; set; } // 0x00000000 - public uint Unknown_18h { get; set; } // 0x443D96E7 - public uint Unknown_1Ch { get; set; } // 0x00000000 - public uint Unknown_20h { get; set; } - public uint Unknown_24h { get; set; } - public uint Unknown_28h { get; set; } - public uint Unknown_2Ch { get; set; } + public float X { get; set; } + public float Y { get; set; } + public float Z { get; set; } + public float W { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); // read structure data - this.Unknown_10h = reader.ReadUInt32(); - this.Unknown_14h = reader.ReadUInt32(); - this.Unknown_18h = reader.ReadUInt32(); - this.Unknown_1Ch = reader.ReadUInt32(); - this.Unknown_20h = reader.ReadUInt32(); - this.Unknown_24h = reader.ReadUInt32(); - this.Unknown_28h = reader.ReadUInt32(); - this.Unknown_2Ch = reader.ReadUInt32(); + this.X = reader.ReadSingle(); + this.Y = reader.ReadSingle(); + this.Z = reader.ReadSingle(); + this.W = reader.ReadSingle(); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { base.Write(writer, parameters); // write structure data - writer.Write(this.Unknown_10h); - writer.Write(this.Unknown_14h); - writer.Write(this.Unknown_18h); - writer.Write(this.Unknown_1Ch); - writer.Write(this.Unknown_20h); + writer.Write(this.X); + writer.Write(this.Y); + writer.Write(this.Z); + writer.Write(this.W); + } + } + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyAttributeHashString : ClipPropertyAttribute + { + public override long BlockLength => 0x30; + + public MetaHash Value { get; set; } + public uint Unknown_24h { get; set; } // 0x00000000 + public uint Unknown_28h { get; set; } // 0x00000000 + public uint Unknown_2Ch { get; set; } // 0x00000000 + + public override void Read(ResourceDataReader reader, params object[] parameters) + { + base.Read(reader, parameters); + + // read structure data + this.Value = reader.ReadUInt32(); + this.Unknown_24h = reader.ReadUInt32(); + this.Unknown_28h = reader.ReadUInt32(); + this.Unknown_2Ch = reader.ReadUInt32(); + } + + public override void Write(ResourceDataWriter writer, params object[] parameters) + { + base.Write(writer, parameters); + + // write structure data + writer.Write(this.Value); writer.Write(this.Unknown_24h); writer.Write(this.Unknown_28h); writer.Write(this.Unknown_2Ch); @@ -1554,7 +1351,7 @@ namespace CodeWalker.GameFiles } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_200 : ResourceSystemBlock + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipTagList : ResourceSystemBlock { public override long BlockLength { @@ -1562,9 +1359,9 @@ namespace CodeWalker.GameFiles } // structure data - public ulong p1 { get; set; } - public ushort c1 { get; set; } - public ushort c2 { get; set; } + public ulong TagsPointer { get; set; } + public ushort TagCount1 { get; set; } + public ushort TagCount2 { get; set; } public uint Unknown_Ch { get; set; } // 0x00000000 public uint Unknown_10h { get; set; } public uint Unknown_14h { get; set; } // 0x00000000 @@ -1572,17 +1369,14 @@ namespace CodeWalker.GameFiles public uint Unknown_1Ch { get; set; } // 0x00000000 // reference data - public ResourcePointerArray64 p1data { get; set; } + public ResourcePointerArray64 Tags { get; set; } - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data - this.p1 = reader.ReadUInt64(); - this.c1 = reader.ReadUInt16(); - this.c2 = reader.ReadUInt16(); + this.TagsPointer = reader.ReadUInt64(); + this.TagCount1 = reader.ReadUInt16(); + this.TagCount2 = reader.ReadUInt16(); this.Unknown_Ch = reader.ReadUInt32(); this.Unknown_10h = reader.ReadUInt32(); this.Unknown_14h = reader.ReadUInt32(); @@ -1590,25 +1384,22 @@ namespace CodeWalker.GameFiles this.Unknown_1Ch = reader.ReadUInt32(); // read reference data - this.p1data = reader.ReadBlockAt>( - this.p1, // offset - this.c1 + this.Tags = reader.ReadBlockAt>( + this.TagsPointer, // offset + this.TagCount1 ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { // update structure data - this.p1 = (ulong)(this.p1data != null ? this.p1data.FilePosition : 0); + this.TagsPointer = (ulong)(this.Tags != null ? this.Tags.FilePosition : 0); //this.c1 = (ushort)(this.p1data != null ? this.p1data.Count : 0); // write structure data - writer.Write(this.p1); - writer.Write(this.c1); - writer.Write(this.c2); + writer.Write(this.TagsPointer); + writer.Write(this.TagCount1); + writer.Write(this.TagCount2); writer.Write(this.Unknown_Ch); writer.Write(this.Unknown_10h); writer.Write(this.Unknown_14h); @@ -1616,189 +1407,63 @@ namespace CodeWalker.GameFiles writer.Write(this.Unknown_1Ch); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { var list = new List(); - if (p1data != null) list.Add(p1data); + if (Tags != null) list.Add(Tags); return list.ToArray(); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_201 : ResourceSystemBlock + [TypeConverter(typeof(ExpandableObjectConverter))] public class ClipTag : ClipProperty { public override long BlockLength { get { return 80; } } - // structure data - public uint VFT { get; set; } - public uint Unknown_4h { get; set; } // 0x00000001 - public uint Unknown_8h { get; set; } // 0x00000000 - public uint Unknown_Ch { get; set; } // 0x00000000 - public uint Unknown_10h { get; set; } // 0x00000000 - public uint Unknown_14h { get; set; } // 0x00000000 - public uint Unknown_18h { get; set; } - public uint Unknown_1Ch { get; set; } // 0x00000000 - public ulong p0 { get; set; } - public ushort c1 { get; set; } - public ushort c2 { get; set; } - public uint Unknown_2Ch { get; set; } // 0x00000000 - public uint Unknown_30h { get; set; } // 0x00000000 - public uint Unknown_34h { get; set; } // 0x00000000 - public uint Unknown_38h { get; set; } - public uint Unknown_3Ch { get; set; } // 0x00000000 public uint Unknown_40h { get; set; } public uint Unknown_44h { get; set; } - public ulong p1 { get; set; } + public ulong TagsPointer { get; set; } // reference data - public ResourcePointerArray64 p0data { get; set; } - public Unknown_CL_200 p1data { get; set; } + public ClipTagList Tags { get; set; } + - /// - /// Reads the data-block from a stream. - /// public override void Read(ResourceDataReader reader, params object[] parameters) { + base.Read(reader, parameters); + // read structure data - this.VFT = reader.ReadUInt32(); - this.Unknown_4h = reader.ReadUInt32(); - this.Unknown_8h = reader.ReadUInt32(); - this.Unknown_Ch = reader.ReadUInt32(); - this.Unknown_10h = reader.ReadUInt32(); - this.Unknown_14h = reader.ReadUInt32(); - this.Unknown_18h = reader.ReadUInt32(); - this.Unknown_1Ch = reader.ReadUInt32(); - this.p0 = reader.ReadUInt64(); - this.c1 = reader.ReadUInt16(); - this.c2 = reader.ReadUInt16(); - this.Unknown_2Ch = reader.ReadUInt32(); - this.Unknown_30h = reader.ReadUInt32(); - this.Unknown_34h = reader.ReadUInt32(); - this.Unknown_38h = reader.ReadUInt32(); - this.Unknown_3Ch = reader.ReadUInt32(); this.Unknown_40h = reader.ReadUInt32(); this.Unknown_44h = reader.ReadUInt32(); - this.p1 = reader.ReadUInt64(); + this.TagsPointer = reader.ReadUInt64(); // read reference data - this.p0data = reader.ReadBlockAt>( - this.p0, // offset - this.c1 - ); - this.p1data = reader.ReadBlockAt( - this.p1 // offset + this.Tags = reader.ReadBlockAt( + this.TagsPointer // offset ); } - /// - /// Writes the data-block to a stream. - /// public override void Write(ResourceDataWriter writer, params object[] parameters) { - // update structure data - this.p0 = (ulong)(this.p0data != null ? this.p0data.FilePosition : 0); - //this.c1 = (ushort)(this.p0data != null ? this.p0data.Count : 0); - this.p1 = (ulong)(this.p1data != null ? this.p1data.FilePosition : 0); + base.Write(writer, parameters); - // write structure data - writer.Write(this.VFT); - writer.Write(this.Unknown_4h); - writer.Write(this.Unknown_8h); - writer.Write(this.Unknown_Ch); - writer.Write(this.Unknown_10h); - writer.Write(this.Unknown_14h); - writer.Write(this.Unknown_18h); - writer.Write(this.Unknown_1Ch); - writer.Write(this.p0); - writer.Write(this.c1); - writer.Write(this.c2); - writer.Write(this.Unknown_2Ch); - writer.Write(this.Unknown_30h); - writer.Write(this.Unknown_34h); - writer.Write(this.Unknown_38h); - writer.Write(this.Unknown_3Ch); + // update structure data + this.TagsPointer = (ulong)(this.Tags != null ? this.Tags.FilePosition : 0); + + // write structure data writer.Write(this.Unknown_40h); writer.Write(this.Unknown_44h); - writer.Write(this.p1); + writer.Write(this.TagsPointer); } - /// - /// Returns a list of data blocks which are referenced by this block. - /// public override IResourceBlock[] GetReferences() { - var list = new List(); - if (p0data != null) list.Add(p0data); - if (p1data != null) list.Add(p1data); + var list = new List(base.GetReferences()); + if (Tags != null) list.Add(Tags); return list.ToArray(); } } - [TypeConverter(typeof(ExpandableObjectConverter))] public class Unknown_CL_202 : ResourceSystemBlock - { - public override long BlockLength - { - get { return 48; } - } - - // structure data - public uint VFT { get; set; } - public uint Unknown_4h { get; set; } // 0x00000001 - public uint Unknown_8h { get; set; } - public uint Unknown_Ch { get; set; } // 0x00000000 - public uint Unknown_10h { get; set; } // 0x00000000 - public uint Unknown_14h { get; set; } // 0x00000000 - public uint Unknown_18h { get; set; } - public uint Unknown_1Ch { get; set; } // 0x00000000 - public uint Unknown_20h { get; set; } - public uint Unknown_24h { get; set; } - public uint Unknown_28h { get; set; } - public uint Unknown_2Ch { get; set; } - - /// - /// Reads the data-block from a stream. - /// - public override void Read(ResourceDataReader reader, params object[] parameters) - { - // read structure data - this.VFT = reader.ReadUInt32(); - this.Unknown_4h = reader.ReadUInt32(); - this.Unknown_8h = reader.ReadUInt32(); - this.Unknown_Ch = reader.ReadUInt32(); - this.Unknown_10h = reader.ReadUInt32(); - this.Unknown_14h = reader.ReadUInt32(); - this.Unknown_18h = reader.ReadUInt32(); - this.Unknown_1Ch = reader.ReadUInt32(); - this.Unknown_20h = reader.ReadUInt32(); - this.Unknown_24h = reader.ReadUInt32(); - this.Unknown_28h = reader.ReadUInt32(); - this.Unknown_2Ch = reader.ReadUInt32(); - } - - /// - /// Writes the data-block to a stream. - /// - public override void Write(ResourceDataWriter writer, params object[] parameters) - { - // write structure data - writer.Write(this.VFT); - writer.Write(this.Unknown_4h); - writer.Write(this.Unknown_8h); - writer.Write(this.Unknown_Ch); - writer.Write(this.Unknown_10h); - writer.Write(this.Unknown_14h); - writer.Write(this.Unknown_18h); - writer.Write(this.Unknown_1Ch); - writer.Write(this.Unknown_20h); - writer.Write(this.Unknown_24h); - writer.Write(this.Unknown_28h); - writer.Write(this.Unknown_2Ch); - } - } - } diff --git a/GameFiles/Resources/Drawable.cs b/GameFiles/Resources/Drawable.cs index d13e601..a1b0768 100644 --- a/GameFiles/Resources/Drawable.cs +++ b/GameFiles/Resources/Drawable.cs @@ -1,4 +1,5 @@ -using System; +using SharpDX; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; @@ -708,19 +709,22 @@ namespace CodeWalker.GameFiles } // structure data - public float RotationX { get; set; } - public float RotationY { get; set; } - public float RotationZ { get; set; } - public float RotationW { get; set; } - public float TranslationX { get; set; } - public float TranslationY { get; set; } - public float TranslationZ { get; set; } + //public float RotationX { get; set; } + //public float RotationY { get; set; } + //public float RotationZ { get; set; } + //public float RotationW { get; set; } + public Quaternion Rotation { get; set; } + public Vector3 Translation { get; set; } + //public float TranslationX { get; set; } + //public float TranslationY { get; set; } + //public float TranslationZ { get; set; } public uint Unknown_1Ch { get; set; } // 0x00000000 public float Unknown_20h { get; set; } // 1.0 public float Unknown_24h { get; set; } // 1.0 public float Unknown_28h { get; set; } // 1.0 public float Unknown_2Ch { get; set; } // 1.0 - public uint Unknown_30h { get; set; } + public ushort Unknown_30h { get; set; } //limb end index? IK chain? + public short ParentIndex { get; set; } public uint Unknown_34h { get; set; } // 0x00000000 public ulong NamePointer { get; set; } public ushort Unknown_40h { get; set; } @@ -742,19 +746,22 @@ namespace CodeWalker.GameFiles public override void Read(ResourceDataReader reader, params object[] parameters) { // read structure data - this.RotationX = reader.ReadSingle(); - this.RotationY = reader.ReadSingle(); - this.RotationZ = reader.ReadSingle(); - this.RotationW = reader.ReadSingle(); - this.TranslationX = reader.ReadSingle(); - this.TranslationY = reader.ReadSingle(); - this.TranslationZ = reader.ReadSingle(); + //this.RotationX = reader.ReadSingle(); + //this.RotationY = reader.ReadSingle(); + //this.RotationZ = reader.ReadSingle(); + //this.RotationW = reader.ReadSingle(); + this.Rotation = new Quaternion(reader.ReadVector4()); + this.Translation = reader.ReadVector3(); + //this.TranslationX = reader.ReadSingle(); + //this.TranslationY = reader.ReadSingle(); + //this.TranslationZ = reader.ReadSingle(); this.Unknown_1Ch = reader.ReadUInt32(); this.Unknown_20h = reader.ReadSingle(); this.Unknown_24h = reader.ReadSingle(); this.Unknown_28h = reader.ReadSingle(); this.Unknown_2Ch = reader.ReadSingle(); - this.Unknown_30h = reader.ReadUInt32(); + this.Unknown_30h = reader.ReadUInt16(); + this.ParentIndex = reader.ReadInt16(); this.Unknown_34h = reader.ReadUInt32(); this.NamePointer = reader.ReadUInt64(); this.Unknown_40h = reader.ReadUInt16(); @@ -779,19 +786,22 @@ namespace CodeWalker.GameFiles //this.NamePointer = (ulong)(this.Name != null ? this.Name.Position : 0); //TODO: fix // write structure data - writer.Write(this.RotationX); - writer.Write(this.RotationY); - writer.Write(this.RotationZ); - writer.Write(this.RotationW); - writer.Write(this.TranslationX); - writer.Write(this.TranslationY); - writer.Write(this.TranslationZ); + //writer.Write(this.RotationX); + //writer.Write(this.RotationY); + //writer.Write(this.RotationZ); + //writer.Write(this.RotationW); + writer.Write(this.Rotation.ToVector4()); + writer.Write(this.Translation); + //writer.Write(this.TranslationX); + //writer.Write(this.TranslationY); + //writer.Write(this.TranslationZ); writer.Write(this.Unknown_1Ch); writer.Write(this.Unknown_20h); writer.Write(this.Unknown_24h); writer.Write(this.Unknown_28h); writer.Write(this.Unknown_2Ch); writer.Write(this.Unknown_30h); + writer.Write(this.ParentIndex); writer.Write(this.Unknown_34h); writer.Write(this.NamePointer); writer.Write(this.Unknown_40h); diff --git a/ProjectForm.Designer.cs b/ProjectForm.Designer.cs index 969a80b..5a91a36 100644 --- a/ProjectForm.Designer.cs +++ b/ProjectForm.Designer.cs @@ -100,25 +100,20 @@ this.EntityPanel = new System.Windows.Forms.Panel(); this.EntityTabControl = new System.Windows.Forms.TabControl(); this.EntityGeneralTabPage = new System.Windows.Forms.TabPage(); + this.EntityFlagsCheckedListBox = new System.Windows.Forms.CheckedListBox(); this.label13 = new System.Windows.Forms.Label(); this.label28 = new System.Windows.Forms.Label(); this.EntityDeleteButton = new System.Windows.Forms.Button(); this.EntityTintValueTextBox = new System.Windows.Forms.TextBox(); this.EntityAddToProjectButton = new System.Windows.Forms.Button(); this.label27 = new System.Windows.Forms.Label(); - this.label16 = new System.Windows.Forms.Label(); this.EntityArtificialAOTextBox = new System.Windows.Forms.TextBox(); - this.EntityPositionTextBox = new System.Windows.Forms.TextBox(); this.label26 = new System.Windows.Forms.Label(); - this.EntityNormalizeRotationButton = new System.Windows.Forms.Button(); this.EntityAOMultiplierTextBox = new System.Windows.Forms.TextBox(); this.EntityGuidTextBox = new System.Windows.Forms.TextBox(); this.EntityPriorityLevelComboBox = new System.Windows.Forms.ComboBox(); this.label24 = new System.Windows.Forms.Label(); - this.EntityGoToButton = new System.Windows.Forms.Button(); - this.label17 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); - this.EntityRotationTextBox = new System.Windows.Forms.TextBox(); this.EntityFlagsTextBox = new System.Windows.Forms.TextBox(); this.label18 = new System.Windows.Forms.Label(); this.EntityLodLevelComboBox = new System.Windows.Forms.ComboBox(); @@ -133,6 +128,12 @@ this.EntityScaleZTextBox = new System.Windows.Forms.TextBox(); this.EntityLodDistTextBox = new System.Windows.Forms.TextBox(); this.EntityArchetypeTextBox = new System.Windows.Forms.TextBox(); + this.label16 = new System.Windows.Forms.Label(); + this.EntityPositionTextBox = new System.Windows.Forms.TextBox(); + this.EntityNormalizeRotationButton = new System.Windows.Forms.Button(); + this.EntityGoToButton = new System.Windows.Forms.Button(); + this.label17 = new System.Windows.Forms.Label(); + this.EntityRotationTextBox = new System.Windows.Forms.TextBox(); this.EntityLodTabPage = new System.Windows.Forms.TabPage(); this.label20 = new System.Windows.Forms.Label(); this.EntityParentIndexTextBox = new System.Windows.Forms.TextBox(); @@ -149,6 +150,7 @@ this.EntityPivotRotationTextBox = new System.Windows.Forms.TextBox(); this.YmapCarGenTabPage = new System.Windows.Forms.TabPage(); this.CarGenPanel = new System.Windows.Forms.Panel(); + this.CarFlagsCheckedListBox = new System.Windows.Forms.CheckedListBox(); this.CarDeleteButton = new System.Windows.Forms.Button(); this.CarAddToProjectButton = new System.Windows.Forms.Button(); this.label44 = new System.Windows.Forms.Label(); @@ -666,8 +668,6 @@ this.OptionsHideGTAVMapMenu = new System.Windows.Forms.ToolStripMenuItem(); this.SaveFileDialog = new System.Windows.Forms.SaveFileDialog(); this.OpenFileDialog = new System.Windows.Forms.OpenFileDialog(); - this.CarFlagsCheckedListBox = new System.Windows.Forms.CheckedListBox(); - this.EntityFlagsCheckedListBox = new System.Windows.Forms.CheckedListBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -1025,7 +1025,6 @@ this.ProjectManifestTextBox.CommentPrefix = null; this.ProjectManifestTextBox.Cursor = System.Windows.Forms.Cursors.IBeam; this.ProjectManifestTextBox.DisabledColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180))))); - this.ProjectManifestTextBox.Font = new System.Drawing.Font("Courier New", 9.75F); this.ProjectManifestTextBox.IsReplaceMode = false; this.ProjectManifestTextBox.Language = FastColoredTextBoxNS.Language.XML; this.ProjectManifestTextBox.LeftBracket = '<'; @@ -1676,6 +1675,51 @@ this.EntityGeneralTabPage.Text = "General"; this.EntityGeneralTabPage.UseVisualStyleBackColor = true; // + // EntityFlagsCheckedListBox + // + this.EntityFlagsCheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Right))); + this.EntityFlagsCheckedListBox.CheckOnClick = true; + this.EntityFlagsCheckedListBox.FormattingEnabled = true; + this.EntityFlagsCheckedListBox.Items.AddRange(new object[] { + "1 - Unk01", + "2 - Unk02", + "4 - Unk03", + "8 - Unk04", + "16 - Unk05", + "32 - Unk06", + "64 - Unk07", + "128 - Unk08", + "256 - Unk09", + "512 - Unk10", + "1024 - Unk11", + "2048 - Unk12", + "4096 - Unk13", + "8192 - Unk14", + "16384 - Unk15", + "32768 - Unk16", + "65536 - Unk17", + "131072 - Unk18", + "262144 - Unk19", + "524288 - Unk20", + "1048576 - Unk21", + "2097152 - Unk22", + "4194304 - Unk23", + "8388608 - Unk24", + "16777216 - Unk25", + "33554432 - Unk26", + "67108864 - Unk27", + "134217728 - Unk28", + "268435456 - Unk29", + "536870912 - Unk30", + "1073741824 - Unk31", + "2147483648 - Unk32"}); + this.EntityFlagsCheckedListBox.Location = new System.Drawing.Point(292, 113); + this.EntityFlagsCheckedListBox.Name = "EntityFlagsCheckedListBox"; + this.EntityFlagsCheckedListBox.Size = new System.Drawing.Size(201, 289); + this.EntityFlagsCheckedListBox.TabIndex = 32; + this.EntityFlagsCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.EntityFlagsCheckedListBox_ItemCheck); + // // label13 // this.label13.AutoSize = true; @@ -1733,15 +1777,6 @@ this.label27.TabIndex = 26; this.label27.Text = "ArtificialAO:"; // - // label16 - // - this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(15, 12); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(47, 13); - this.label16.TabIndex = 1; - this.label16.Text = "Position:"; - // // EntityArtificialAOTextBox // this.EntityArtificialAOTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -1752,16 +1787,6 @@ this.EntityArtificialAOTextBox.TabIndex = 27; this.EntityArtificialAOTextBox.TextChanged += new System.EventHandler(this.EntityArtificialAOTextBox_TextChanged); // - // EntityPositionTextBox - // - this.EntityPositionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.EntityPositionTextBox.Location = new System.Drawing.Point(93, 9); - this.EntityPositionTextBox.Name = "EntityPositionTextBox"; - this.EntityPositionTextBox.Size = new System.Drawing.Size(326, 20); - this.EntityPositionTextBox.TabIndex = 2; - this.EntityPositionTextBox.TextChanged += new System.EventHandler(this.EntityPositionTextBox_TextChanged); - // // label26 // this.label26.AutoSize = true; @@ -1771,17 +1796,6 @@ this.label26.TabIndex = 24; this.label26.Text = "AOMultiplier:"; // - // EntityNormalizeRotationButton - // - this.EntityNormalizeRotationButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.EntityNormalizeRotationButton.Location = new System.Drawing.Point(425, 33); - this.EntityNormalizeRotationButton.Name = "EntityNormalizeRotationButton"; - this.EntityNormalizeRotationButton.Size = new System.Drawing.Size(68, 23); - this.EntityNormalizeRotationButton.TabIndex = 6; - this.EntityNormalizeRotationButton.Text = "Normalize"; - this.EntityNormalizeRotationButton.UseVisualStyleBackColor = true; - this.EntityNormalizeRotationButton.Click += new System.EventHandler(this.EntityNormalizeRotationButton_Click); - // // EntityAOMultiplierTextBox // this.EntityAOMultiplierTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -1823,26 +1837,6 @@ this.label24.TabIndex = 22; this.label24.Text = "PriorityLevel:"; // - // EntityGoToButton - // - this.EntityGoToButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.EntityGoToButton.Location = new System.Drawing.Point(425, 7); - this.EntityGoToButton.Name = "EntityGoToButton"; - this.EntityGoToButton.Size = new System.Drawing.Size(68, 23); - this.EntityGoToButton.TabIndex = 3; - this.EntityGoToButton.Text = "Go to"; - this.EntityGoToButton.UseVisualStyleBackColor = true; - this.EntityGoToButton.Click += new System.EventHandler(this.EntityGoToButton_Click); - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(15, 38); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(50, 13); - this.label17.TabIndex = 4; - this.label17.Text = "Rotation:"; - // // label15 // this.label15.AutoSize = true; @@ -1852,16 +1846,6 @@ this.label15.TabIndex = 10; this.label15.Text = "GUID:"; // - // EntityRotationTextBox - // - this.EntityRotationTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.EntityRotationTextBox.Location = new System.Drawing.Point(93, 35); - this.EntityRotationTextBox.Name = "EntityRotationTextBox"; - this.EntityRotationTextBox.Size = new System.Drawing.Size(326, 20); - this.EntityRotationTextBox.TabIndex = 5; - this.EntityRotationTextBox.TextChanged += new System.EventHandler(this.EntityRotationTextBox_TextChanged); - // // EntityFlagsTextBox // this.EntityFlagsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -1998,6 +1982,66 @@ this.EntityArchetypeTextBox.TabIndex = 8; this.EntityArchetypeTextBox.TextChanged += new System.EventHandler(this.EntityArchetypeTextBox_TextChanged); // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(15, 12); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(47, 13); + this.label16.TabIndex = 1; + this.label16.Text = "Position:"; + // + // EntityPositionTextBox + // + this.EntityPositionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.EntityPositionTextBox.Location = new System.Drawing.Point(93, 9); + this.EntityPositionTextBox.Name = "EntityPositionTextBox"; + this.EntityPositionTextBox.Size = new System.Drawing.Size(326, 20); + this.EntityPositionTextBox.TabIndex = 2; + this.EntityPositionTextBox.TextChanged += new System.EventHandler(this.EntityPositionTextBox_TextChanged); + // + // EntityNormalizeRotationButton + // + this.EntityNormalizeRotationButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.EntityNormalizeRotationButton.Location = new System.Drawing.Point(425, 33); + this.EntityNormalizeRotationButton.Name = "EntityNormalizeRotationButton"; + this.EntityNormalizeRotationButton.Size = new System.Drawing.Size(68, 23); + this.EntityNormalizeRotationButton.TabIndex = 6; + this.EntityNormalizeRotationButton.Text = "Normalize"; + this.EntityNormalizeRotationButton.UseVisualStyleBackColor = true; + this.EntityNormalizeRotationButton.Click += new System.EventHandler(this.EntityNormalizeRotationButton_Click); + // + // EntityGoToButton + // + this.EntityGoToButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.EntityGoToButton.Location = new System.Drawing.Point(425, 7); + this.EntityGoToButton.Name = "EntityGoToButton"; + this.EntityGoToButton.Size = new System.Drawing.Size(68, 23); + this.EntityGoToButton.TabIndex = 3; + this.EntityGoToButton.Text = "Go to"; + this.EntityGoToButton.UseVisualStyleBackColor = true; + this.EntityGoToButton.Click += new System.EventHandler(this.EntityGoToButton_Click); + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(15, 38); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(50, 13); + this.label17.TabIndex = 4; + this.label17.Text = "Rotation:"; + // + // EntityRotationTextBox + // + this.EntityRotationTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.EntityRotationTextBox.Location = new System.Drawing.Point(93, 35); + this.EntityRotationTextBox.Name = "EntityRotationTextBox"; + this.EntityRotationTextBox.Size = new System.Drawing.Size(326, 20); + this.EntityRotationTextBox.TabIndex = 5; + this.EntityRotationTextBox.TextChanged += new System.EventHandler(this.EntityRotationTextBox_TextChanged); + // // EntityLodTabPage // this.EntityLodTabPage.Controls.Add(this.label20); @@ -2195,6 +2239,51 @@ this.CarGenPanel.Size = new System.Drawing.Size(510, 443); this.CarGenPanel.TabIndex = 0; // + // CarFlagsCheckedListBox + // + this.CarFlagsCheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Right))); + this.CarFlagsCheckedListBox.CheckOnClick = true; + this.CarFlagsCheckedListBox.FormattingEnabled = true; + this.CarFlagsCheckedListBox.Items.AddRange(new object[] { + "1 - Unk01", + "2 - Unk02", + "4 - Unk03", + "8 - Unk04", + "16 - Unk05", + "32 - Unk06", + "64 - Unk07", + "128 - Unk08", + "256 - Unk09", + "512 - Unk10", + "1024 - Unk11", + "2048 - Unk12", + "4096 - Unk13", + "8192 - Unk14", + "16384 - Unk15", + "32768 - Unk16", + "65536 - Unk17", + "131072 - Unk18", + "262144 - Unk19", + "524288 - Unk20", + "1048576 - Unk21", + "2097152 - Unk22", + "4194304 - Unk23", + "8388608 - Unk24", + "16777216 - Unk25", + "33554432 - Unk26", + "67108864 - Unk27", + "134217728 - Unk28", + "268435456 - Unk29", + "536870912 - Unk30", + "1073741824 - Unk31", + "2147483648 - Unk32"}); + this.CarFlagsCheckedListBox.Location = new System.Drawing.Point(304, 113); + this.CarFlagsCheckedListBox.Name = "CarFlagsCheckedListBox"; + this.CarFlagsCheckedListBox.Size = new System.Drawing.Size(201, 319); + this.CarFlagsCheckedListBox.TabIndex = 73; + this.CarFlagsCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.CarFlagsCheckedListBox_ItemCheck); + // // CarDeleteButton // this.CarDeleteButton.Location = new System.Drawing.Point(168, 392); @@ -5576,6 +5665,7 @@ // // label160 // + this.label160.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label160.AutoSize = true; this.label160.Location = new System.Drawing.Point(332, 160); this.label160.Name = "label160"; @@ -6824,6 +6914,7 @@ // // label159 // + this.label159.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label159.AutoSize = true; this.label159.Location = new System.Drawing.Point(341, 150); this.label159.Name = "label159"; @@ -7946,96 +8037,6 @@ // this.OpenFileDialog.Filter = "CodeWalker Projects|*.cwproj"; // - // CarFlagsCheckedListBox - // - this.CarFlagsCheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.CarFlagsCheckedListBox.CheckOnClick = true; - this.CarFlagsCheckedListBox.FormattingEnabled = true; - this.CarFlagsCheckedListBox.Items.AddRange(new object[] { - "1 - Unk01", - "2 - Unk02", - "4 - Unk03", - "8 - Unk04", - "16 - Unk05", - "32 - Unk06", - "64 - Unk07", - "128 - Unk08", - "256 - Unk09", - "512 - Unk10", - "1024 - Unk11", - "2048 - Unk12", - "4096 - Unk13", - "8192 - Unk14", - "16384 - Unk15", - "32768 - Unk16", - "65536 - Unk17", - "131072 - Unk18", - "262144 - Unk19", - "524288 - Unk20", - "1048576 - Unk21", - "2097152 - Unk22", - "4194304 - Unk23", - "8388608 - Unk24", - "16777216 - Unk25", - "33554432 - Unk26", - "67108864 - Unk27", - "134217728 - Unk28", - "268435456 - Unk29", - "536870912 - Unk30", - "1073741824 - Unk31", - "2147483648 - Unk32"}); - this.CarFlagsCheckedListBox.Location = new System.Drawing.Point(304, 113); - this.CarFlagsCheckedListBox.Name = "CarFlagsCheckedListBox"; - this.CarFlagsCheckedListBox.Size = new System.Drawing.Size(201, 319); - this.CarFlagsCheckedListBox.TabIndex = 73; - this.CarFlagsCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.CarFlagsCheckedListBox_ItemCheck); - // - // EntityFlagsCheckedListBox - // - this.EntityFlagsCheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.EntityFlagsCheckedListBox.CheckOnClick = true; - this.EntityFlagsCheckedListBox.FormattingEnabled = true; - this.EntityFlagsCheckedListBox.Items.AddRange(new object[] { - "1 - Unk01", - "2 - Unk02", - "4 - Unk03", - "8 - Unk04", - "16 - Unk05", - "32 - Unk06", - "64 - Unk07", - "128 - Unk08", - "256 - Unk09", - "512 - Unk10", - "1024 - Unk11", - "2048 - Unk12", - "4096 - Unk13", - "8192 - Unk14", - "16384 - Unk15", - "32768 - Unk16", - "65536 - Unk17", - "131072 - Unk18", - "262144 - Unk19", - "524288 - Unk20", - "1048576 - Unk21", - "2097152 - Unk22", - "4194304 - Unk23", - "8388608 - Unk24", - "16777216 - Unk25", - "33554432 - Unk26", - "67108864 - Unk27", - "134217728 - Unk28", - "268435456 - Unk29", - "536870912 - Unk30", - "1073741824 - Unk31", - "2147483648 - Unk32"}); - this.EntityFlagsCheckedListBox.Location = new System.Drawing.Point(292, 113); - this.EntityFlagsCheckedListBox.Name = "EntityFlagsCheckedListBox"; - this.EntityFlagsCheckedListBox.Size = new System.Drawing.Size(201, 289); - this.EntityFlagsCheckedListBox.TabIndex = 32; - this.EntityFlagsCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.EntityFlagsCheckedListBox_ItemCheck); - // // ProjectForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/World/Scenarios.cs b/World/Scenarios.cs index 111b071..7cf5305 100644 --- a/World/Scenarios.cs +++ b/World/Scenarios.cs @@ -34,6 +34,14 @@ namespace CodeWalker.World ScenarioRegions = new List(); + //rubidium: + //the non-replacement [XML] is hash 1074D56E + //replacement XML is 203D234 I think and replacement PSO A6F20ADA + //('replacement' implies 'when a DLC loads it it unloads the existing spmanifest first') + //- content.xml fileType for sp_manifest + + + //Vector2I maxgrid = new Vector2I(0, 0); //List griddims = new List(); //int maxcells = 0;