This commit is contained in:
veclavtlica
2026-09-14 02:04:16 +03:00
parent c350d65592
commit 26f6ba56e9
16 changed files with 178 additions and 72 deletions
+1 -2
View File
@@ -50,7 +50,7 @@ static inline com_vec_t com_gem_vec_project_clip(com_mat_t a, com_vec_t b) {
* outside of view. Bit test against those per component. This is needed for
* determining new view-lying clipped triangles. */
static inline uint8_t com_gem_clip_vis_project(com_vec_t a, com_pnt_t *out) {
uint8_t mask;
uint8_t mask = 0;
if (a.s.x < -a.s.z || a.s.x > a.s.z)
mask ^= COM_GEM_VERTEX_CLIPPED_X;
if (a.s.y < -a.s.z || a.s.y > a.s.z)
@@ -77,7 +77,6 @@ static inline void com_gem_draw_triangle(com_pnt_t v0, com_pnt_t v1,
// If the point is inside or on all edges, draw the pixel
// (Assumes Clockwise vertex ordering)
if (ws.a[0] >= 0 && ws.a[1] >= 0 && ws.a[2] >= 0) {
printf("%i, %i\n", y, x);
out[(y * 640 + x) * 4 + 0] = 125;
out[(y * 640 + x) * 4 + 1] = 125;
out[(y * 640 + x) * 4 + 2] = 125;