public static unsafe void renderSolid(pr2.IRenderImage img, int x0, int y0, int w, int h, int color, Render.PixelOp op) { int bw = img.Width; int bh = img.Height; int bp = img.Pitch; for (int y = 0; y < h; y++) { if (y + y0 >= 0 && y + y0 < bh) { for (int x = 0; x < w; x++) { if (x + x0 >= 0 && x + x0 < bw) { handlePixel(color, ref img.Buffer[(y0 + y) * bp + x0 + x], (int)op, true, true); } } } } }
public static void renderBox(pr2.IRenderImage img, int x0, int y0, int w, int h, int color, Render.PixelOp op) { renderSolid(img, x0, y0, w, 1, color, op); renderSolid(img, x0, y0 + h - 1, w, 1, color, op); renderSolid(img, x0, y0, 1, h, color, op); renderSolid(img, x0 + w - 1, y0, 1, h, color, op); }