Skip to content

Commit

Permalink
Map Renderer|SectionEdge: SectionEdge can now be used for Polyobj sec…
Browse files Browse the repository at this point in the history
…tions also
  • Loading branch information
danij-deng committed May 2, 2013
1 parent 59ae4be commit 5a89319
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
6 changes: 0 additions & 6 deletions doomsday/client/include/map/hedge.h
Expand Up @@ -51,12 +51,6 @@ class SectionEdge

void prepare(coord_t bottom, coord_t top);

void configure() {
_firstIntercept = &wallDivs.first();
_lastIntercept = &wallDivs.last();
_interceptCount = wallDivs.count();
}

int divisionCount() const { return _interceptCount - 2; }

de::WallDivs::Intercept &firstDivision() const;
Expand Down
17 changes: 4 additions & 13 deletions doomsday/client/src/render/rend_main.cpp
Expand Up @@ -2010,16 +2010,7 @@ static bool writeWallSections2(HEdge &hedge, int sections)
return opaque;
}

static void prepareSectionEdgePolyobj(SectionEdge &edge, HEdge &hedge, int section,
coord_t bottom, coord_t top, int right)
{
DENG2_UNUSED3(hedge, section, right);
edge.wallDivs.intercept(bottom); // First node.
edge.wallDivs.intercept(top); // Last node.
edge.configure();
}

static bool prepareSectionEdgesPolyobj(HEdge &hedge, int section,
static bool preparePolyobjSectionEdges(HEdge &hedge, int section,
SectionEdge &leftEdge, SectionEdge &rightEdge, Vector2f &materialOrigin)
{
BspLeaf *leaf = currentBspLeaf;
Expand All @@ -2031,8 +2022,8 @@ static bool prepareSectionEdgesPolyobj(HEdge &hedge, int section,

if(!visible) return false;

prepareSectionEdgePolyobj(leftEdge, hedge, section, bottom, top, false /*left edge */);
prepareSectionEdgePolyobj(rightEdge, hedge, section, bottom, top, true /*right edge */);
leftEdge.prepare(bottom, top);
rightEdge.prepare(bottom, top);

return true;
}
Expand All @@ -2055,7 +2046,7 @@ static bool writeWallSections2Polyobj(HEdge &hedge, int sections)
Vector2f materialOrigin;
bool opaque = false;

if(prepareSectionEdgesPolyobj(hedge, section, leftEdge, rightEdge, materialOrigin))
if(preparePolyobjSectionEdges(hedge, section, leftEdge, rightEdge, materialOrigin))
{
opaque = writeWallSection(leftEdge, rightEdge, materialOrigin,
hedge, hedge.biasSurfaceForGeometryGroup(section));
Expand Down

0 comments on commit 5a89319

Please sign in to comment.