Ejemplo n.º 1
0
    internal static dfList <T> Obtain(int capacity)
    {
        dfList <T> ts = dfList <T> .Obtain();

        ts.EnsureCapacity(capacity);
        return(ts);
    }
Ejemplo n.º 2
0
    internal static dfList <T> Obtain(int capacity)
    {
        dfList <T> list = dfList <T> .Obtain();

        list.EnsureCapacity(capacity);
        return(list);
    }
Ejemplo n.º 3
0
    private void addQuadColors(dfList <Color32> colors)
    {
        colors.EnsureCapacity(colors.Count + 4);
        Color32 item = base.ApplyOpacity(!base.IsEnabled ? base.disabledColor : base.color);

        for (int i = 0; i < 4; i++)
        {
            colors.Add(item);
        }
    }
Ejemplo n.º 4
0
    private void addQuadColors(dfList <Color32> colors)
    {
        colors.EnsureCapacity(colors.Count + 4);
        Color32 color32 = base.ApplyOpacity((!base.IsEnabled ? this.disabledColor : this.color));

        for (int i = 0; i < 4; i++)
        {
            colors.Add(color32);
        }
    }
    private void addQuadColors(dfList <Color32> colors)
    {
        colors.EnsureCapacity(colors.Count + 4);
        var color = ApplyOpacity(IsEnabled ? this.color : this.disabledColor);

        for (int i = 0; i < 4; i++)
        {
            colors.Add(color);
        }
    }
Ejemplo n.º 6
0
    private static void rebuildTriangles(dfRenderData renderData, RenderOptions options)
    {
        int          baseIndex = options.baseIndex;
        dfList <int> triangles = renderData.Triangles;

        triangles.EnsureCapacity(triangles.Count + TRIANGLE_INDICES.Length);
        for (int i = 0; i < TRIANGLE_INDICES.Length; i++)
        {
            triangles.Add(baseIndex + TRIANGLE_INDICES[i]);
        }
    }
Ejemplo n.º 7
0
    /// <summary>
    /// Ensures that the lists have enough memory allocated to store
    /// the number of elements indicated by <paramref name="capacity"/>,
    /// to reduce memory thrashing
    /// </summary>
    /// <param name="capacity"></param>
    public void EnsureCapacity(int capacity)
    {
        Vertices.EnsureCapacity(capacity);
        Triangles.EnsureCapacity(Mathf.CeilToInt(capacity * 1.5f));
        UV.EnsureCapacity(capacity);
        Colors.EnsureCapacity(capacity);

        if (Normals != null)
        {
            Normals.EnsureCapacity(capacity);
        }
        if (Tangents != null)
        {
            Tangents.EnsureCapacity(capacity);
        }
    }
Ejemplo n.º 8
0
 private void addQuadColors( dfList<Color32> colors )
 {
     colors.EnsureCapacity( colors.Count + 4 );
     var color = ApplyOpacity( IsEnabled ? this.color : this.disabledColor );
     for( int i = 0; i < 4; i++ )
     {
         colors.Add( color );
     }
 }
Ejemplo n.º 9
0
 private void addQuadColors(dfList<Color32> colors)
 {
     colors.EnsureCapacity(colors.Count + 4);
     Color32 color32 = base.ApplyOpacity((!base.IsEnabled ? this.disabledColor : this.color));
     for (int i = 0; i < 4; i++)
     {
         colors.Add(color32);
     }
 }