+ CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTUP, ENUM_RECT_LIMIT);
+ EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
+ ClipRect = RectEnum.arcl;
+ delta = max(deltax, deltay);
+ i = 0;
+ error = delta/2;
+ while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore))
+ {
+ while ((ClipRect < RectEnum.arcl + RectEnum.c
+ && (y < ClipRect->top
+ || (y < ClipRect->bottom && ClipRect->right <= x)))
+ || EnumMore)
+ {
+ if (RectEnum.arcl + RectEnum.c <= ClipRect)
+ {
+ EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
+ ClipRect = RectEnum.arcl;
+ }
+ else
+ {
+ ClipRect++;
+ }
+ }
+ if (ClipRect < RectEnum.arcl + RectEnum.c)
+ {
+ if (ClipRect->left <= x && y < ClipRect->bottom)
+ {
+ vgaPutPixel(x, y, Pixel);
+ }
+ if (deltax < deltay)
+ {
+ y--;
+ error = error + deltax;
+ if (deltay <= error)
+ {
+ x++;
+ error = error - deltay;
+ }
+ }
+ else
+ {
+ x++;
+ error = error + deltay;
+ if (deltax <= error)
+ {
+ y--;
+ error = error - deltax;
+ }
+ }
+ i++;
+ }
+ }
+}
+
+static void FASTCALL
+vgaNEtoSW(PCLIPOBJ Clip, PBRUSHOBJ Brush, LONG x, LONG y, LONG deltax, LONG deltay)
+{
+ int i;
+ int error;
+ BOOLEAN EnumMore;
+ PRECTL ClipRect;
+ RECT_ENUM RectEnum;
+ ULONG Pixel = Brush->iSolidColor;
+ LONG delta;
+
+ CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_LEFTDOWN, ENUM_RECT_LIMIT);
+ EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
+ ClipRect = RectEnum.arcl;
+ delta = max(deltax, deltay);
+ i = 0;
+ error = delta/2;
+ while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore))
+ {
+ while ((ClipRect < RectEnum.arcl + RectEnum.c
+ && (ClipRect->bottom <= y
+ || (ClipRect->top <= y && x < ClipRect->left)))
+ || EnumMore)
+ {
+ if (RectEnum.arcl + RectEnum.c <= ClipRect)
+ {
+ EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
+ ClipRect = RectEnum.arcl;
+ }
+ else
+ {
+ ClipRect++;
+ }
+ }
+ if (ClipRect < RectEnum.arcl + RectEnum.c)
+ {
+ if (x < ClipRect->right && ClipRect->top <= y)
+ {
+ vgaPutPixel(x, y, Pixel);
+ }
+ if (deltax < deltay)
+ {
+ y++;
+ error = error + deltax;
+ if (deltay <= error)
+ {
+ x--;
+ error = error - deltay;
+ }
+ }
+ else
+ {
+ x--;
+ error = error + deltay;
+ if (deltax <= error)
+ {
+ y++;
+ error = error - deltax;
+ }
+ }
+ i++;
+ }
+ }
+}
+
+static void FASTCALL
+vgaSEtoNW(PCLIPOBJ Clip, PBRUSHOBJ Brush, LONG x, LONG y, LONG deltax, LONG deltay)
+{
+ int i;
+ int error;
+ BOOLEAN EnumMore;
+ PRECTL ClipRect;
+ RECT_ENUM RectEnum;
+ ULONG Pixel = Brush->iSolidColor;
+ LONG delta;
+
+ CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_LEFTUP, ENUM_RECT_LIMIT);
+ EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
+ ClipRect = RectEnum.arcl;
+ delta = max(deltax, deltay);
+ i = 0;
+ error = delta/2;
+ while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore))
+ {
+ while ((ClipRect < RectEnum.arcl + RectEnum.c
+ && (y < ClipRect->top
+ || (y < ClipRect->bottom && x < ClipRect->left)))
+ || EnumMore)
+ {
+ if (RectEnum.arcl + RectEnum.c <= ClipRect)
+ {
+ EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
+ ClipRect = RectEnum.arcl;
+ }
+ else
+ {
+ ClipRect++;
+ }
+ }
+ if (ClipRect < RectEnum.arcl + RectEnum.c)
+ {
+ if (x < ClipRect->right && y < ClipRect->bottom)
+ {
+ vgaPutPixel(x, y, Pixel);
+ }
+ if (deltax < deltay)
+ {
+ y--;
+ error = error + deltax;
+ if (deltay <= error)
+ {
+ x--;
+ error = error - deltay;
+ }
+ }
+ else
+ {
+ x--;
+ error = error + deltay;
+ if (deltax <= error)
+ {
+ y--;
+ error = error - deltax;
+ }
+ }
+ i++;
+ }
+ }
+}
+
+/*
+ * FIXME: Use Mix to perform ROPs
+ * FIXME: Non-solid Brush
+ */