diff options
author | rodri <rgl@antares-labs.eu> | 2024-06-13 19:06:37 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-06-13 19:06:37 +0000 |
commit | b1335875b19a4db2ae028f8d790784cddcffe8b5 (patch) | |
tree | 1ee64309da345e0f027da3aa00c00f7111660581 /fb.c | |
parent | 213c3a4e99c3085ee89fda550897213abbc888ad (diff) | |
download | libgraphics-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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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); } |