mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-04 03:43:46 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -20,8 +20,8 @@ class CopyrightHandle : public StaticLabelHandle
|
||||
using TBase = StaticLabelHandle;
|
||||
|
||||
public:
|
||||
CopyrightHandle(uint32_t id, ref_ptr<dp::TextureManager> textureManager,
|
||||
dp::Anchor anchor, m2::PointF const & pivot, dp::TGlyphs && glyphs)
|
||||
CopyrightHandle(uint32_t id, ref_ptr<dp::TextureManager> textureManager, dp::Anchor anchor, m2::PointF const & pivot,
|
||||
dp::TGlyphs && glyphs)
|
||||
: TBase(id, textureManager, anchor, pivot, std::move(glyphs))
|
||||
{
|
||||
SetIsVisible(true);
|
||||
@@ -43,8 +43,7 @@ public:
|
||||
|
||||
if (m_animation == nullptr)
|
||||
{
|
||||
m_animation = make_unique_dp<df::OpacityAnimation>(kCopyrightHideTime,
|
||||
kCopyrightVisibleTime, 1.0f, 0.0f);
|
||||
m_animation = make_unique_dp<df::OpacityAnimation>(kCopyrightHideTime, kCopyrightVisibleTime, 1.0f, 0.0f);
|
||||
}
|
||||
else if (m_animation->IsFinished())
|
||||
{
|
||||
@@ -61,37 +60,32 @@ private:
|
||||
};
|
||||
} // namespace
|
||||
|
||||
CopyrightLabel::CopyrightLabel(Position const & position)
|
||||
: TBase(position)
|
||||
{}
|
||||
CopyrightLabel::CopyrightLabel(Position const & position) : TBase(position) {}
|
||||
|
||||
drape_ptr<ShapeRenderer> CopyrightLabel::Draw(ref_ptr<dp::GraphicsContext> context,
|
||||
ref_ptr<dp::TextureManager> tex) const
|
||||
{
|
||||
StaticLabel::LabelResult result;
|
||||
auto glyphs = StaticLabel::CacheStaticText("Map data © OpenStreetMap", "", m_position.m_anchor,
|
||||
DrapeGui::GetGuiTextFont(), tex, result);
|
||||
DrapeGui::GetGuiTextFont(), tex, result);
|
||||
|
||||
dp::AttributeProvider provider(1 /*stream count*/, static_cast<uint32_t>(result.m_buffer.size()));
|
||||
provider.InitStream(0 /*stream index*/, StaticLabel::Vertex::GetBindingInfo(),
|
||||
make_ref(result.m_buffer.data()));
|
||||
provider.InitStream(0 /*stream index*/, StaticLabel::Vertex::GetBindingInfo(), make_ref(result.m_buffer.data()));
|
||||
|
||||
auto const vertexCount = static_cast<uint32_t>(result.m_buffer.size());
|
||||
ASSERT(vertexCount % dp::Batcher::VertexPerQuad == 0, ());
|
||||
auto const indexCount = dp::Batcher::IndexPerQuad * vertexCount / dp::Batcher::VertexPerQuad;
|
||||
|
||||
drape_ptr<dp::OverlayHandle> handle = make_unique_dp<CopyrightHandle>(GuiHandleCopyright,
|
||||
tex, m_position.m_anchor,
|
||||
m_position.m_pixelPivot,
|
||||
std::move(glyphs));
|
||||
drape_ptr<dp::OverlayHandle> handle = make_unique_dp<CopyrightHandle>(GuiHandleCopyright, tex, m_position.m_anchor,
|
||||
m_position.m_pixelPivot, std::move(glyphs));
|
||||
|
||||
drape_ptr<ShapeRenderer> renderer = make_unique_dp<ShapeRenderer>();
|
||||
dp::Batcher batcher(indexCount, vertexCount);
|
||||
batcher.SetBatcherHash(static_cast<uint64_t>(df::BatcherBucket::Default));
|
||||
using namespace std::placeholders;
|
||||
dp::SessionGuard guard(context, batcher, std::bind(&ShapeRenderer::AddShape, renderer.get(), _1, _2));
|
||||
batcher.InsertListOfStrip(context, result.m_state, make_ref(&provider),
|
||||
std::move(handle), dp::Batcher::VertexPerQuad);
|
||||
batcher.InsertListOfStrip(context, result.m_state, make_ref(&provider), std::move(handle),
|
||||
dp::Batcher::VertexPerQuad);
|
||||
|
||||
return renderer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user