From 392c5c48db33ccf55460da62742924333cbb7c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 3 Jan 2018 14:58:32 +0100 Subject: [PATCH] feat(structs): Add constructors Add construtors for Array_byte and Array_float --- GameFiles/MetaTypes/Meta.cs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/GameFiles/MetaTypes/Meta.cs b/GameFiles/MetaTypes/Meta.cs index 79250b5..7ee83cc 100644 --- a/GameFiles/MetaTypes/Meta.cs +++ b/GameFiles/MetaTypes/Meta.cs @@ -730,7 +730,6 @@ namespace CodeWalker.GameFiles Unk1 = 0; } - public void SwapEnd() { Pointer = MetaTypes.SwapBytes(Pointer); @@ -756,6 +755,23 @@ namespace CodeWalker.GameFiles public uint PointerDataIndex { get { return (Pointer & 0xFFF) - 1; } } public uint PointerDataOffset { get { return ((Pointer >> 12) & 0xFFFFF); } } + public Array_byte(uint ptr, int cnt) + { + Pointer = ptr; + Unk0 = 0; + Count1 = (ushort)cnt; + Count2 = Count1; + Unk1 = 0; + } + public Array_byte(MetaBuilderPointer ptr) + { + Pointer = ptr.Pointer; + Unk0 = 0; + Count1 = (ushort)ptr.Length; + Count2 = Count1; + Unk1 = 0; + } + public void SwapEnd() { Pointer = MetaTypes.SwapBytes(Pointer); @@ -781,6 +797,23 @@ namespace CodeWalker.GameFiles public uint PointerDataIndex { get { return (Pointer & 0xFFF) - 1; } } public uint PointerDataOffset { get { return ((Pointer >> 12) & 0xFFFFF); } } + public Array_float(uint ptr, int cnt) + { + Pointer = ptr; + Unk0 = 0; + Count1 = (ushort)cnt; + Count2 = Count1; + Unk1 = 0; + } + public Array_float(MetaBuilderPointer ptr) + { + Pointer = ptr.Pointer; + Unk0 = 0; + Count1 = (ushort)ptr.Length; + Count2 = Count1; + Unk1 = 0; + } + public void SwapEnd() { Pointer = MetaTypes.SwapBytes(Pointer);