diff options
Diffstat (limited to 'render.c')
-rw-r--r-- | render.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -211,6 +211,25 @@ void ren_point(Renderer* r, Colour c, int x, int y) { r->t[x + y * r->vp[0]] = c; } +void ren_rect(Renderer* r, Colour c, const Rect* re) { + Rect rect = *re; + Colour* d; + int s, y, ey, ex; + rect_clipr(&rect, r->clip); + d = &r->t[rect.x + rect.y * r->vp[0]]; + s = r->vp[0] - rect.w; + ex = rect.x + rect.w; + ey = rect.y + rect.h; + for (y = rect.y; y < ey; y++) { + int x; + for (x = rect.x; x < ex; x++) { + *d = blend(*d, c); + d++; + } + d += s; + } +} + #define imp_ren_char(chw, chh, fw, data) \ int i, j, k, l, ex, ey, s; \ Colour* dst; \ |