diff options
-rw-r--r-- | src/ix3.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -426,7 +426,7 @@ static ix3_object_t * add_object(ix3_t *ix3, unsigned *depth, ix3_node_t *node, bb3f_t octrants[8]; int i; - *depth++; + (*depth)++; init_octrants(octrants, node_aabb, &node->center); for (i = 0; i < 8; i++) { if (!aabb_overlap(NULL, NULL, &octrants[i], &object->position, &object->origin, &object->aabb)) @@ -435,7 +435,7 @@ static ix3_object_t * add_object(ix3_t *ix3, unsigned *depth, ix3_node_t *node, if (!add_object(ix3, depth, &node->children[i], &octrants[i], object, reference_cache)) goto _fail; } - *depth--; + (*depth)--; return object; } @@ -446,10 +446,10 @@ static ix3_object_t * add_object(ix3_t *ix3, unsigned *depth, ix3_node_t *node, /* If the node is overflowing, split it */ if (node->n_objects > ix3->max_per_node && *depth < ix3->max_depth) { - *depth++; + (*depth)++; if (!split_node(ix3, depth, node, node_aabb)) goto _fail; - *depth--; + (*depth)--; } return object; |