X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2F3dgfx.c;h=41b395991a82a7cf096612e148db973e8a0eefdf;hp=31e649d3d5174770b9ce031237e849d8e1c4d824;hb=0945eeeef21fe85f9a592bfc2e41069a7894b08b;hpb=9bdd6ddccd850f8a7dd2942c0b7088b77f41af0e diff --git a/src/3dgfx.c b/src/3dgfx.c index 31e649d..41b3959 100644 --- a/src/3dgfx.c +++ b/src/3dgfx.c @@ -15,6 +15,7 @@ typedef float g3d_matrix[16]; struct g3d_state { unsigned int opt; int frontface; + int fill_mode; g3d_matrix mat[G3D_NUM_MATRICES][STACK_SIZE]; int mtop[G3D_NUM_MATRICES]; @@ -46,6 +47,7 @@ int g3d_init(void) fprintf(stderr, "failed to allocate G3D context\n"); return -1; } + st->fill_mode = POLYFILL_FLAT; for(i=0; iwidth = width; st->height = height; st->pixels = pixels; + + pimg_fb.pixels = pixels; + pimg_fb.width = width; + pimg_fb.height = height; } void g3d_enable(unsigned int opt) @@ -91,6 +97,11 @@ void g3d_front_face(unsigned int order) st->frontface = order; } +void g3d_polygon_mode(int pmode) +{ + st->fill_mode = pmode; +} + void g3d_matrix_mode(int mmode) { st->mmode = mmode; @@ -335,7 +346,7 @@ void g3d_draw_indexed(int prim, const struct g3d_vertex *varr, int varr_size, } } - polyfill_flat(pv, vnum); + polyfill(st->fill_mode, pv, vnum); } }