public void DeserializeExtraData(BinaryReader reader)
 {
     if (IsStreaming)
     {
         StreamInfo = StreamHandle.FromData(reader);
     }
 }
        public static StreamHandle FromData(BinaryReader reader)
        {
            var  x            = new StreamHandle();
            uint stringLength = reader.ReadUInt32();

            if (stringLength > 0)
            {
                x.ResourcePath = Encoding.UTF8.GetString(reader.ReadBytesStrict(stringLength));
            }

            x.Unknown1 = reader.ReadUInt64();
            x.Unknown2 = reader.ReadUInt64();

            return(x);
        }
Beispiel #3
0
        public static StreamHandle FromData(BinaryReader reader)
        {
            var  handle       = new StreamHandle();
            uint stringLength = reader.ReadUInt32();

            if (stringLength > 0)
            {
                handle.ResourcePath = Encoding.UTF8.GetString(reader.ReadBytesStrict(stringLength));
            }

            handle.ResourceOffset = reader.ReadUInt64();
            handle.ResourceLength = reader.ReadUInt64();

            return(handle);
        }
        public void DeserializeExtraData(BinaryReader reader)
        {
            uint dataLength = reader.ReadUInt32();

            if (dataLength > 0)
            {
                MusicData = reader.ReadBytesStrict(dataLength);
            }

            StreamInfo = new StreamHandle[StreamingBankNames.Count];

            for (uint i = 0; i < StreamInfo.Length; i++)
            {
                StreamInfo[i] = StreamHandle.FromData(reader);
            }
        }
Beispiel #5
0
 public static HwBuffer FromData(BinaryReader reader, EDataBufferFormat format, bool streaming, uint byteStride, uint elementCount)
 {
     if (streaming)
     {
         return new HwBuffer {
                    StreamInfo = StreamHandle.FromData(reader)
         }
     }
     ;
     else
     {
         return new HwBuffer {
                    Data = reader.ReadBytesStrict(elementCount * byteStride)
         }
     };
 }
Beispiel #6
0
        public static HwBuffer FromData(BinaryReader reader, EDataBufferFormat format, bool streaming, uint byteStride, uint elementCount)
        {
            var buffer = new HwBuffer
            {
                Format        = format,
                ElementStride = byteStride,
                ElementCount  = elementCount,
            };

            if (streaming)
            {
                buffer.StreamInfo = StreamHandle.FromData(reader);
            }
            else
            {
                buffer.Data = reader.ReadBytesStrict(elementCount * byteStride);
            }

            return(buffer);
        }