Skip to content

Commit

Permalink
Fixed|World|Sector: Re-evaluate sector cluster linking following cont…
Browse files Browse the repository at this point in the history
…ainment testing

In this situation there may still be another map hack which contains
the cluster (which, contains the nested map hack). To resolve this
we'll repeat the visual plane remapping process.

Todo for later: Re-implement this algorithm to avoid recursion. This
should wait until after "missing texture" map hack support, however.
  • Loading branch information
danij-deng committed Aug 27, 2013
1 parent 41eec36 commit b72b327
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doomsday/client/src/world/sector.cpp
Expand Up @@ -49,6 +49,10 @@ static QRectF qrectFromAABox(AABoxd const &aaBox)
return QRectF(QPointF(aaBox.minX, aaBox.maxY), QPointF(aaBox.maxX, aaBox.minY));
}

/**
* @todo Redesign the implementation to avoid recursion (note visPlane() calls
* this also).
*/
void Sector::Cluster::remapVisPlanes()
{
// By default both planes are mapped to the parent sector.
Expand Down Expand Up @@ -98,7 +102,9 @@ void Sector::Cluster::remapVisPlanes()
QRectF boundingRect = qrectFromAABox(aaBox());
if(boundingRect.contains(qrectFromAABox(exteriorCluster->aaBox())))
{
// The contained cluster will link to this.
// The contained cluster will link to this. However we may still
// need to link this one to another, so re-evaluate.
remapVisPlanes();
return;
}
else
Expand Down

0 comments on commit b72b327

Please sign in to comment.