components/prboom/r_bsp.c
//
// RenderBSPNode
// Renders all subsectors below a given node,
//  traversing subtree recursively.
// Just call with BSP root.
//
// killough 5/2/98: reformatted, removed tail recursion
RenderBSPNode
Renders all subsectors below a given node,
traversing subtree recursively.
Just call with BSP root.

killough 5/2/98: reformatted, removed tail recursion
RenderBSPNode Renders all subsectors below a given node traversing subtree recursively . Just call with BSP root . killough 5 / 2 / 98 : reformatted removed tail recursion
void R_RenderBSPNode(int bspnum)
{
  while (!(bspnum & NF_SUBSECTOR))  
    {
      const node_t *bsp = &nodes[bspnum];
      int side = R_PointOnSide(viewx, viewy, bsp);
      R_RenderBSPNode(bsp->children[side]);
      if (!R_CheckBBox(bsp->bbox[side^1]))
        return;
      bspnum = bsp->children[side^1];
    }
  R_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR);
}
void R_RenderBSPNode ( int bspnum ) { while ( ! ( bspnum & NF_SUBSECTOR ) ) { const node_t * bsp = & nodes [ bspnum ] ; int side = R_PointOnSide ( viewx , viewy , bsp ) ; R_RenderBSPNode ( bsp -> children [ side ] ) ; if ( ! R_CheckBBox ( bsp -> bbox [ side ^ 1 ] ) ) return ; bspnum = bsp -> children [ side ^ 1 ] ; } R_Subsector ( bspnum == -1 ? 0 : bspnum & ~ NF_SUBSECTOR ) ; }
RenderBSPNode
Renders all subsectors below a given node,
traversing subtree recursively.
RenderBSPNode Renders all subsectors below a given node traversing subtree recursively .
// Found a subsector? // Decide which side the view point is on. // Recursively divide front space. // Possibly divide back space.