summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-08-13 09:33:03 +0000
committerrodri <rgl@antares-labs.eu>2024-08-13 09:33:03 +0000
commit2715ad65bd01c1108d53c44b677847af9f4ce42e (patch)
tree432b1fe4e961b57690062d2c627e3819981e0b88
parent139a46c56af04a0b8c2f06769ac77078f5581395 (diff)
downloadlibgraphics-2715ad65bd01c1108d53c44b677847af9f4ce42e.tar.gz
libgraphics-2715ad65bd01c1108d53c44b677847af9f4ce42e.tar.bz2
libgraphics-2715ad65bd01c1108d53c44b677847af9f4ce42e.zip
fixes.
-rw-r--r--graphics.h2
-rw-r--r--render.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/graphics.h b/graphics.h
index e08e233..6362075 100644
--- a/graphics.h
+++ b/graphics.h
@@ -325,7 +325,7 @@ struct Camera
} clip;
Matrix3 proj; /* VCS to clip space xform */
Projection projtype;
- int clearcolor;
+ ulong clearcolor;
int cullmode;
int enableblend;
int enabledepth;
diff --git a/render.c b/render.c
index 50285cc..17be3fa 100644
--- a/render.c
+++ b/render.c
@@ -125,7 +125,7 @@ squashAbuf(Framebuf *fb, int blend)
while(stk->size--)
pixel(fb, stk->p, stk->items[stk->size].c, blend);
/* write to the depth buffer as well */
-// fb->zb[stk->p.x + stk->p.y*Dx(fb->r)] = stk->items[stk->size].z;
+ fb->zb[stk->p.x + stk->p.y*Dx(fb->r)] = stk->items[0].z;
}
}
@@ -265,7 +265,7 @@ discard:
for(p.y = bbox.min.y; p.y < bbox.max.y; p.y++)
for(p.x = bbox.min.x; p.x < bbox.max.x; p.x++){
- bc = _barycoords(t, Pt2(p.x,p.y,1));
+ bc = _barycoords(t, Pt2(p.x+0.5,p.y+0.5,1));
if(bc.x < 0 || bc.y < 0 || bc.z < 0)
continue;