FlatRedBall.Graphics.Texture.ImageData.FlipHorizontal C# (CSharp) Method

FlipHorizontal() public method

public FlipHorizontal ( ) : void
return void
        public void FlipHorizontal()
        {
            int halfWidth = width / 2;
            int widthMinusOne = width - 1;

            // This currently assumes Color.  Update to use DXT.
            for (int x = 0; x < halfWidth; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    Color temp = mData[x + y * Width];

                    mData[x + y * width] = mData[(widthMinusOne - x) + y * width];
                    mData[widthMinusOne - x + y * width] = temp;

                }
            }


        }