Example #1
0
        internal static W3dSphereOpacity Parse(BinaryReader reader)
        {
            var result = new W3dSphereOpacity
            {
                ChunkType = reader.ReadByte(),
                ChunkSize = reader.ReadByte(),
                Opacity   = reader.ReadSingle(),
                Position  = reader.ReadSingle()
            };

            return(result);
        }
Example #2
0
        internal static W3dSphereOpacityInfo Parse(BinaryReader reader)
        {
            var result = new W3dSphereOpacityInfo
            {
                ChunkType   = reader.ReadUInt32(),
                ChunkSize   = reader.ReadUInt32() & 0x7FFFFFFF,
                Version     = reader.ReadUInt32(),                  // ? Version or something else?
                OpacityInfo = new List <W3dSphereOpacity>()
            };

            var arraySize = reader.ReadUInt32();

            var arrayCount = arraySize / 10; // 10 = Size of OpacityInfo Array Chunk + Header Info

            for (var i = 0; i < arrayCount; i++)
            {
                var opacity = W3dSphereOpacity.Parse(reader);
                result.OpacityInfo.Add(opacity);
            }

            return(result);
        }