X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fbsptree.h;h=2839ab01b761688a406138b3b74055413b6e0c7d;hp=ff290512f4c262df1138ff49d2b719319c5e3910;hb=00a81988c5c6c91997f2f9346ac94858622490bd;hpb=40cce6588b2c4e15b46f0f73351d6f3fffb00d90 diff --git a/src/bsptree.h b/src/bsptree.h index ff29051..2839ab0 100644 --- a/src/bsptree.h +++ b/src/bsptree.h @@ -5,15 +5,20 @@ #include "vmath.h" #include "polyclip.h" -struct bspnode { +struct bsppoly { struct cplane plane; int vcount; struct g3d_vertex *verts; +}; + +struct bspnode { + struct bsppoly poly; struct bspnode *front, *back; }; struct bsptree { struct bspnode *root; + struct bsppoly *soup; /* dynarr: see dynarr.h */ }; int init_bsp(struct bsptree *bsp); @@ -25,6 +30,8 @@ int load_bsp(struct bsptree *bsp, const char *fname); int bsp_add_poly(struct bsptree *bsp, struct g3d_vertex *v, int vnum); int bsp_add_mesh(struct bsptree *bsp, struct g3d_mesh *m); +int bsp_build(struct bsptree *bsp); + void draw_bsp(struct bsptree *bsp, float view_x, float view_y, float view_z); #endif /* BSPMESH_H_ */