diff --git a/doomsday/client/include/render/walledge.h b/doomsday/client/include/render/walledge.h index 7de06c41e1..d2e00b2f18 100644 --- a/doomsday/client/include/render/walledge.h +++ b/doomsday/client/include/render/walledge.h @@ -96,9 +96,9 @@ class WallEdge de::Vector2d const &origin() const; - coord_t lineOffset() const; + coord_t mapLineOffset() const; - Line::Side &lineSide() const; + Line::Side &mapSide() const; Surface &surface() const; diff --git a/doomsday/client/src/render/rend_fakeradio.cpp b/doomsday/client/src/render/rend_fakeradio.cpp index b376125f1a..794172ce30 100644 --- a/doomsday/client/src/render/rend_fakeradio.cpp +++ b/doomsday/client/src/render/rend_fakeradio.cpp @@ -1081,13 +1081,13 @@ void Rend_RadioWallSection(WallEdge const &leftEdge, WallEdge const &rightEdge, if(shadowSize <= 0) return; - Line::Side &side = leftEdge.lineSide(); + Line::Side &side = leftEdge.mapSide(); HEdge const *hedge = side.leftHEdge(); Sector const *frontSec = hedge->sectorPtr(); Sector const *backSec = hedge->twin().hasBspLeaf() && !hedge->twin().bspLeaf().isDegenerate() && leftEdge.section() != Line::Side::Middle? hedge->twin().bspLeaf().sectorPtr() : 0; coord_t const lineLength = side.line().length(); - coord_t const sectionOffset = leftEdge.lineOffset(); + coord_t const sectionOffset = leftEdge.mapLineOffset(); coord_t const sectionWidth = de::abs(Vector2d(rightEdge.origin() - leftEdge.origin()).length()); LineSideRadioData &frData = Rend_RadioDataForLineSide(side); diff --git a/doomsday/client/src/render/rend_main.cpp b/doomsday/client/src/render/rend_main.cpp index 2edd560267..221326245f 100644 --- a/doomsday/client/src/render/rend_main.cpp +++ b/doomsday/client/src/render/rend_main.cpp @@ -1259,8 +1259,8 @@ static void wallSectionLightLevelDeltas(WallEdge const &leftEdge, WallEdge const // Linearly interpolate to find the light level delta values for the // vertical edges of this wall section. - coord_t const lineLength = leftEdge.lineSide().line().length(); - coord_t const sectionOffset = leftEdge.lineOffset(); + coord_t const lineLength = leftEdge.mapSide().line().length(); + coord_t const sectionOffset = leftEdge.mapLineOffset(); coord_t const sectionWidth = de::abs(Vector2d(rightEdge.origin() - leftEdge.origin()).length()); float deltaDiff = rightDelta - leftDelta; @@ -1361,7 +1361,7 @@ static bool writeWallSection(WallEdge const &leftEdge, WallEdge const &rightEdge DENG_ASSERT(!isNullLeaf(bspLeaf)); DENG_ASSERT(rightEdge.top().distance() > leftEdge.bottom().distance()); - Line::Side &side = leftEdge.lineSide(); + Line::Side &side = leftEdge.mapSide(); Line &line = side.line(); int const section = leftEdge.section(); Surface &surface = leftEdge.surface(); @@ -2179,8 +2179,8 @@ static bool useWallSectionLightLevelDeltas(Line::Side &side, int section) if(rendLightWallAngle <= 0) return false; - // ...always if the surface's material was chosen as a HOM fix (lighting - // must be consistent with that applied to the relative back sector plane). + // Never if the surface's material was chosen as a HOM fix (lighting must + // be consistent with that applied to the relative back sector plane). if(side.hasSector() && side.back().hasSector() && side.surface(section).hasFixMaterial()) return false; diff --git a/doomsday/client/src/render/walledge.cpp b/doomsday/client/src/render/walledge.cpp index 49a33e5e12..04e9828935 100644 --- a/doomsday/client/src/render/walledge.cpp +++ b/doomsday/client/src/render/walledge.cpp @@ -50,7 +50,7 @@ Vector3d WallEdge::Intercept::origin() const DENG2_PIMPL(WallEdge), public IHPlane { - Line::Side *lineSide; + Line::Side *mapSide; int section; int edge; Flags flags; @@ -83,10 +83,10 @@ DENG2_PIMPL(WallEdge), public IHPlane {} } hplane; - Instance(Public *i, Line::Side *lineSide, int section, int edge, + Instance(Public *i, Line::Side *mapSide, int section, int edge, Flags flags, coord_t lineOffset, Vertex *lineVertex) : Base(i), - lineSide(lineSide), + mapSide(mapSide), section(section), edge(edge), flags(flags), @@ -97,7 +97,7 @@ DENG2_PIMPL(WallEdge), public IHPlane Instance(Public *i, Instance const &other) : Base(i), - lineSide (other.lineSide), + mapSide (other.mapSide), section (other.section), edge (other.edge), flags (other.flags), @@ -224,14 +224,14 @@ DENG2_PIMPL(WallEdge), public IHPlane DENG_ASSERT(top > bottom); // Retrieve the start owner node. - LineOwner *base = lineSide->line().vertexOwner(*lineVertex); + LineOwner *base = mapSide->line().vertexOwner(*lineVertex); if(!base) return; // Check for neighborhood division? - if(section == Line::Side::Middle && lineSide->back().hasSector()) + if(section == Line::Side::Middle && mapSide->back().hasSector()) return; - Sector const *frontSec = lineSide->sectorPtr(); + Sector const *frontSec = mapSide->sectorPtr(); LineOwner *own = base; bool stopScan = false; do @@ -323,7 +323,7 @@ DENG2_PIMPL(WallEdge), public IHPlane /** * Find the neighbor surface for the edge which we will use to calculate the - * smoothed normal. + * "blend" properties (e.g., smoothed edge normal). * * @todo: Use the half-edge rings instead of LineOwners. */ @@ -331,25 +331,24 @@ DENG2_PIMPL(WallEdge), public IHPlane { diff = 0; - // Disabled? + // Are we not blending? if(!(flags & SmoothNormal)) return 0; // Polyobj lines have no owner rings. - if(lineSide->line().definesPolyobj()) + if(mapSide->line().definesPolyobj()) return 0; - LineOwner const *farVertOwner = lineSide->line().vertexOwner(lineSide->lineSideId() ^ edge); - + LineOwner const *farVertOwner = mapSide->line().vertexOwner(mapSide->lineSideId() ^ edge); Line *neighbor; - if(R_SideBackClosed(*lineSide)) + if(R_SideBackClosed(*mapSide)) { - neighbor = R_FindSolidLineNeighbor(lineSide->sectorPtr(), &lineSide->line(), + neighbor = R_FindSolidLineNeighbor(mapSide->sectorPtr(), &mapSide->line(), farVertOwner, edge, &diff); } else { - neighbor = R_FindLineNeighbor(lineSide->sectorPtr(), &lineSide->line(), + neighbor = R_FindLineNeighbor(mapSide->sectorPtr(), &mapSide->line(), farVertOwner, edge, &diff); } @@ -358,12 +357,12 @@ DENG2_PIMPL(WallEdge), public IHPlane // Choose the correct side of the neighbor (determined by which vertex is shared). Line::Side *otherSide; - if(&neighbor->vertex(edge ^ 1) == &lineSide->vertex(edge)) + if(&neighbor->vertex(edge ^ 1) == &mapSide->vertex(edge)) otherSide = &neighbor->front(); else otherSide = &neighbor->back(); - // We can only smooth if the neighbor has a surface. + // We can only blend if the neighbor has a surface. if(!otherSide->hasSections()) return 0; /// @todo Do not assume the neighbor is the middle section of @var otherSide. @@ -391,14 +390,14 @@ bool WallEdge::isValid() const return d->isValid; } -Line::Side &WallEdge::lineSide() const +Line::Side &WallEdge::mapSide() const { - return *d->lineSide; + return *d->mapSide; } Surface &WallEdge::surface() const { - return d->lineSide->surface(d->section); + return d->mapSide->surface(d->section); } int WallEdge::section() const @@ -411,7 +410,7 @@ Vector2d const &WallEdge::origin() const return d->partition().origin; } -coord_t WallEdge::lineOffset() const +coord_t WallEdge::mapLineOffset() const { return d->lineOffset; } @@ -478,7 +477,7 @@ static bool shouldSmoothNormals(Surface &sufA, Surface &sufB, binangle_t angleDi void WallEdge::prepare() { coord_t bottom, top; - R_SideSectionCoords(*d->lineSide, d->section, &bottom, &top, &d->materialOrigin); + R_SideSectionCoords(*d->mapSide, d->section, &bottom, &top, &d->materialOrigin); d->isValid = (top >= bottom); if(!d->isValid) return; @@ -513,7 +512,7 @@ void WallEdge::prepare() // Determine the edge normal. /// @todo Cache the smoothed normal value somewhere. - Surface &surface = d->lineSide->surface(d->section); + Surface &surface = d->mapSide->surface(d->section); binangle_t angleDiff; Surface *blendSurface = d->findBlendNeighbor(angleDiff);