Esempio n. 1
0
        internal static W3dRingOpacityInfo Parse(BinaryReader reader)
        {
            var result = new W3dRingOpacityInfo
            {
                ChunkType     = reader.ReadUInt32(),
                ChunkSize     = reader.ReadUInt32() & 0x7FFFFFFF,
                Version       = reader.ReadUInt32(),
                OpacityChunks = new List <W3dRingOpacityChunk>()
            };

            var arraySize = reader.ReadUInt32();

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

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

            return(result);
        }
Esempio n. 2
0
        internal static W3dRing Parse(BinaryReader reader, W3dParseContext context)
        {
            return(ParseChunk(reader, context, header =>
            {
                var result = new W3dRing
                {
                    Header = W3dRingHeader.Parse(reader)
                };

                result.Shader = (W3dRingShaderFunc)(reader.ReadUInt32() >> 24);
                result.UnknownFlag = (reader.ReadUInt32() >> 24);  // TODO: Determine What this flag is/does.

                result.Placeholder = W3dRingPlaceholder.Parse(reader);
                result.TextureTiling = reader.ReadUInt32();
                result.ColorInfo = W3dRingColorInfo.Parse(reader);
                result.OpacityInfo = W3dRingOpacityInfo.Parse(reader);
                result.InnerScaleKeyFrames = W3dRingScaleKeyFrames.Parse(reader);
                result.OuterScaleKeyFrames = W3dRingScaleKeyFrames.Parse(reader);

                return result;
            }));
        }