Exemple #1
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;
            }));
        }
Exemple #2
0
        internal static W3dRingColorInfo Parse(BinaryReader reader)
        {
            var result = new W3dRingColorInfo
            {
                ChunkType   = reader.ReadUInt32(),
                ChunkSize   = reader.ReadUInt32() & 0x7FFFFFFF,
                Version     = reader.ReadUInt32(),                  // ? Version or something else
                ColorChunks = new List <W3dRingColorChunk>()
            };

            var arraySize = reader.ReadUInt32();

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

            for (var i = 0; i < arrayCount; i++)
            {
                var color = W3dRingColorChunk.Parse(reader);
                result.ColorChunks.Add(color);
            }

            return(result);
        }