X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Flevel.c;h=21a82f99690ec71b54d165c57ea583ed5c98ab45;hb=d2894c1a2380cee76476d63e4800188dcbc121f8;hp=fcdc405e76576ba25ac55305b3762a567eb8a546;hpb=92fb08c674a95e1b14de3dc21c718444be91aac5;p=cyberay diff --git a/src/level.c b/src/level.c index fcdc405..21a82f9 100644 --- a/src/level.c +++ b/src/level.c @@ -119,6 +119,8 @@ static void draw_level_rec(struct bvhnode *bn) struct material *curmtl; float color[4] = {0, 0, 0, 1}; + if(!bn) return; + if(bn->faces) { tri = bn->faces; curmtl = tri->mtl; @@ -145,11 +147,8 @@ static void draw_level_rec(struct bvhnode *bn) glEnd(); } - bn = bn->sub; - while(bn) { - draw_level_rec(bn); - bn = bn->next; - } + draw_level_rec(bn->left); + draw_level_rec(bn->right); } void draw_level(struct level *lvl)