X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosrtxon;a=blobdiff_plain;f=src%2F3dgfx.c;fp=src%2F3dgfx.c;h=64fd604cdc513fc4031f4bd1b971906764810c7d;hp=044ab6602897259700f0a3a1208100528831d58d;hb=584c6161bb6f3f548d5e27bb7d6895a81375881e;hpb=19f635d551abc4596879c308a7a1be21009b33a8 diff --git a/src/3dgfx.c b/src/3dgfx.c index 044ab66..64fd604 100644 --- a/src/3dgfx.c +++ b/src/3dgfx.c @@ -82,6 +82,7 @@ int g3d_init(void) fprintf(stderr, "failed to allocate G3D context\n"); return -1; } + st->opt = G3D_CLIP_FRUSTUM; st->fill_mode = POLYFILL_FLAT; for(i=0; iopt & G3D_CLIP_FRUSTUM) { + for(i=0; i<6; i++) { + memcpy(tmpv, v, vnum * sizeof *v); + + if(clip_frustum(v, &vnum, tmpv, vnum, i) < 0) { + /* polygon completely outside of view volume. discard */ + vnum = 0; + break; + } } - } - if(!vnum) continue; + if(!vnum) continue; + } for(i=0; i