Skip to content

Commit

Permalink
Partitioner: Added build option DENG_BSP_COLLAPSE_ORPHANED_LEAFS
Browse files Browse the repository at this point in the history
Enables collapsing of orphaned BSP leafs whilst partitioning the map
geometry and building the BSP.

This feature needs testing. It solves several rendering issues and
many render-hacks, however, presently the back sector is cleared for
any lines which produced an orphan (meaning it may adversely affect
any line specials dependent on said lines).

At this stage I'm only really interested in locating any adverse
side effects the feature may have on geometry construction/rendering.

I'll return to this once I've completed the current work phase.
  • Loading branch information
danij-deng committed Apr 13, 2013
1 parent abf0baf commit 072f347
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doomsday/client/src/map/bsp/partitioner.cpp
Expand Up @@ -1309,12 +1309,12 @@ DENG2_PIMPL(Partitioner)
if(!hedges.count()) return 0;

// Collapse all degenerate and orphaned leafs.
#if 0
#ifdef DENG_BSP_COLLAPSE_ORPHANED_LEAFS
bool const isDegenerate = hedges.count() < 3;
bool isOrphan = true;
foreach(HEdge *hedge, hedges)
{
if(hedge->line && hedge->line->hasSector(hedge->side))
if(hedge->hasLine() && hedge->lineSide().hasSector())
{
isOrphan = false;
break;
Expand All @@ -1326,7 +1326,7 @@ DENG2_PIMPL(Partitioner)
while(!hedges.isEmpty())
{
HEdge *hedge = hedges.takeFirst();
#if 0
#ifdef DENG_BSP_COLLAPSE_ORPHANED_LEAFS
HEdgeInfos::iterator hInfoIt = hedgeInfos.find(hedge);
HEdgeInfo &hInfo = hInfoIt.value();

Expand Down Expand Up @@ -1357,10 +1357,10 @@ DENG2_PIMPL(Partitioner)
{
LineDef::Side &side = hedge->lineSide();

side->_sector = 0;
side->_sideDef = 0;
side._sector = 0;
side._sideDef = 0;

lineDefInfo(hedge->line()).flags &=
lineInfos[hedge->line().origIndex() - 1].flags &=
~(LineInfo::SelfRef | LineInfo::Twosided);
}

Expand Down

0 comments on commit 072f347

Please sign in to comment.