diff --git a/graphics/blitter.cpp b/graphics/blitter.cpp index 6b6b7d9233..3d33be28ff 100644 --- a/graphics/blitter.cpp +++ b/graphics/blitter.cpp @@ -28,8 +28,7 @@ namespace graphics void Blitter::blit(BlitInfo const * blitInfo, size_t s, - bool isSubPixel, - double depth) + bool isSubPixel) { vector geomPts(4 * s); vector texPts(4 * s); @@ -68,15 +67,18 @@ namespace graphics gl::Vertex * pointsData = (gl::Vertex*)storage.m_vertices->data(); - for (size_t i = 0; i < s * 4; ++i) + for (size_t i = 0; i < s; ++i) { - pointsData[i].pt.x = geomPts[i].x; - pointsData[i].pt.y = geomPts[i].y; - pointsData[i].depth = depth; - pointsData[i].tex.x = texPts[i].x; - pointsData[i].tex.y = texPts[i].y; - pointsData[i].normal.x = 0; - pointsData[i].normal.y = 0; + for (size_t j = i * 4; j < (i + 1) * 4; ++j) + { + pointsData[j].pt.x = geomPts[j].x; + pointsData[j].pt.y = geomPts[j].y; + pointsData[j].depth = blitInfo[i].m_depth; + pointsData[j].tex.x = texPts[j].x; + pointsData[j].tex.y = texPts[j].y; + pointsData[j].normal.x = 0; + pointsData[j].normal.y = 0; + } // pointsData[i].color = graphics::Color(255, 255, 255, 255); } diff --git a/graphics/blitter.hpp b/graphics/blitter.hpp index b4fa7f45ba..d459791d99 100644 --- a/graphics/blitter.hpp +++ b/graphics/blitter.hpp @@ -28,6 +28,7 @@ namespace graphics math::Matrix m_matrix; m2::RectI m_srcRect; m2::RectU m_texRect; + double m_depth; }; class Blitter : public GeometryBatcher @@ -54,8 +55,7 @@ namespace graphics void blit(BlitInfo const * blitInfo, size_t s, - bool isSubPixel, - double depth); + bool isSubPixel); /// @} }; } diff --git a/map/coverage_generator.cpp b/map/coverage_generator.cpp index 87d2e84780..6a29394171 100644 --- a/map/coverage_generator.cpp +++ b/map/coverage_generator.cpp @@ -480,13 +480,10 @@ bool CoverageGenerator::CacheCoverage(core::CommandsQueue::Environment const & e m_cacheScreen->setDisplayList(m_backCoverage->m_mainElements); vector infos; + infos.reserve(m_coverageInfo.m_tiles.size()); - for (CoverageInfo::TTileSet::const_iterator it = m_coverageInfo.m_tiles.begin(); - it != m_coverageInfo.m_tiles.end(); - ++it) + for (Tile const * tile : m_coverageInfo.m_tiles) { - Tile const * tile = *it; - size_t tileWidth = tile->m_renderTarget->width(); size_t tileHeight = tile->m_renderTarget->height(); @@ -496,12 +493,15 @@ bool CoverageGenerator::CacheCoverage(core::CommandsQueue::Environment const & e bi.m_srcRect = m2::RectI(0, 0, tileWidth - 2, tileHeight - 2); bi.m_texRect = m2::RectU(1, 1, tileWidth - 1, tileHeight - 1); bi.m_srcSurface = tile->m_renderTarget; + bi.m_depth = tile->m_rectInfo.m_tileScale * 100; infos.push_back(bi); } if (!infos.empty()) - m_cacheScreen->blit(&infos[0], infos.size(), true, graphics::minDepth); + m_cacheScreen->blit(infos.data(), infos.size(), true); + + m_cacheScreen->clear(graphics::Color(), false); math::Matrix idM = math::Identity(); diff --git a/map/yopme_render_policy.cpp b/map/yopme_render_policy.cpp index 5003c76801..84ce6d1bbf 100644 --- a/map/yopme_render_policy.cpp +++ b/map/yopme_render_policy.cpp @@ -239,12 +239,13 @@ void YopmeRP::DrawFrame(shared_ptr const & e, ScreenBase const & s) info.m_srcRect = m2::RectI(0, 0, width, height); info.m_texRect = m2::RectU(0, 0, width, height); info.m_matrix = math::Identity(); + info.m_depth = minDepth; pScreen->beginFrame(); pScreen->clear(m_bgColor); pScreen->applyBlitStates(); - pScreen->blit(&info, 1, true, minDepth); + pScreen->blit(&info, 1, true); pScreen->clear(m_bgColor, false); if (m_drawMyPosition)