diff options
author | quou <quou@disroot.org> | 2024-10-01 19:02:58 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-10-01 19:02:58 +1000 |
commit | 1c5b6a90d0515d7070a628c1c2d71649b9da2ec1 (patch) | |
tree | c601d510a0c3906e4102686a4251813ac223cf2c | |
parent | 7af26595c1d32eb8519b6d864a991dbd377f5ffa (diff) |
ren_clear respects clip
-rw-r--r-- | render.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -32,9 +32,14 @@ void ren_end(Renderer* r) { } void ren_clear(Renderer* r) { - int e = r->w * r->h >> 5, i; - for (i = 0; i < e; i++) - r->t[i] = 0; + int i, j; + for (j = r->clip[1]; j < r->clip[3]; j++) + for (i = r->clip[0]; i < r->clip[2]; i++) { + int idx = i + j * r->w; + int bit = 1 << (idx & 0x1f); + bit = ~bit; + r->t[idx >> 5] &= bit; + } } void ren_char(Renderer* r, int x, int y, char ch) { |