X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fpolytest.c;h=2558389b2915e5b24604dfdb29d6ce81d474f057;hp=207fb31557f925017a86e21acbf93739633fbe3c;hb=a5c65ceb155188c8acee31a475f8db9f5b58f4b6;hpb=8cee0ffb00cce3d81487f1161286ac299db7d044 diff --git a/src/polytest.c b/src/polytest.c index 207fb31..2558389 100644 --- a/src/polytest.c +++ b/src/polytest.c @@ -9,6 +9,7 @@ #include "polyfill.h" /* just for struct pimage */ #include "cfgopt.h" #include "mesh.h" +#include "bsptree.h" static int init(void); static void destroy(void); @@ -28,9 +29,12 @@ static struct screen scr = { static float cam_theta, cam_phi = 25; static float cam_dist = 3; static struct g3d_mesh cube, torus; +static struct bsptree torus_bsp; static struct pimage tex; +static int use_bsp = 1; + #define LOWRES_SCALE 10 static uint16_t *lowres_pixels; static int lowres_width, lowres_height; @@ -44,14 +48,20 @@ static int init(void) { int i; - gen_cube(&cube, 1.0, 0); - gen_torus(&torus, 1.0, 0.25, 24, 12); + gen_cube_mesh(&cube, 1.0, 0); + gen_torus_mesh(&torus, 1.0, 0.25, 24, 12); /* scale texcoords */ for(i=0; i