DungeonMasterEngine.Graphics.CubeGraphic.GetFlippedTexture C# (CSharp) Method

GetFlippedTexture() private method

private GetFlippedTexture ( Microsoft.Xna.Framework.Graphics.Texture2D normalTexture ) : Microsoft.Xna.Framework.Graphics.Texture2D
normalTexture Microsoft.Xna.Framework.Graphics.Texture2D
return Microsoft.Xna.Framework.Graphics.Texture2D
        private Texture2D GetFlippedTexture(Texture2D normalTexture)
        {
            var data = new Color[normalTexture.Height * normalTexture.Width];
            normalTexture.GetData(data);
            for (int m = 0; m < normalTexture.Height; m++)
            {
                int offset = m * texture.Width;
                for (int i = 0; i < normalTexture.Width / 2; i++)
                {
                    int k = normalTexture.Width - i - 1;
                    var temp = data[offset + i];
                    data[offset + i] = data[offset + k];
                    data[offset + k] = temp;
                }
            }
            var res = new Texture2D(ResourceProvider.Instance.Device, normalTexture.Width, normalTexture.Height);
            res.SetData(data);
            return res;
        }