aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--render.c18
-rw-r--r--render.h4
2 files changed, 22 insertions, 0 deletions
diff --git a/render.c b/render.c
index 9a504a0..07af8cf 100644
--- a/render.c
+++ b/render.c
@@ -114,3 +114,21 @@ void ren_map(
}
}
+void ren_rect(
+ Renderer* r,
+ const struct Rect* re
+) {
+ Rect rect = *re;
+ int i, j;
+ int ex, ey;
+ rect_clipr(&rect, r->clip);
+ ex = rect.x + rect.w;
+ ey = rect.y + rect.h;
+ for (j = rect.y; j < ey; j++)
+ for (i = rect.x; i < ex; i++) {
+ int idx = i + j * r->w;
+ int bit = 1 << (idx & 0x1f);
+ r->t[idx >> 5] ^= bit;
+ }
+}
+
diff --git a/render.h b/render.h
index 98a8cc7..e41572e 100644
--- a/render.h
+++ b/render.h
@@ -27,5 +27,9 @@ void ren_map(
const struct Rect* re,
const Bitmap* bm
);
+void ren_rect(
+ Renderer* r,
+ const struct Rect* re
+);
#endif