Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-07-15 16:25:44 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-07-15 16:25:44 +0300
commit1994ee7c87a49c0a3be806d00b9a148acfc1f39e (patch)
tree2b4cd66a6d35c45a4f93fbfc7c5b5956f5c03353 /drape_frontend
parent10e82203397abefde6f6e1eed891853a40828035 (diff)
Review fixes
Diffstat (limited to 'drape_frontend')
-rw-r--r--drape_frontend/arrow3d.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/drape_frontend/arrow3d.cpp b/drape_frontend/arrow3d.cpp
index 3798b29b78..19f7fe7ecd 100644
--- a/drape_frontend/arrow3d.cpp
+++ b/drape_frontend/arrow3d.cpp
@@ -27,28 +27,29 @@ double const kArrow3dScaleMin = 1.0;
double const kArrow3dScaleMax = 2.2;
double const kArrow3dMinZoom = 16;
+int constexpr kComponentsInVertex = 4;
+
Arrow3d::Arrow3d()
: m_state(gpu::ARROW_3D_PROGRAM, dp::GLState::OverlayLayer)
{
m_vertices = {
- 0.0f, 0.0f, -1.0f, 1.0, -1.2f, -1.0f, 0.0f, 1.0, 0.0f, 2.0f, 0.0f, 1.0,
- 0.0f, 0.0f, -1.0f, 1.0, 0.0f, 2.0f, 0.0f, 1.0, 1.2f, -1.0f, 0.0f, 1.0,
- 0.0f, 0.0f, -1.0f, 1.0, 0.0f, -0.5f, 0.0f, 1.0, -1.2f, -1.0f, 0.0f, 1.0,
- 0.0f, 0.0f, -1.0f, 1.0, 1.2f, -1.0f, 0.0f, 1.0, 0.0f, -0.5f, 0.0f, 1.0,
+ 0.0f, 0.0f, -1.0f, 1.0f, -1.2f, -1.0f, 0.0f, 1.0f, 0.0f, 2.0f, 0.0f, 1.0f,
+ 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 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, 0.0f, 0.0, -1.2f, -1.0f, 0.0f, 1.0,
+ 1.2f, -1.0f, 0.0f, 1.0f, 1.4f, -1.17f, 0.0f, 0.0f, 0.0f, -0.67f, 0.0f, 0.0f,
+ 0.0f, -0.5f, 0.0f, 1.0f, 1.2f, -1.0f, 0.0f, 1.0f, 0.0f, -0.67f, 0.0f, 0.0f,
+ -1.2f, -1.0f, 0.0f, 1.0f, 0.0f, -0.67f, 0.0f, 0.0f, -1.4f, -1.17f, 0.0f, 0.0f,
+ 0.0f, -0.5f, 0.0f, 1.0f, 0.0f, -0.67f, 0.0f, 0.0f, -1.2f, -1.0f, 0.0f, 1.0f,
};
int constexpr kVerticesInRow = 12;
- int constexpr kComponentsInVertex = 4;
m_normals.reserve(m_vertices.size());
for (size_t triangle = 0; triangle < m_vertices.size() / kVerticesInRow; ++triangle)
{
@@ -155,7 +156,8 @@ void Arrow3d::RenderArrow(ScreenBase const & screen, ref_ptr<dp::GpuProgram> pro
uint32_t const attributePosition = program->GetAttributeLocation("a_pos");
ASSERT_NOT_EQUAL(attributePosition, -1, ());
GLFunctions::glEnableVertexAttribute(attributePosition);
- GLFunctions::glVertexAttributePointer(attributePosition, 4, gl_const::GLFloatType, false, 0, 0);
+ GLFunctions::glVertexAttributePointer(attributePosition, kComponentsInVertex,
+ gl_const::GLFloatType, false, 0, 0);
GLFunctions::glBindBuffer(m_bufferNormalsId, gl_const::GLArrayBuffer);
uint32_t const attributeNormal = program->GetAttributeLocation("a_normal");
@@ -170,7 +172,7 @@ void Arrow3d::RenderArrow(ScreenBase const & screen, ref_ptr<dp::GpuProgram> pro
uniforms.SetFloatValue("u_color", c.r, c.g, c.b, c.a);
dp::ApplyState(m_state, program);
dp::ApplyUniforms(uniforms, program);
- GLFunctions::glDrawArrays(gl_const::GLTriangles, 0, m_vertices.size() / 4);
+ GLFunctions::glDrawArrays(gl_const::GLTriangles, 0, m_vertices.size() / kComponentsInVertex);
}
math::Matrix<float, 4, 4> Arrow3d::CalculateTransform(ScreenBase const & screen, float dz) const