예제 #1
0
        public void DrawImageAddFlipRotate90(GameImage image, int width, int height, int row, int col, int x, int y, int flipRotate, int r, int g, int b)
        {
            if (x + width < 0)
            {
                return;
            }
            if (x - width > Settings.SCREEN_WIDTH)
            {
                return;
            }
            if (y + height < 0)
            {
                return;
            }
            if (y - height > Settings.SCREEN_HEIGHT)
            {
                return;
            }

            if (currentDrawMode != DrawMode.Add)
            {
                screen.BlendAddColorAlpha();
                currentDrawMode = DrawMode.Add;
            }
            screen.SetColor(r, g, b);
            if (flipRotate % 2 == 0)
            {
                screen.BltRotate(textures[(int)image], x, y, new Rect(width * col, height * row, width * (col + 1), height * (row + 1)), flipRotate / 2 * 128, 1.0f, width / 2, height / 2);
            }
            else
            {
                switch (flipRotate / 2)
                {
                case 0:
                    screen.BltRotate(textures[(int)image], x + width, y, new Rect(width * (col + 1), height * row, width * col, height * (row + 1)), flipRotate / 2 * 128, 1.0f, -width / 2, -height / 2);
                    break;

                case 1:
                    screen.BltRotate(textures[(int)image], x + 2 * width, y + height, new Rect(width * (col + 1), height * row, width * col, height * (row + 1)), flipRotate / 2 * 128, 1.0f, -width / 2, -height / 2);
                    break;

                case 2:
                    screen.BltRotate(textures[(int)image], x + width, y + 2 * height, new Rect(width * (col + 1), height * row, width * col, height * (row + 1)), flipRotate / 2 * 128, 1.0f, -width / 2, -height / 2);
                    break;

                case 3:
                    screen.BltRotate(textures[(int)image], x, y + height, new Rect(width * (col + 1), height * row, width * col, height * (row + 1)), flipRotate / 2 * 128, 1.0f, -width / 2, -height / 2);
                    break;
                }
            }
        }