Beispiel #1
0
 public BlendMode(BlendOperations operation, BlendFactors source, BlendFactors destination)
 {
     ColorOperation   = AlphaOperation = operation;
     ColorSource      = AlphaSource = source;
     ColorDestination = AlphaDestination = destination;
     Mask             = BlendMask.RGBA;
     Color            = Color.White;
 }
Beispiel #2
0
 public BlendMode(
     BlendOperations colorOperation, BlendFactors colorSource, BlendFactors colorDestination,
     BlendOperations alphaOperation, BlendFactors alphaSource, BlendFactors alphaDestination,
     BlendMask mask, Color color)
 {
     ColorOperation   = colorOperation;
     ColorSource      = colorSource;
     ColorDestination = colorDestination;
     AlphaOperation   = alphaOperation;
     AlphaSource      = alphaSource;
     AlphaDestination = alphaDestination;
     Mask             = mask;
     Color            = color;
 }
        /// <summary>
        /// Function to read the brush elements in from a chunked file.
        /// </summary>
        /// <param name="chunk">Chunk reader used to read the data.</param>
        internal override void Read(GorgonChunkReader chunk)
        {
            Points.Clear();
            BlendPositions.Clear();
            BlendFactors.Clear();
            Interpolation.Clear();
            SurroundColors.Clear();

            WrapMode = chunk.Read <WrapMode>();
            int counter = chunk.ReadInt32();

            for (int i = 0; i < counter; i++)
            {
                Points.Add(chunk.Read <Vector2>());
            }

            counter = chunk.ReadInt32();

            for (int i = 0; i < counter; i++)
            {
                BlendFactors.Add(chunk.ReadFloat());
            }

            counter = chunk.ReadInt32();

            for (int i = 0; i < counter; i++)
            {
                BlendPositions.Add(chunk.ReadFloat());
            }

            CenterColor = chunk.Read <GorgonColor>();
            CenterPoint = chunk.Read <Vector2>();
            FocusScales = chunk.Read <Vector2>();

            counter = chunk.ReadInt32();

            for (int i = 0; i < counter; i++)
            {
                Interpolation.Add(new GorgonGlyphBrushInterpolator(chunk));
            }

            counter = chunk.ReadInt32();

            for (int i = 0; i < counter; i++)
            {
                SurroundColors.Add(chunk.Read <GorgonColor>());
            }
        }
        /// <summary>Function to read back the specifics of the font brush data from a file reader.</summary>
        /// <param name="reader">The reader used to read the brush data.</param>
        internal override void ReadBrushData(GorgonBinaryReader reader)
        {
            WrapMode = (GlyphBrushWrapMode)reader.ReadInt32();
            int count = reader.ReadInt32();

            Points.Clear();
            for (int i = 0; i < count; ++i)
            {
                Points.Add(reader.ReadValue <DX.Vector2>());
            }

            BlendFactors.Clear();
            count = reader.ReadInt32();
            for (int i = 0; i < count; ++i)
            {
                BlendFactors.Add(reader.ReadSingle());
            }

            BlendPositions.Clear();
            count = reader.ReadInt32();
            for (int i = 0; i < count; ++i)
            {
                BlendPositions.Add(reader.ReadSingle());
            }

            CenterColor = new GorgonColor(reader.ReadInt32());
            CenterPoint = reader.ReadValue <DX.Vector2>();
            FocusScales = reader.ReadValue <DX.Vector2>();

            count = reader.ReadInt32();
            Interpolation.Clear();

            for (int i = 0; i < count; ++i)
            {
                Interpolation.Add(new GorgonGlyphBrushInterpolator(reader.ReadSingle(), new GorgonColor(reader.ReadInt32())));
            }

            count = reader.ReadInt32();
            SurroundColors.Clear();

            for (int i = 0; i < count; ++i)
            {
                SurroundColors.Add(new GorgonColor(reader.ReadInt32()));
            }
        }
Beispiel #5
0
 public BlendMode(BlendOperations operation, BlendFactors source, BlendFactors destination)
 {
     Operation   = operation;
     Source      = source;
     Destination = destination;
 }