summaryrefslogtreecommitdiff
path: root/fb.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-06-13 19:06:37 +0000
committerrodri <rgl@antares-labs.eu>2024-06-13 19:06:37 +0000
commitb1335875b19a4db2ae028f8d790784cddcffe8b5 (patch)
tree1ee64309da345e0f027da3aa00c00f7111660581 /fb.c
parent213c3a4e99c3085ee89fda550897213abbc888ad (diff)
downloadlibgraphics-b1335875b19a4db2ae028f8d790784cddcffe8b5.tar.gz
libgraphics-b1335875b19a4db2ae028f8d790784cddcffe8b5.tar.bz2
libgraphics-b1335875b19a4db2ae028f8d790784cddcffe8b5.zip
replace the Memimage color buffer with a ulong* one. some fixes.
Diffstat (limited to 'fb.c')
-rw-r--r--fb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fb.c b/fb.c
index 6037f5a..5077b7d 100644
--- a/fb.c
+++ b/fb.c
@@ -15,7 +15,7 @@ framebufctl_draw(Framebufctl *ctl, Image *dst)
qlock(ctl);
fb = ctl->getfb(ctl);
- loadimage(dst, rectaddpt(fb->r, dst->r.min), byteaddr(fb->cb, fb->r.min), bytesperline(fb->r, fb->cb->depth)*Dy(fb->r));
+ loadimage(dst, rectaddpt(fb->r, dst->r.min), (uchar*)fb->cb, Dx(fb->r)*Dy(fb->r)*4);
qunlock(ctl);
}
@@ -26,7 +26,7 @@ framebufctl_memdraw(Framebufctl *ctl, Memimage *dst)
qlock(ctl);
fb = ctl->getfb(ctl);
- memimagedraw(dst, dst->r, fb->cb, ZP, nil, ZP, SoverD);
+ loadmemimage(dst, dst->r, (uchar*)fb->cb, Dx(fb->r)*Dy(fb->r)*4);
qunlock(ctl);
}
@@ -46,7 +46,7 @@ framebufctl_reset(Framebufctl *ctl)
/* address the back buffer—resetting the front buffer is VERBOTEN */
fb = ctl->getbb(ctl);
memsetd(fb->zb, Inf(-1), Dx(fb->r)*Dy(fb->r));
- memfillcolor(fb->cb, DTransparent);
+ memset(fb->cb, 0, Dx(fb->r)*Dy(fb->r)*4);
}
static Framebuf *
@@ -68,7 +68,7 @@ mkfb(Rectangle r)
fb = emalloc(sizeof *fb);
memset(fb, 0, sizeof *fb);
- fb->cb = eallocmemimage(r, RGBA32);
+ fb->cb = emalloc(Dx(r)*Dy(r)*4);
fb->zb = emalloc(Dx(r)*Dy(r)*sizeof(*fb->zb));
memsetd(fb->zb, Inf(-1), Dx(r)*Dy(r));
fb->r = r;
@@ -79,7 +79,7 @@ void
rmfb(Framebuf *fb)
{
free(fb->zb);
- freememimage(fb->cb);
+ free(fb->cb);
free(fb);
}