diff --git a/CodeWalker.Core/GameFiles/MetaTypes/MetaBuilder.cs b/CodeWalker.Core/GameFiles/MetaTypes/MetaBuilder.cs index 9c70545..155c64c 100644 --- a/CodeWalker.Core/GameFiles/MetaTypes/MetaBuilder.cs +++ b/CodeWalker.Core/GameFiles/MetaTypes/MetaBuilder.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using SharpDX; namespace CodeWalker.GameFiles { @@ -151,7 +152,7 @@ namespace CodeWalker.GameFiles return new Array_Structure(ptr); } - public Array_Vector3 AddPaddedVector3ArrayPtr(SharpDX.Vector4[] items) + public Array_Vector3 AddPaddedVector3ArrayPtr(Vector4[] items) { if ((items == null) || (items.Length == 0)) return new Array_Vector3(); var ptr = AddItemArray(MetaName.VECTOR4, items); //padded to vec4... diff --git a/CodeWalker.Core/GameFiles/Resources/Bounds.cs b/CodeWalker.Core/GameFiles/Resources/Bounds.cs index e4e5d21..658e823 100644 --- a/CodeWalker.Core/GameFiles/Resources/Bounds.cs +++ b/CodeWalker.Core/GameFiles/Resources/Bounds.cs @@ -115,16 +115,16 @@ namespace CodeWalker.GameFiles public float BoundingSphereRadius { get; set; } public uint Unknown_18h { get; set; } public uint Unknown_1Ch { get; set; } - public SharpDX.Vector3 BoundingBoxMax { get; set; } + public Vector3 BoundingBoxMax { get; set; } public float Margin { get; set; } - public SharpDX.Vector3 BoundingBoxMin { get; set; } + public Vector3 BoundingBoxMin { get; set; } public uint Unknown_3Ch { get; set; } - public SharpDX.Vector3 BoundingBoxCenter { get; set; } + public Vector3 BoundingBoxCenter { get; set; } public byte MaterialIndex { get; set; } public byte ProceduralId { get; set; } public byte RoomId_and_PedDensity { get; set; } //5bits for RoomID and then 3bits for PedDensity public byte Unknown_4Fh { get; set; } //flags? (bit5 related to Unknown_5Ch, should be a flag called "Has PolyFlags")<-- i don't remember why i wrote this lol - public SharpDX.Vector3 Center { get; set; } + public Vector3 Center { get; set; } public byte PolyFlags { get; set; } public byte MaterialColorIndex { get; set; } public ushort Unknown_5Eh { get; set; } @@ -163,16 +163,16 @@ namespace CodeWalker.GameFiles this.BoundingSphereRadius = reader.ReadSingle(); this.Unknown_18h = reader.ReadUInt32(); this.Unknown_1Ch = reader.ReadUInt32(); - this.BoundingBoxMax = reader.ReadStruct(); + this.BoundingBoxMax = reader.ReadStruct(); this.Margin = reader.ReadSingle(); - this.BoundingBoxMin = reader.ReadStruct(); + this.BoundingBoxMin = reader.ReadStruct(); this.Unknown_3Ch = reader.ReadUInt32(); - this.BoundingBoxCenter = reader.ReadStruct(); + this.BoundingBoxCenter = reader.ReadStruct(); this.MaterialIndex = reader.ReadByte(); this.ProceduralId = reader.ReadByte(); this.RoomId_and_PedDensity = reader.ReadByte(); this.Unknown_4Fh = reader.ReadByte(); - this.Center = reader.ReadStruct(); + this.Center = reader.ReadStruct(); this.PolyFlags = reader.ReadByte(); this.MaterialColorIndex = reader.ReadByte(); this.Unknown_5Eh = reader.ReadUInt16(); @@ -867,8 +867,8 @@ namespace CodeWalker.GameFiles //public ResourceSimpleArray ChildrenBoundingBoxes { get; set; } //public ResourceSimpleArray Unknown_90h_Data { get; set; } //public ResourceSimpleArray Unknown_98h_Data { get; set; } - public SharpDX.Matrix[] ChildrenTransformation1 { get; set; } - public SharpDX.Matrix[] ChildrenTransformation2 { get; set; } + public Matrix[] ChildrenTransformation1 { get; set; } + public Matrix[] ChildrenTransformation2 { get; set; } public AABB_s[] ChildrenBoundingBoxes { get; set; } public BoundComposite_Unknown_B_002_s[] Unknown_90h_Data { get; set; } public BoundComposite_Unknown_B_002_s[] Unknown_98h_Data { get; set; } @@ -930,8 +930,8 @@ namespace CodeWalker.GameFiles //); - this.ChildrenTransformation1 = reader.ReadStructsAt(this.ChildrenTransformation1Pointer, this.ChildrenCount1); - this.ChildrenTransformation2 = reader.ReadStructsAt(this.ChildrenTransformation2Pointer, this.ChildrenCount1); + this.ChildrenTransformation1 = reader.ReadStructsAt(this.ChildrenTransformation1Pointer, this.ChildrenCount1); + this.ChildrenTransformation2 = reader.ReadStructsAt(this.ChildrenTransformation2Pointer, this.ChildrenCount1); this.ChildrenBoundingBoxes = reader.ReadStructsAt(this.ChildrenBoundingBoxesPointer, this.ChildrenCount1); this.Unknown_90h_Data = reader.ReadStructsAt(this.Unknown_90h_Pointer, this.ChildrenCount1); this.Unknown_98h_Data = reader.ReadStructsAt(this.Unknown_98h_Pointer, this.ChildrenCount1); @@ -1098,11 +1098,11 @@ namespace CodeWalker.GameFiles public uint Unknown_14h { get; set; } // 0x00000000 public uint Unknown_18h { get; set; } // 0x00000000 public uint Unknown_1Ch { get; set; } // 0x00000000 - public SharpDX.Vector4 BoundingBoxMin { get; set; } - public SharpDX.Vector4 BoundingBoxMax { get; set; } - public SharpDX.Vector4 BoundingBoxCenter { get; set; } - public SharpDX.Vector4 QuantumInverse { get; set; } - public SharpDX.Vector4 Quantum { get; set; } // bounding box dimension / 2^16 + public Vector4 BoundingBoxMin { get; set; } + public Vector4 BoundingBoxMax { get; set; } + public Vector4 BoundingBoxCenter { get; set; } + public Vector4 QuantumInverse { get; set; } + public Vector4 Quantum { get; set; } // bounding box dimension / 2^16 //public ResourceSimpleList64 Trees { get; set; } public ResourceSimpleList64Ptr TreesPtr { get; set; } public BVHTreeInfo_s[] Trees { get; set; } @@ -1130,11 +1130,11 @@ namespace CodeWalker.GameFiles //this.BoundingBoxCenter = reader.ReadBlock(); //this.QuantumInverse = reader.ReadBlock(); //this.Quantum = reader.ReadBlock(); - this.BoundingBoxMin = reader.ReadStruct(); - this.BoundingBoxMax = reader.ReadStruct(); - this.BoundingBoxCenter = reader.ReadStruct(); - this.QuantumInverse = reader.ReadStruct(); - this.Quantum = reader.ReadStruct(); + this.BoundingBoxMin = reader.ReadStruct(); + this.BoundingBoxMax = reader.ReadStruct(); + this.BoundingBoxCenter = reader.ReadStruct(); + this.QuantumInverse = reader.ReadStruct(); + this.Quantum = reader.ReadStruct(); //this.Trees = reader.ReadBlock>(); this.TreesPtr = reader.ReadStruct(); diff --git a/CodeWalker.Core/GameFiles/Resources/Drawable.cs b/CodeWalker.Core/GameFiles/Resources/Drawable.cs index a03a5dd..f229e0b 100644 --- a/CodeWalker.Core/GameFiles/Resources/Drawable.cs +++ b/CodeWalker.Core/GameFiles/Resources/Drawable.cs @@ -343,7 +343,7 @@ namespace CodeWalker.GameFiles //p.Data = reader.ReadBlockAt( // p.DataPointer // offset //); - p.Data = reader.ReadStructAt( + p.Data = reader.ReadStructAt( (long)p.DataPointer // offset ); @@ -369,7 +369,7 @@ namespace CodeWalker.GameFiles // p.DataPointer, // offset // p.DataType // ); - p.Data = reader.ReadStructsAt(p.DataPointer, p.DataType); + p.Data = reader.ReadStructsAt(p.DataPointer, p.DataType); break; } @@ -499,8 +499,8 @@ namespace CodeWalker.GameFiles //public ResourceSimpleArray ParentIndices { get; set; } //public ResourceSimpleArray Unknown_40h_Data { get; set; } - public SharpDX.Matrix[] TransformationsInverted { get; set; } - public SharpDX.Matrix[] Transformations { get; set; } + public Matrix[] TransformationsInverted { get; set; } + public Matrix[] Transformations { get; set; } public ushort[] ParentIndices { get; set; } public ushort[] Unknown_40h_Data { get; set; } @@ -562,8 +562,8 @@ namespace CodeWalker.GameFiles // this.Unknown_40h_Pointer, // offset // this.Count4 //); - this.TransformationsInverted = reader.ReadStructsAt(this.TransformationsInvertedPointer, this.BonesCount); - this.Transformations = reader.ReadStructsAt(this.TransformationsPointer, this.BonesCount); + this.TransformationsInverted = reader.ReadStructsAt(this.TransformationsInvertedPointer, this.BonesCount); + this.Transformations = reader.ReadStructsAt(this.TransformationsPointer, this.BonesCount); this.ParentIndices = reader.ReadUshortsAt(this.ParentIndicesPointer, this.BonesCount); this.Unknown_40h_Data = reader.ReadUshortsAt(this.Unknown_40h_Pointer, this.Count4); @@ -1005,9 +1005,9 @@ namespace CodeWalker.GameFiles public uint Unknown_14h { get; set; } // 0x00000000 public uint Unknown_18h { get; set; } // 0x00000000 public uint Unknown_1Ch { get; set; } // 0x00000000 - public SharpDX.Vector3 Min { get; set; } + public Vector3 Min { get; set; } public uint Unknown_2Ch { get; set; } // 0x00000000 - public SharpDX.Vector3 Max { get; set; } + public Vector3 Max { get; set; } public uint Unknown_3Ch { get; set; } // 0x00000000 } @@ -2092,10 +2092,10 @@ namespace CodeWalker.GameFiles // structure data public ulong ShaderGroupPointer { get; set; } public ulong SkeletonPointer { get; set; } - public SharpDX.Vector3 BoundingCenter { get; set; } + public Vector3 BoundingCenter { get; set; } public float BoundingSphereRadius { get; set; } - public SharpDX.Vector4 BoundingBoxMin { get; set; } - public SharpDX.Vector4 BoundingBoxMax { get; set; } + public Vector4 BoundingBoxMin { get; set; } + public Vector4 BoundingBoxMax { get; set; } public ulong DrawableModelsHighPointer { get; set; } public ulong DrawableModelsMediumPointer { get; set; } public ulong DrawableModelsLowPointer { get; set; } @@ -2162,10 +2162,10 @@ namespace CodeWalker.GameFiles // read structure data this.ShaderGroupPointer = reader.ReadUInt64(); this.SkeletonPointer = reader.ReadUInt64(); - this.BoundingCenter = reader.ReadStruct(); + this.BoundingCenter = reader.ReadStruct(); this.BoundingSphereRadius = reader.ReadSingle(); - this.BoundingBoxMin = reader.ReadStruct(); - this.BoundingBoxMax = reader.ReadStruct(); + this.BoundingBoxMin = reader.ReadStruct(); + this.BoundingBoxMax = reader.ReadStruct(); this.DrawableModelsHighPointer = reader.ReadUInt64(); this.DrawableModelsMediumPointer = reader.ReadUInt64(); this.DrawableModelsLowPointer = reader.ReadUInt64(); diff --git a/CodeWalker.Core/GameFiles/Resources/Frag.cs b/CodeWalker.Core/GameFiles/Resources/Frag.cs index ed2e4f8..61d9e09 100644 --- a/CodeWalker.Core/GameFiles/Resources/Frag.cs +++ b/CodeWalker.Core/GameFiles/Resources/Frag.cs @@ -23,6 +23,7 @@ //shamelessly stolen and mangled +using SharpDX; using System; using System.Collections.Generic; using System.ComponentModel; @@ -1111,12 +1112,12 @@ namespace CodeWalker.GameFiles public ResourceSimpleList64Ptr Unknown_C0hPtr { get; set; } public ResourceSimpleList64Ptr Unknown_D0hPtr { get; set; } public ResourceSimpleList64Ptr Unknown_E0hPtr { get; set; } - public SharpDX.Vector4[] Unknown_50h { get; set; } + public Vector4[] Unknown_50h { get; set; } public ushort[] Unknown_60h { get; set; } public ushort[] Unknown_70h { get; set; } public ushort[] Unknown_80h { get; set; } public ushort[] Unknown_90h { get; set; } - public SharpDX.Vector4[] Unknown_A0h { get; set; } + public Vector4[] Unknown_A0h { get; set; } public ushort[] Unknown_B0h { get; set; } public ushort[] Unknown_C0h { get; set; } public ushort[] Unknown_D0h { get; set; } @@ -1206,12 +1207,12 @@ namespace CodeWalker.GameFiles this.Unknown_C0hPtr = reader.ReadStruct(); this.Unknown_D0hPtr = reader.ReadStruct(); this.Unknown_E0hPtr = reader.ReadStruct(); - this.Unknown_50h = reader.ReadStructsAt(Unknown_50hPtr.EntriesPointer, Unknown_50hPtr.EntriesCount); + this.Unknown_50h = reader.ReadStructsAt(Unknown_50hPtr.EntriesPointer, Unknown_50hPtr.EntriesCount); this.Unknown_60h = reader.ReadUshortsAt(Unknown_60hPtr.EntriesPointer, Unknown_60hPtr.EntriesCount); this.Unknown_70h = reader.ReadUshortsAt(Unknown_70hPtr.EntriesPointer, Unknown_70hPtr.EntriesCount); this.Unknown_80h = reader.ReadUshortsAt(Unknown_80hPtr.EntriesPointer, Unknown_80hPtr.EntriesCount); this.Unknown_90h = reader.ReadUshortsAt(Unknown_90hPtr.EntriesPointer, Unknown_90hPtr.EntriesCount); - this.Unknown_A0h = reader.ReadStructsAt(Unknown_A0hPtr.EntriesPointer, Unknown_A0hPtr.EntriesCount); + this.Unknown_A0h = reader.ReadStructsAt(Unknown_A0hPtr.EntriesPointer, Unknown_A0hPtr.EntriesCount); this.Unknown_B0h = reader.ReadUshortsAt(Unknown_B0hPtr.EntriesPointer, Unknown_B0hPtr.EntriesCount); this.Unknown_C0h = reader.ReadUshortsAt(Unknown_C0hPtr.EntriesPointer, Unknown_C0hPtr.EntriesCount); this.Unknown_D0h = reader.ReadUshortsAt(Unknown_D0hPtr.EntriesPointer, Unknown_D0hPtr.EntriesCount); @@ -1382,14 +1383,14 @@ namespace CodeWalker.GameFiles public uint Unknown_68h { get; set; } // 0x00000000 public uint Unknown_6Ch { get; set; } // 0x00000000 public ResourceSimpleList64Ptr Unknown_70hPtr { get; set; } - public SharpDX.Vector4[] Unknown_70h { get; set; } + public Vector4[] Unknown_70h { get; set; } //public uint Unknown_70h { get; set; } // 0x00000000 //public uint Unknown_74h { get; set; } // 0x00000000 //public uint Unknown_78h { get; set; } // 0x00000000 //public uint Unknown_7Ch { get; set; } // 0x00000000 //public ResourceSimpleList64 Unknown_80h { get; set; } public ResourceSimpleList64Ptr Unknown_80hPtr { get; set; } - public SharpDX.Vector4[] Unknown_80h { get; set; } + public Vector4[] Unknown_80h { get; set; } public uint Unknown_90h { get; set; } // 0x00000000 public uint Unknown_94h { get; set; } // 0x00000000 public uint Unknown_98h { get; set; } // 0x00000000 @@ -1422,8 +1423,8 @@ namespace CodeWalker.GameFiles //public ResourceSimpleList64 Unknown_110h { get; set; } public ResourceSimpleList64Ptr Unknown_100hPtr { get; set; } public ResourceSimpleList64Ptr Unknown_110hPtr { get; set; } - public SharpDX.Vector4[] Unknown_100h { get; set; } - public SharpDX.Vector4[] Unknown_110h { get; set; } + public Vector4[] Unknown_100h { get; set; } + public Vector4[] Unknown_110h { get; set; } public uint Unknown_120h { get; set; } // 0x00000000 public uint Unknown_124h { get; set; } // 0x00000000 public uint Unknown_128h { get; set; } // 0x00000000 @@ -1486,14 +1487,14 @@ namespace CodeWalker.GameFiles this.Unknown_68h = reader.ReadUInt32(); this.Unknown_6Ch = reader.ReadUInt32(); this.Unknown_70hPtr = reader.ReadStruct(); - this.Unknown_70h = reader.ReadStructsAt(Unknown_70hPtr.EntriesPointer, Unknown_70hPtr.EntriesCount); + this.Unknown_70h = reader.ReadStructsAt(Unknown_70hPtr.EntriesPointer, Unknown_70hPtr.EntriesCount); //this.Unknown_70h = reader.ReadUInt32(); //this.Unknown_74h = reader.ReadUInt32(); //this.Unknown_78h = reader.ReadUInt32(); //this.Unknown_7Ch = reader.ReadUInt32(); //this.Unknown_80h = reader.ReadBlock>(); this.Unknown_80hPtr = reader.ReadStruct(); - this.Unknown_80h = reader.ReadStructsAt(Unknown_80hPtr.EntriesPointer, Unknown_80hPtr.EntriesCount); + this.Unknown_80h = reader.ReadStructsAt(Unknown_80hPtr.EntriesPointer, Unknown_80hPtr.EntriesCount); this.Unknown_90h = reader.ReadUInt32(); this.Unknown_94h = reader.ReadUInt32(); this.Unknown_98h = reader.ReadUInt32(); @@ -1526,8 +1527,8 @@ namespace CodeWalker.GameFiles //this.Unknown_110h = reader.ReadBlock>(); this.Unknown_100hPtr = reader.ReadStruct(); this.Unknown_110hPtr = reader.ReadStruct(); - this.Unknown_100h = reader.ReadStructsAt(Unknown_100hPtr.EntriesPointer, Unknown_100hPtr.EntriesCount); - this.Unknown_110h = reader.ReadStructsAt(Unknown_110hPtr.EntriesPointer, Unknown_110hPtr.EntriesCount); + this.Unknown_100h = reader.ReadStructsAt(Unknown_100hPtr.EntriesPointer, Unknown_100hPtr.EntriesCount); + this.Unknown_110h = reader.ReadStructsAt(Unknown_110hPtr.EntriesPointer, Unknown_110hPtr.EntriesCount); this.Unknown_120h = reader.ReadUInt32(); this.Unknown_124h = reader.ReadUInt32(); this.Unknown_128h = reader.ReadUInt32(); @@ -1802,7 +1803,7 @@ namespace CodeWalker.GameFiles // structure data public uint Unknown_0A8h { get; set; } public uint Unknown_0ACh { get; set; } - public SharpDX.Matrix Unknown_0B0h { get; set; } + public Matrix Unknown_0B0h { get; set; } public ulong BoundPointer { get; set; } public ulong Unknown_0F8h_Pointer { get; set; } public ushort Count1 { get; set; } @@ -1831,7 +1832,7 @@ namespace CodeWalker.GameFiles //public ResourceSimpleArray Unknown_F8h_Data { get; set; } public ulong[] Unknown_F8h_Data { get; set; } //public ResourceSimpleArray Unknown_108h_Data { get; set; } - public SharpDX.Matrix[] Unknown_108h_Data { get; set; } + public Matrix[] Unknown_108h_Data { get; set; } public string Name { get; set; } public FragType OwnerFragment { get; set; } //for handy use @@ -1848,7 +1849,7 @@ namespace CodeWalker.GameFiles // read structure data this.Unknown_0A8h = reader.ReadUInt32(); this.Unknown_0ACh = reader.ReadUInt32(); - this.Unknown_0B0h = reader.ReadStruct(); + this.Unknown_0B0h = reader.ReadStruct(); this.BoundPointer = reader.ReadUInt64(); this.Unknown_0F8h_Pointer = reader.ReadUInt64(); this.Count1 = reader.ReadUInt16(); @@ -1886,7 +1887,7 @@ namespace CodeWalker.GameFiles // this.Unknown_108h_Pointer, // offset // this.Count2 //); - this.Unknown_108h_Data = reader.ReadStructsAt(this.Unknown_108h_Pointer, this.Count2); + this.Unknown_108h_Data = reader.ReadStructsAt(this.Unknown_108h_Pointer, this.Count2); this.Name = reader.ReadStringAt(//BlockAt( this.NamePointer // offset @@ -2285,15 +2286,15 @@ namespace CodeWalker.GameFiles public uint Unknown_1Ch { get; set; } public ulong ArticulatedBodyTypePointer { get; set; } public ulong Unknown_28h_Pointer { get; set; } - public SharpDX.Vector4 Unknown_30h { get; set; } - public SharpDX.Vector4 Unknown_40h { get; set; } - public SharpDX.Vector4 Unknown_50h { get; set; } - public SharpDX.Vector4 Unknown_60h { get; set; } - public SharpDX.Vector4 Unknown_70h { get; set; } - public SharpDX.Vector4 Unknown_80h { get; set; } - public SharpDX.Vector4 Unknown_90h { get; set; } - public SharpDX.Vector4 Unknown_A0h { get; set; } - public SharpDX.Vector4 Unknown_B0h { get; set; } + public Vector4 Unknown_30h { get; set; } + public Vector4 Unknown_40h { get; set; } + public Vector4 Unknown_50h { get; set; } + public Vector4 Unknown_60h { get; set; } + public Vector4 Unknown_70h { get; set; } + public Vector4 Unknown_80h { get; set; } + public Vector4 Unknown_90h { get; set; } + public Vector4 Unknown_A0h { get; set; } + public Vector4 Unknown_B0h { get; set; } public ulong GroupNamesPointer { get; set; } public ulong GroupsPointer { get; set; } public ulong ChildrenPointer { get; set; } @@ -2327,8 +2328,8 @@ namespace CodeWalker.GameFiles public FragPhysArchetype Archetype1 { get; set; } public FragPhysArchetype Archetype2 { get; set; } public Bounds Bound { get; set; } - public SharpDX.Vector4[] InertiaTensors { get; set; } - public SharpDX.Vector4[] Unknown_F8h_Data { get; set; } + public Vector4[] InertiaTensors { get; set; } + public Vector4[] Unknown_F8h_Data { get; set; } public FragPhysUnknown_F_002 FragTransforms { get; set; } public byte[] Unknown_108h_Data { get; set; } public byte[] Unknown_110h_Data { get; set; } @@ -2350,15 +2351,15 @@ namespace CodeWalker.GameFiles this.Unknown_1Ch = reader.ReadUInt32(); this.ArticulatedBodyTypePointer = reader.ReadUInt64(); this.Unknown_28h_Pointer = reader.ReadUInt64(); - this.Unknown_30h = reader.ReadStruct(); - this.Unknown_40h = reader.ReadStruct(); - this.Unknown_50h = reader.ReadStruct(); - this.Unknown_60h = reader.ReadStruct(); - this.Unknown_70h = reader.ReadStruct(); - this.Unknown_80h = reader.ReadStruct(); - this.Unknown_90h = reader.ReadStruct(); - this.Unknown_A0h = reader.ReadStruct(); - this.Unknown_B0h = reader.ReadStruct(); + this.Unknown_30h = reader.ReadStruct(); + this.Unknown_40h = reader.ReadStruct(); + this.Unknown_50h = reader.ReadStruct(); + this.Unknown_60h = reader.ReadStruct(); + this.Unknown_70h = reader.ReadStruct(); + this.Unknown_80h = reader.ReadStruct(); + this.Unknown_90h = reader.ReadStruct(); + this.Unknown_A0h = reader.ReadStruct(); + this.Unknown_B0h = reader.ReadStruct(); this.GroupNamesPointer = reader.ReadUInt64(); this.GroupsPointer = reader.ReadUInt64(); this.ChildrenPointer = reader.ReadUInt64(); @@ -2422,8 +2423,8 @@ namespace CodeWalker.GameFiles // this.Unknown_F8h_Pointer, // offset // this.ChildrenCount //); - this.InertiaTensors = reader.ReadStructsAt(this.InertiaTensorsPointer, this.ChildrenCount); - this.Unknown_F8h_Data = reader.ReadStructsAt(this.Unknown_F8h_Pointer, this.ChildrenCount); + this.InertiaTensors = reader.ReadStructsAt(this.InertiaTensorsPointer, this.ChildrenCount); + this.Unknown_F8h_Data = reader.ReadStructsAt(this.Unknown_F8h_Pointer, this.ChildrenCount); this.FragTransforms = reader.ReadBlockAt( @@ -2602,7 +2603,7 @@ namespace CodeWalker.GameFiles // reference data public ResourcePointerArray64 JointTypes { get; set; } - public SharpDX.Vector4[] p2data { get; set; } + public Vector4[] p2data { get; set; } /// /// Reads the data-block from a stream. @@ -2664,7 +2665,7 @@ namespace CodeWalker.GameFiles // this.p2, // offset // this.c1 //); - this.p2data = reader.ReadStructsAt(this.p2, this.c1); + this.p2data = reader.ReadStructsAt(this.p2, this.c1); } @@ -3146,7 +3147,7 @@ namespace CodeWalker.GameFiles public uint Unknown_18h { get; set; } // 0x00000000 public uint Unknown_1Ch { get; set; } // 0x00000000 //public ResourceSimpleArray Data { get; set; } - public SharpDX.Matrix[] Data { get; set; } + public Matrix[] Data { get; set; } /// /// Reads the data-block from a stream. @@ -3165,7 +3166,7 @@ namespace CodeWalker.GameFiles //this.Data = reader.ReadBlock>( // cnt // ); - this.Data = reader.ReadStructsAt((ulong)reader.Position, cnt); + this.Data = reader.ReadStructsAt((ulong)reader.Position, cnt); } @@ -3224,14 +3225,14 @@ namespace CodeWalker.GameFiles public float Unknown_54h { get; set; } // 1.0f public uint Unknown_58h { get; set; } // 0x00000000 public uint Unknown_5Ch { get; set; } // 0x00000000 - public SharpDX.Vector4 Unknown_60h { get; set; } - public SharpDX.Vector4 Unknown_70h { get; set; } - public SharpDX.Vector4 Unknown_80h { get; set; } // 0.0 0.0 0.0 NaN - public SharpDX.Vector4 Unknown_90h { get; set; } // 0.0 0.0 0.0 NaN - public SharpDX.Vector4 Unknown_A0h { get; set; } // 0.0 0.0 0.0 NaN - public SharpDX.Vector4 Unknown_B0h { get; set; } // 0.0 0.0 0.0 NaN - public SharpDX.Vector4 Unknown_C0h { get; set; } // 0.0 0.0 0.0 NaN - public SharpDX.Vector4 Unknown_D0h { get; set; } // 0.0 0.0 0.0 NaN + public Vector4 Unknown_60h { get; set; } + public Vector4 Unknown_70h { get; set; } + public Vector4 Unknown_80h { get; set; } // 0.0 0.0 0.0 NaN + public Vector4 Unknown_90h { get; set; } // 0.0 0.0 0.0 NaN + public Vector4 Unknown_A0h { get; set; } // 0.0 0.0 0.0 NaN + public Vector4 Unknown_B0h { get; set; } // 0.0 0.0 0.0 NaN + public Vector4 Unknown_C0h { get; set; } // 0.0 0.0 0.0 NaN + public Vector4 Unknown_D0h { get; set; } // 0.0 0.0 0.0 NaN // reference data public string Name { get; set; } @@ -3265,14 +3266,14 @@ namespace CodeWalker.GameFiles this.Unknown_54h = reader.ReadSingle(); this.Unknown_58h = reader.ReadUInt32(); this.Unknown_5Ch = reader.ReadUInt32(); - this.Unknown_60h = reader.ReadStruct(); - this.Unknown_70h = reader.ReadStruct(); - this.Unknown_80h = reader.ReadStruct(); - this.Unknown_90h = reader.ReadStruct(); - this.Unknown_A0h = reader.ReadStruct(); - this.Unknown_B0h = reader.ReadStruct(); - this.Unknown_C0h = reader.ReadStruct(); - this.Unknown_D0h = reader.ReadStruct(); + this.Unknown_60h = reader.ReadStruct(); + this.Unknown_70h = reader.ReadStruct(); + this.Unknown_80h = reader.ReadStruct(); + this.Unknown_90h = reader.ReadStruct(); + this.Unknown_A0h = reader.ReadStruct(); + this.Unknown_B0h = reader.ReadStruct(); + this.Unknown_C0h = reader.ReadStruct(); + this.Unknown_D0h = reader.ReadStruct(); // read reference data this.Name = reader.ReadStringAt(//BlockAt( diff --git a/CodeWalker.Core/GameFiles/Resources/ResourceBaseTypes.cs b/CodeWalker.Core/GameFiles/Resources/ResourceBaseTypes.cs index 669c6fc..9e9cff5 100644 --- a/CodeWalker.Core/GameFiles/Resources/ResourceBaseTypes.cs +++ b/CodeWalker.Core/GameFiles/Resources/ResourceBaseTypes.cs @@ -23,6 +23,7 @@ //shamelessly stolen and mangled +using SharpDX; using System; using System.Collections.Generic; using System.ComponentModel; @@ -121,9 +122,9 @@ namespace CodeWalker.GameFiles [TypeConverter(typeof(ExpandableObjectConverter))] public struct Matrix3_s { - public SharpDX.Vector4 Row1 { get; set; } - public SharpDX.Vector4 Row2 { get; set; } - public SharpDX.Vector4 Row3 { get; set; } + public Vector4 Row1 { get; set; } + public Vector4 Row2 { get; set; } + public Vector4 Row3 { get; set; } // structure data //public float Unknown_01 { get; set; } @@ -142,8 +143,8 @@ namespace CodeWalker.GameFiles [TypeConverter(typeof(ExpandableObjectConverter))] public struct AABB_s { - public SharpDX.Vector4 Min { get; set; } - public SharpDX.Vector4 Max { get; set; } + public Vector4 Min { get; set; } + public Vector4 Max { get; set; } } diff --git a/Forms/ModelForm.cs b/Forms/ModelForm.cs index 38ad89b..96230f1 100644 --- a/Forms/ModelForm.cs +++ b/Forms/ModelForm.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; -using System.Drawing; using System.IO; using System.Linq; using System.Text; @@ -392,10 +391,10 @@ namespace CodeWalker.Forms gridVerts.Clear(); float s = gridSize * gridCount * 0.5f; - uint cblack = (uint)SharpDX.Color.Black.ToRgba(); - uint cgray = (uint)SharpDX.Color.DimGray.ToRgba(); - uint cred = (uint)SharpDX.Color.DarkRed.ToRgba(); - uint cgrn = (uint)SharpDX.Color.DarkGreen.ToRgba(); + uint cblack = (uint)Color.Black.ToRgba(); + uint cgray = (uint)Color.DimGray.ToRgba(); + uint cred = (uint)Color.DarkRed.ToRgba(); + uint cgrn = (uint)Color.DarkGreen.ToRgba(); int interval = 10; for (int i = 0; i <= gridCount; i++)