From ef574973d91c84077ec91c2263fe98398f00e058 Mon Sep 17 00:00:00 2001 From: Konstantin Pastbin Date: Sun, 9 Jun 2024 21:55:48 +0300 Subject: [PATCH] WIP [drape] Remove subways bg, add line casing Signed-off-by: Konstantin Pastbin --- drape_frontend/frontend_renderer.cpp | 2 +- drape_frontend/transit_scheme_builder.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp index 8f0861e488..baa73b3e56 100755 --- a/drape_frontend/frontend_renderer.cpp +++ b/drape_frontend/frontend_renderer.cpp @@ -1633,7 +1633,7 @@ void FrontendRenderer::RenderTransitSchemeLayer(ScreenBase const & modelView) { DEBUG_LABEL(m_context, "Transit Scheme"); m_context->Clear(dp::ClearBits::DepthBit, dp::kClearBitsStoreAll); - RenderTransitBackground(); + //RenderTransitBackground(); m_transitSchemeRenderer->RenderTransit(m_context, make_ref(m_gpuProgramManager), modelView, make_ref(m_postprocessRenderer), m_frameValues, make_ref(m_debugRectRenderer)); diff --git a/drape_frontend/transit_scheme_builder.cpp b/drape_frontend/transit_scheme_builder.cpp index 15c6ff5d8b..b28065a467 100644 --- a/drape_frontend/transit_scheme_builder.cpp +++ b/drape_frontend/transit_scheme_builder.cpp @@ -38,6 +38,7 @@ std::array constexpr kTransitLinesWidthInPixel = namespace { +float constexpr kCasingLineDepth = -1.0f; float constexpr kBaseLineDepth = 0.0f; float constexpr kDepthPerLine = 1.0f; float constexpr kBaseMarkerDepth = 300.0f; @@ -429,7 +430,7 @@ void TransitSchemeBuilder::GenerateLinesSubway(MwmSchemeData const & scheme, dp: shape.second.m_forwardLines.size() + shape.second.m_backwardLines.size(); float shapeOffset = -static_cast(linesCount / 2) * 2.0f - static_cast(linesCount % 2) + 1.0f; - size_t constexpr shapeOffsetIncrement = 2.0f; + float constexpr shapeOffsetIncrement = 2.0f; std::vector> coloredLines; @@ -450,6 +451,7 @@ void TransitSchemeBuilder::GenerateLinesSubway(MwmSchemeData const & scheme, dp: coloredLines.emplace_back(color, *it); } + auto const casingColor = dp::Color(255, 255, 255, 160); for (auto const & coloredLine : coloredLines) { auto const & colorConst = coloredLine.first; @@ -458,6 +460,8 @@ void TransitSchemeBuilder::GenerateLinesSubway(MwmSchemeData const & scheme, dp: GenerateLine(context, shape.second.m_polyline, scheme.m_pivot, colorConst, shapeOffset, kTransitLineHalfWidth, depth, batcher); + GenerateLine(context, shape.second.m_polyline, scheme.m_pivot, casingColor, shapeOffset, + kTransitLineHalfWidth + 0.5f, kCasingLineDepth, batcher); shapeOffset += shapeOffsetIncrement; } @@ -1127,8 +1131,7 @@ void TransitSchemeBuilder::GenerateLine(ref_ptr context, using TV = TransitStaticVertex; TGeometryBuffer geometry; - auto const color = glsl::vec4(colorConst.GetRedF(), colorConst.GetGreenF(), colorConst.GetBlueF(), - 1.0f /* alpha */); + auto const color = glsl::vec4(colorConst.GetRedF(), colorConst.GetGreenF(), colorConst.GetBlueF(), colorConst.GetAlphaF()); size_t const kAverageSize = path.size() * 6; size_t const kAverageCapSize = 12; geometry.reserve(kAverageSize + kAverageCapSize * 2);