Beispiel #1
0
        private static Vector3[] _ReadVector3Array(byte[] fileBytes, ref int offset, int count) // because Marshal.PtrToStructure IS SO F*****G SLOW
        {
            Vector3[] arr = new Vector3[count];

            for (int i = 0; i < count; i++)
            {
                arr[i] = new Vector3
                {
                    X = StreamTools.ReadFloat(fileBytes, ref offset),
                    Y = StreamTools.ReadFloat(fileBytes, ref offset),
                    Z = StreamTools.ReadFloat(fileBytes, ref offset),
                };
            }

            return(arr);
        }
Beispiel #2
0
        private static UnknownStruct1[] _ReadUnknownStruct1Array(byte[] fileBytes, ref int offset, int count) // because Marshal.PtrToStructure IS SO F*****G SLOW
        {
            UnknownStruct1[] arr = new UnknownStruct1[count];

            for (int i = 0; i < count; i++)
            {
                arr[i] = new UnknownStruct1
                {
                    UnknownFloat1 = StreamTools.ReadFloat(fileBytes, ref offset),
                    UnknownFloat2 = StreamTools.ReadFloat(fileBytes, ref offset),
                    UnknownFloat3 = StreamTools.ReadFloat(fileBytes, ref offset),
                    Index         = StreamTools.ReadInt32(fileBytes, ref offset)
                };
            }

            return(arr);
        }