Exemplo n.º 1
0
        private static void setPixel(int opcode, int x, int y, int color)
        {
            int bpp = Options.Bpp;

            if ((((x >= Options.BoundsLeft) && (x <= Options.BoundsRight)) && (y >= Options.BoundsTop)) && (y <= Options.BoundsBottom))
            {
                RasterOp.do_pixel(opcode, Options.Canvas, x, y, color);
            }
        }
Exemplo n.º 2
0
        internal static void drawLineVerticalHorizontal(int x1, int y1, int x2, int y2, int color, int opcode)
        {
            int num;
            int num2;

            if (y1 == y2)
            {
                if ((y1 >= Options.BoundsTop) && (y1 <= Options.BoundsBottom))
                {
                    if (x2 > x1)
                    {
                        if (x1 < Options.BoundsLeft)
                        {
                            x1 = Options.BoundsLeft;
                        }
                        if (x2 > Options.BoundsRight)
                        {
                            x2 = Options.BoundsRight;
                        }
                        num = (y1 * Options.Canvas.Width) + x1;
                        ChangedRect.Invalidate(x1, y1, x2 - x1, 1);
                        for (num2 = 0; num2 < (x2 - x1); num2++)
                        {
                            RasterOp.do_pixel(opcode, Options.Canvas, x1 + num2, y1, color);
                            num++;
                        }
                    }
                    else
                    {
                        if (x2 < Options.BoundsLeft)
                        {
                            x2 = Options.BoundsLeft;
                        }
                        if (x1 > Options.BoundsRight)
                        {
                            x1 = Options.BoundsRight;
                        }
                        num = (y1 * Options.Canvas.Width) + x1;
                        ChangedRect.Invalidate(x2, y1, x1 - x2, 1);
                        for (num2 = 0; num2 < (x1 - x2); num2++)
                        {
                            RasterOp.do_pixel(opcode, Options.Canvas, x2 + num2, y1, color);
                            num--;
                        }
                    }
                }
            }
            else if ((x1 >= Options.BoundsLeft) && (x1 <= Options.BoundsRight))
            {
                if (y2 > y1)
                {
                    if (y1 < Options.BoundsTop)
                    {
                        y1 = Options.BoundsTop;
                    }
                    if (y2 > Options.BoundsBottom)
                    {
                        y2 = Options.BoundsBottom;
                    }
                    num = (y1 * Options.Canvas.Width) + x1;
                    ChangedRect.Invalidate(x1, y1, 1, y2 - y1);
                    for (num2 = 0; num2 < (y2 - y1); num2++)
                    {
                        RasterOp.do_pixel(opcode, Options.Canvas, x1, y1 + num2, color);
                        num += Options.Canvas.Width;
                    }
                }
                else
                {
                    if (y2 < Options.BoundsTop)
                    {
                        y2 = Options.BoundsTop;
                    }
                    if (y1 > Options.BoundsBottom)
                    {
                        y1 = Options.BoundsBottom;
                    }
                    num = (y1 * Options.Canvas.Width) + x1;
                    ChangedRect.Invalidate(x1, y2, 1, y1 - y2);
                    for (num2 = 0; num2 < (y1 - y2); num2++)
                    {
                        RasterOp.do_pixel(opcode, Options.Canvas, x1, y2 + num2, color);
                        num -= Options.Canvas.Width;
                    }
                }
            }
        }