示例#1
0
        internal static W3dSphereHeader Parse(BinaryReader reader)
        {
            var result = new W3dSphereHeader
            {
                ChunkType = reader.ReadUInt32(),
                ChunkSize = reader.ReadUInt32() & 0x7FFFFFFF,
                Version   = reader.ReadUInt32(),
                Flags     = reader.ReadUInt32()
            };

            result.AlignedCamera               = ((result.Flags & 1) == 1);
            result.Looping                     = ((result.Flags & 2) == 2);
            result.Name                        = reader.ReadFixedLengthString(W3dConstants.NameLength * 2);
            result.Center                      = reader.ReadVector3();
            result.Size                        = reader.ReadVector3();
            result.Duration                    = reader.ReadSingle();
            result.InitialColor                = reader.ReadColorRgbF();
            result.InitialOpacity              = reader.ReadSingle();
            result.InitialScale                = reader.ReadVector3();
            result.InitialAlphaVector          = reader.ReadVector3();
            result.InitialAlphaVectorMagnitude = reader.ReadVector2();
            result.TextureFileName             = reader.ReadFixedLengthString(W3dConstants.NameLength * 2);

            return(result);
        }
示例#2
0
        internal static W3dSphere Parse(BinaryReader reader, W3dParseContext context)
        {
            return(ParseChunk(reader, context, header =>
            {
                var result = new W3dSphere
                {
                    Header = W3dSphereHeader.Parse(reader)
                };

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

                result.Placeholder = W3dSpherePlaceholder.Parse(reader);
                result.Colors = W3dSphereColors.Parse(reader);
                result.OpacityInfo = W3dSphereOpacityInfo.Parse(reader);
                result.ScaleKeyFrames = W3dSphereScaleKeyFrames.Parse(reader);
                result.AlphaVectors = W3dSphereAlphaVectors.Parse(reader);

                return result;
            }));
        }