diff options
author | quou <quou@disroot.org> | 2024-10-01 20:37:59 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-10-01 20:37:59 +1000 |
commit | 25223a71460075b9b4f1cf8df82d89dafde24423 (patch) | |
tree | a1a303761af875e8dd127362fa7d2b8d7b011921 | |
parent | 0d9943b35af06ca3f33e658294b6be623edd8242 (diff) |
ren_rect
-rw-r--r-- | render.c | 18 | ||||
-rw-r--r-- | render.h | 4 |
2 files changed, 22 insertions, 0 deletions
@@ -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; + } +} + @@ -27,5 +27,9 @@ void ren_map( const struct Rect* re, const Bitmap* bm ); +void ren_rect( + Renderer* r, + const struct Rect* re +); #endif |