int Intersect_Light_Tree(RAY *Ray, PROJECT_TREE_NODE *Tree, int x, int y, INTERSECTION *Best_Intersection, OBJECT **Best_Object, LIGHT_SOURCE *Light_Source)
{
INTERSECTION New_Intersection;
unsigned short i;
int Found;
RAYINFO rayinfo;
DBL key;
BBOX_TREE *BBox_Node;
PROJECT_TREE_NODE *Node;
/* If there's no vista tree then return. */
if (Tree == NULL)
{
return(FALSE);
}
/* Start with an empty priority queue */
VLBuffer_Queue->QSize = 0;
Found = FALSE;
#ifdef BBOX_EXTRA_STATS
Increase_Counter(stats[totalQueueResets]);
#endif
/* Traverse the tree. */
Node_Queue->QSize = 0;
/* Create the direction vectors for this ray */
Create_Rayinfo(Ray, &rayinfo);
/* Fill the priority queue with all possible candidates */
/* Check root */
Increase_Counter(stats[LBuffer_Tests]);
if ((x >= Tree->Project.x1) && (x <= Tree->Project.x2) &&