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:
authorExMix <rahuba.youri@mapswithme.com>2014-11-05 12:05:14 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:27:57 +0300
commitbbf322253f645cf36381dcdd32124de8f5371706 (patch)
tree02a74be25914ae26dfc2c7b956cf29c367d0bb1d /drape_frontend
parent4ebffe3d6129a756a492e7416a1747d79c2ac8bd (diff)
[core] circle shape refactoring
Diffstat (limited to 'drape_frontend')
-rw-r--r--drape_frontend/circle_shape.cpp13
-rw-r--r--drape_frontend/circle_shape.hpp2
2 files changed, 4 insertions, 11 deletions
diff --git a/drape_frontend/circle_shape.cpp b/drape_frontend/circle_shape.cpp
index 06aa11baf5..c9c9099dcc 100644
--- a/drape_frontend/circle_shape.cpp
+++ b/drape_frontend/circle_shape.cpp
@@ -1,11 +1,10 @@
#include "circle_shape.hpp"
-#include "common_structures.hpp"
+#include "../drape/glsl_types.hpp"
#include "../drape/batcher.hpp"
#include "../drape/attribute_provider.hpp"
#include "../drape/glstate.hpp"
#include "../drape/shader_def.hpp"
-#include "../drape/texture_of_colors.hpp"
#include "../drape/texture_set_holder.hpp"
#define BLOCK_X_OFFSET 0
@@ -20,14 +19,11 @@
namespace df
{
- using glsl_types::vec2;
- using glsl_types::vec3;
- using glsl_types::vec4;
namespace
{
-void AddPoint(vector<float> & stream, size_t pointIndex, float x, float y, float z, float nX, float nY, vec3 const & color)
+void AddPoint(vector<float> & stream, size_t pointIndex, float x, float y, float z, float nX, float nY, glsl::vec3 const & color)
{
size_t startIndex = pointIndex * VERTEX_STRIDE;
stream[startIndex + BLOCK_X_OFFSET] = x;
@@ -56,10 +52,7 @@ void CircleShape::Draw(dp::RefPointer<dp::Batcher> batcher, dp::RefPointer<dp::T
dp::ColorKey key(m_params.m_color.GetColorInInt());
dp::TextureSetHolder::ColorRegion region;
textures->GetColorRegion(key, region);
- m2::RectF const & rect = region.GetTexRect();
- float texIndex = static_cast<float>(region.GetTextureNode().m_textureOffset);
-
- vec3 color(rect.RightTop(), texIndex);
+ glsl::vec3 color(glsl::ToVec2(region.GetTexRect().Center()), region.GetTextureNode().GetOffset());
/// x, y, z floats on geompoint
/// normal x, y on triangle forming normals
diff --git a/drape_frontend/circle_shape.hpp b/drape_frontend/circle_shape.hpp
index b69a63519c..cfcc1e81b2 100644
--- a/drape_frontend/circle_shape.hpp
+++ b/drape_frontend/circle_shape.hpp
@@ -11,7 +11,7 @@ class CircleShape : public MapShape
public:
CircleShape(m2::PointF const & mercatorPt, CircleViewParams const & params);
- virtual void Draw(dp::RefPointer<dp::Batcher> batcher, dp::RefPointer<dp::TextureSetHolder> /*textures*/) const;
+ virtual void Draw(dp::RefPointer<dp::Batcher> batcher, dp::RefPointer<dp::TextureSetHolder> textures) const;
private:
m2::PointF m_pt;