FlatRedBall.Graphics.Texture.ImageData.RemoveRow C# (CSharp) Метод

RemoveRow() публичный Метод

Removes the index row from the contained data. Row 0 is the top of the texture.
public RemoveRow ( int rowToRemove ) : void
rowToRemove int The index of the row to remove. Index 0 is the top row.
Результат void
        public void RemoveRow(int rowToRemove)
        {
            Color[] newData = new Color[width * height];

            int destinationY = 0;
            int destinationX = 0;

            for (int y = 0; y < height; y++)
            {
                if (y == rowToRemove)
                {
                    continue;
                }

                destinationX = 0;
                for (int x = 0; x < width; x++)
                {
                    newData[destinationY * width + destinationX] = mData[y * width + x];

                    destinationX++;
                }

                destinationY++;
            }
            height--;

            mData = newData;
        }