Skip to content

Commit

Permalink
Sector|Polyobj: There is no need to update bias surfaces during map s…
Browse files Browse the repository at this point in the history
…etup

Bias lighting is now initialized after any geometry which might move
during map change procedure have done so.
  • Loading branch information
danij-deng committed Jun 15, 2013
1 parent 36af813 commit 865eba6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
17 changes: 10 additions & 7 deletions doomsday/client/src/world/polyobj.cpp
Expand Up @@ -48,15 +48,18 @@ typedef QVector<Vector2d> VertexCoords;
static void notifyGeometryChanged(Polyobj &po)
{
#ifdef __CLIENT__
// Shadow bias must be informed when surfaces move/deform.
foreach(Line *line, po.lines())
if(!ddMapSetup)
{
Segment *segment = line->front().leftSegment();
if(!segment) continue;

for(int i = 0; i < 3; ++i)
// Shadow bias must be informed when surfaces move/deform.
foreach(Line *line, po.lines())
{
SB_SurfaceMoved(&segment->biasSurface(i));
Segment *segment = line->front().leftSegment();
if(!segment) continue;

for(int i = 0; i < 3; ++i)
{
SB_SurfaceMoved(&segment->biasSurface(i));
}
}
}
#else // !__CLIENT__
Expand Down
27 changes: 15 additions & 12 deletions doomsday/client/src/world/sector.cpp
Expand Up @@ -166,24 +166,27 @@ DENG2_OBSERVES(Plane, HeightChange)
}

#ifdef __CLIENT__
// Inform the shadow bias of changed geometry.
foreach(BspLeaf *bspLeaf, bspLeafs)
if(!ddMapSetup)
{
if(bspLeaf->isDegenerate())
continue;

foreach(Segment *seg, bspLeaf->allSegments())
// Inform the shadow bias of changed geometry.
foreach(BspLeaf *bspLeaf, bspLeafs)
{
if(!seg->hasLineSide())
continue;
if(bspLeaf->isDegenerate())
continue;

for(uint i = 0; i < 3; ++i)
foreach(Segment *seg, bspLeaf->allSegments())
{
SB_SurfaceMoved(&seg->biasSurface(i));
if(!seg->hasLineSide())
continue;

for(uint i = 0; i < 3; ++i)
{
SB_SurfaceMoved(&seg->biasSurface(i));
}
}
}

SB_SurfaceMoved(&bspLeaf->biasSurface(plane.inSectorIndex()));
SB_SurfaceMoved(&bspLeaf->biasSurface(plane.inSectorIndex()));
}
}

#endif // __CLIENT__
Expand Down

0 comments on commit 865eba6

Please sign in to comment.