private static ColorBgra GetBilinearSampleMirrored(Surface tile, float x, float y)
        {
            int width = tile.Width;
            int num = (int)Math.Floor(x / width);
            x -= num * width;
            int height = tile.Height;
            int num2 = (int)Math.Floor(y / height);
            y -= num2 * height;

            if (num2 % 2 != 0)
            {
                y = height - (y + 1);
            }
            if (num % 2 != 0)
            {
                x = width - (x + 1);
            }

            return tile.GetBilinearSampleClamped(x, y);
        }