X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=bih.c;h=fdda1d6d3bb3a20b64003008234723645e3217a7;hb=98567a812fda612bb59d0781f8cf4d31d5264355;hp=8797d20dcfcde1bcb587f949cba18a79457ebf2d;hpb=a5c12e5524c2af491c483e0207f48524f1cf072a;p=xonotic%2Fdarkplaces.git diff --git a/bih.c b/bih.c index 8797d20d..fdda1d6d 100644 --- a/bih.c +++ b/bih.c @@ -2,7 +2,7 @@ // This code written in 2010 by Forest Hale (lordhavoc ghdigital com), and placed into public domain. #include -#include +#include #include "bih.h" static int BIH_BuildNode(bih_t *bih, int numchildren, int *leaflist, float *totalmins, float *totalmaxs) @@ -10,10 +10,10 @@ static int BIH_BuildNode(bih_t *bih, int numchildren, int *leaflist, float *tota int i; int j; int longestaxis; - int axis; + int axis = 0; int nodenum; - int front; - int back; + int front = 0; + int back = 0; bih_node_t *node; bih_leaf_t *child; float splitdist; @@ -112,7 +112,7 @@ static int BIH_BuildNode(bih_t *bih, int numchildren, int *leaflist, float *tota } // we now have front and back children divided in leaflist... - node->type = BIH_SPLITX + axis; + node->type = (bih_nodetype_t)((int)BIH_SPLITX + axis); node->front = BIH_BuildNode(bih, front, leaflist, frontmins, frontmaxs); node->frontmin = frontmins[axis]; node->back = BIH_BuildNode(bih, back, leaflist + front, backmins, backmaxs);