Skip to content

Commit

Permalink
Refactor|Polyobj: Updated Polyobj wrt changes to Vertex
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Apr 22, 2013
1 parent 3bd2112 commit 999e482
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions doomsday/client/src/map/polyobj.cpp
Expand Up @@ -260,8 +260,7 @@ bool Polyobj::move(Vector2d const &delta)
(*prevCoordsIt) = vertex->origin();

// Apply translation.
Vector2d newVertexOrigin = Vector2d(vertex->origin()) + delta;
V2d_Set(vertex->_origin, newVertexOrigin.x, newVertexOrigin.y);
vertex->setOrigin(vertex->origin() + delta);

prevCoordsIt++;
}
Expand All @@ -288,7 +287,7 @@ bool Polyobj::move(Vector2d const &delta)
VertexCoords::const_iterator prevCoordsIt = static_cast<VertexCoords *>(_prevPts)->constBegin();
foreach(Vertex *vertex, uniqueVertexes())
{
V2d_Set(vertex->_origin, prevCoordsIt->x, prevCoordsIt->y);
vertex->setOrigin(*prevCoordsIt);
prevCoordsIt++;
}

Expand Down Expand Up @@ -349,8 +348,7 @@ bool Polyobj::rotate(angle_t delta)
// Apply rotation relative to the "original" coords.
Vector2d newCoords = (*origCoordsIt);
rotatePoint2d(newCoords, origin, fineAngle);

V2d_Set(vertex->_origin, newCoords.x, newCoords.y);
vertex->setOrigin(newCoords);

origCoordsIt++;
prevCoordsIt++;
Expand Down Expand Up @@ -379,7 +377,7 @@ bool Polyobj::rotate(angle_t delta)
VertexCoords::const_iterator prevCoordsIt = static_cast<VertexCoords *>(_prevPts)->constBegin();
foreach(Vertex *vertex, uniqueVertexes())
{
V2d_Set(vertex->_origin, prevCoordsIt->x, prevCoordsIt->y);
vertex->setOrigin(*prevCoordsIt);
prevCoordsIt++;
}

Expand Down

0 comments on commit 999e482

Please sign in to comment.