Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)

To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
This commit is contained in:
Konstantin Pastbin
2025-04-13 16:37:30 +07:00
commit e3e4a1985a
12931 changed files with 13195100 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#include "drape_frontend/overlay_batcher.hpp"
#include "drape_frontend/map_shape.hpp"
#include "drape/batcher.hpp"
#include "drape/render_bucket.hpp"
#include "drape/texture_manager.hpp"
namespace df
{
uint32_t const kOverlayIndexBufferSize = 30000;
uint32_t const kOverlayVertexBufferSize = 20000;
OverlayBatcher::OverlayBatcher(TileKey const & key)
: m_batcher(kOverlayIndexBufferSize, kOverlayVertexBufferSize)
{
int const kAverageRenderDataCount = 5;
m_data.reserve(kAverageRenderDataCount);
m_batcher.SetBatcherHash(key.GetHashValue(BatcherBucket::Overlay));
m_batcher.StartSession([this, key](dp::RenderState const & state, drape_ptr<dp::RenderBucket> && bucket)
{
FlushGeometry(key, state, std::move(bucket));
});
}
void OverlayBatcher::Batch(ref_ptr<dp::GraphicsContext> context, drape_ptr<MapShape> const & shape,
ref_ptr<dp::TextureManager> texMng)
{
m_batcher.SetFeatureMinZoom(shape->GetFeatureMinZoom());
shape->Draw(context, make_ref(&m_batcher), texMng);
}
void OverlayBatcher::Finish(ref_ptr<dp::GraphicsContext> context, TOverlaysRenderData & data)
{
m_batcher.EndSession(context);
data.swap(m_data);
}
void OverlayBatcher::FlushGeometry(TileKey const & key, dp::RenderState const & state,
drape_ptr<dp::RenderBucket> && bucket)
{
m_data.emplace_back(key, state, std::move(bucket));
}
} // namespace df