All pastes #635892 Raw Edit

Unbenannt

public text v1 · immutable
#635892 ·published 2007-07-27 13:34 UTC
rendered paste body
	// create 
		for(i = 0; i < bvh->numfaces; i++) // 1024 ) bvh->numfaces
		{
			tree = (Tree *)MEM_callocN(sizeof(Tree), "Tree");
			
			if(!tree)
			{
				// TODO
				printf("help!\n");
			}
			
			tree->prevLeaf = bvh->leaf_tree;
			tree->nextLeaf = NULL;
			
			if (bvh->leaf_tree)
			{
				bvh->leaf_tree->nextLeaf = tree;
			}
			else
			{
				bvh->leaf_tree = tree;
			}

			if (!bvh->leaf_root)
			{
				bvh->leaf_root = tree;
			}
			
		}
		
		for (leaf = bvh->leaf_root; leaf; leaf = leaf->nextLeaf)
		{
			count++;
		}
	
		printf("count: %d\n", count); // only coutns 2!!