From 0e75a2949678cb8a68fb0819355864aa6db2cb43 Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 5 Oct 2024 12:13:47 +1000 Subject: Level transitions and main menu --- render.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'render.c') diff --git a/render.c b/render.c index 07af8cf..ff7670b 100644 --- a/render.c +++ b/render.c @@ -114,6 +114,34 @@ void ren_map( } } +void ren_cmap( + Renderer* r, + int x, + int y, + const struct Rect* re, + const Bitmap* bm +) { + Rect rect, su = *re; + const unsigned* data = (const unsigned*)&bm[1]; + int i, j, sx, sy, ex, ey; + rect.x = x; + rect.y = y; + rect.w = re->w; + rect.h = re->h; + rect_clipsr(&rect, &su, r->clip); + ex = rect.x + rect.w; + ey = rect.y + rect.h; + for (j = rect.y, sy = su.y; j < ey; j++, sy++) { + for (i = rect.x, sx = su.x; i < ex; i++, sx++) { + int di = (i + j * r->w); + int si = (sx + sy * bm->w); + int bit = (1 << (si & 0x1f)); + bit &= data[si >> 5]; + r->t[di >> 5] &= ~((1 << (di & 0x1f)) * (bit != 0)); + } + } +} + void ren_rect( Renderer* r, const struct Rect* re -- cgit v1.2.3-54-g00ecf