nuclear@3: #include "m3dimpl.h" nuclear@9: #include "lines.h" nuclear@3: nuclear@3: nuclear@9: void m3d_draw_point(struct min3d_vertex *v) nuclear@3: { nuclear@5: int x = v->pos[0] + 0.5; nuclear@5: int y = v->pos[1] + 0.5; nuclear@5: int xsz = m3dctx->cbuf->xsz; nuclear@9: m3dctx->cbuf->pixels[y * xsz + x] = v->color; nuclear@3: } nuclear@3: nuclear@9: void m3d_draw_line(struct min3d_vertex *v) nuclear@3: { nuclear@9: int x0, y0, x1, y1; nuclear@9: nuclear@9: x0 = v[0].pos[0]; nuclear@9: y0 = v[0].pos[1]; nuclear@9: x1 = v[1].pos[0]; nuclear@9: y1 = v[1].pos[1]; nuclear@9: nuclear@9: if(clip_line2d(&x0, &y0, &x1, &y1, m3dctx->vport)) { nuclear@9: draw_line(m3dctx->cbuf->pixels, m3dctx->cbuf->xsz, v->color, x0, y0, x1, y1); nuclear@9: } nuclear@3: } nuclear@3: nuclear@9: void m3d_draw_poly(struct min3d_vertex *v, int numv) nuclear@3: { nuclear@9: int i; nuclear@9: struct min3d_vertex last[2]; nuclear@9: nuclear@9: if(ENABLED(M3D_CULL_FACE)) { nuclear@9: float a[2], b[2], crossz = 0; nuclear@9: nuclear@9: for(i=1; i