forked from organicmaps/organicmaps
[graphics] removed useNormals
This commit is contained in:
parent
56fe172421
commit
59247603f3
2 changed files with 22 additions and 54 deletions
|
@ -11,14 +11,12 @@
|
|||
namespace graphics
|
||||
{
|
||||
PathRenderer::Params::Params()
|
||||
: m_drawPathes(true),
|
||||
m_useNormals(true)
|
||||
: m_drawPathes(true)
|
||||
{}
|
||||
|
||||
PathRenderer::PathRenderer(Params const & p)
|
||||
: base_t(p),
|
||||
m_drawPathes(p.m_drawPathes),
|
||||
m_useNormals(p.m_useNormals)
|
||||
m_drawPathes(p.m_drawPathes)
|
||||
{}
|
||||
|
||||
void PathRenderer::drawPath(m2::PointD const * pts, size_t ptsCount, double offset, uint32_t resID, double depth)
|
||||
|
@ -213,20 +211,10 @@ namespace graphics
|
|||
|
||||
m2::PointF coords[4];
|
||||
|
||||
if (m_useNormals)
|
||||
{
|
||||
coords[0] = rawTileStartPt;
|
||||
coords[1] = rawTileStartPt;
|
||||
coords[2] = rawTileEndPt;
|
||||
coords[3] = rawTileEndPt;
|
||||
}
|
||||
else
|
||||
{
|
||||
coords[0] = rawTileStartPt + fNorm;
|
||||
coords[1] = rawTileStartPt - fNorm;
|
||||
coords[2] = rawTileEndPt - fNorm;
|
||||
coords[3] = rawTileEndPt + fNorm;
|
||||
};
|
||||
coords[0] = rawTileStartPt;
|
||||
coords[1] = rawTileStartPt;
|
||||
coords[2] = rawTileEndPt;
|
||||
coords[3] = rawTileEndPt;
|
||||
|
||||
m2::PointF texCoords[4] =
|
||||
{
|
||||
|
@ -236,17 +224,13 @@ namespace graphics
|
|||
texture->mapPixel(m2::PointF(texMaxX, texMinY))
|
||||
};
|
||||
|
||||
m2::PointF normals[4];
|
||||
|
||||
if (m_useNormals)
|
||||
m2::PointF normals[4] =
|
||||
{
|
||||
normals[0] = fNorm;
|
||||
normals[1] = -fNorm;
|
||||
normals[2] = -fNorm;
|
||||
normals[3] = fNorm;
|
||||
}
|
||||
else
|
||||
memset(normals, 0, sizeof(normals));
|
||||
fNorm,
|
||||
-fNorm,
|
||||
-fNorm,
|
||||
fNorm
|
||||
};
|
||||
|
||||
addTexturedFan(coords,
|
||||
normals,
|
||||
|
@ -316,27 +300,18 @@ namespace graphics
|
|||
/// Rotate start vector to find another point on a join.
|
||||
startVec.Rotate(angleStep);
|
||||
|
||||
m2::PointF joinSeg[3];
|
||||
m2::PointF joinSegNormals[3];
|
||||
|
||||
if (m_useNormals)
|
||||
m2::PointF joinSeg[3] =
|
||||
{
|
||||
joinSeg[0] = points[i + 1];
|
||||
joinSeg[1] = points[i + 1];
|
||||
joinSeg[2] = points[i + 1];
|
||||
|
||||
joinSegNormals[0] = m2::PointF(0, 0);
|
||||
joinSegNormals[1] = startVec * geomHalfWidth;
|
||||
joinSegNormals[2] = prevStartVec * geomHalfWidth;
|
||||
}
|
||||
else
|
||||
points[i + 1],
|
||||
points[i + 1],
|
||||
points[i + 1]
|
||||
};
|
||||
m2::PointF joinSegNormals[3] =
|
||||
{
|
||||
joinSeg[0] = m2::PointF(points[i + 1]);
|
||||
joinSeg[1] = m2::PointF(points[i + 1] + startVec * geomHalfWidth);
|
||||
joinSeg[2] = m2::PointF(points[i + 1] + prevStartVec * geomHalfWidth);
|
||||
|
||||
memset(joinSegNormals, 0, sizeof(joinSegNormals));
|
||||
}
|
||||
m2::PointF(0, 0),
|
||||
startVec * geomHalfWidth,
|
||||
prevStartVec * geomHalfWidth
|
||||
};
|
||||
|
||||
addTexturedFan(joinSeg,
|
||||
joinSegNormals,
|
||||
|
@ -509,9 +484,5 @@ namespace graphics
|
|||
base_t::endFrame();
|
||||
}
|
||||
|
||||
void PathRenderer::setUseNormals(bool flag)
|
||||
{
|
||||
m_useNormals = flag;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ namespace graphics
|
|||
unsigned m_pathCount;
|
||||
unsigned m_pointsCount;
|
||||
bool m_drawPathes;
|
||||
bool m_useNormals;
|
||||
|
||||
void drawSolidPath(m2::PointD const * pts, size_t ptsCount, double offset, Pen const * pen, double depth);
|
||||
void drawStipplePath(m2::PointD const * pts, size_t ptsCount, double offset, Pen const * pen, double depth);
|
||||
|
@ -27,7 +26,6 @@ namespace graphics
|
|||
struct Params : base_t::Params
|
||||
{
|
||||
bool m_drawPathes;
|
||||
bool m_useNormals;
|
||||
Params();
|
||||
};
|
||||
|
||||
|
@ -38,6 +36,5 @@ namespace graphics
|
|||
void beginFrame();
|
||||
void endFrame();
|
||||
|
||||
void setUseNormals(bool flag);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue