mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 05:43:37 +00:00
[drape] Remove subways bg, add line casing
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -1633,7 +1633,6 @@ void FrontendRenderer::RenderTransitSchemeLayer(ScreenBase const & modelView)
|
|||||||
{
|
{
|
||||||
DEBUG_LABEL(m_context, "Transit Scheme");
|
DEBUG_LABEL(m_context, "Transit Scheme");
|
||||||
m_context->Clear(dp::ClearBits::DepthBit, dp::kClearBitsStoreAll);
|
m_context->Clear(dp::ClearBits::DepthBit, dp::kClearBitsStoreAll);
|
||||||
RenderTransitBackground();
|
|
||||||
m_transitSchemeRenderer->RenderTransit(m_context, make_ref(m_gpuProgramManager), modelView,
|
m_transitSchemeRenderer->RenderTransit(m_context, make_ref(m_gpuProgramManager), modelView,
|
||||||
make_ref(m_postprocessRenderer), m_frameValues,
|
make_ref(m_postprocessRenderer), m_frameValues,
|
||||||
make_ref(m_debugRectRenderer));
|
make_ref(m_debugRectRenderer));
|
||||||
@@ -1675,6 +1674,8 @@ void FrontendRenderer::RenderTransitBackground()
|
|||||||
void FrontendRenderer::RenderRouteLayer(ScreenBase const & modelView)
|
void FrontendRenderer::RenderRouteLayer(ScreenBase const & modelView)
|
||||||
{
|
{
|
||||||
TRACE_SECTION("[drape] RenderRouteLayer");
|
TRACE_SECTION("[drape] RenderRouteLayer");
|
||||||
|
/// @todo(pastk): do we need the semi-opaque bg when routing via subway?
|
||||||
|
/// ref: https://github.com/organicmaps/organicmaps/pull/8431
|
||||||
if (HasTransitRouteData())
|
if (HasTransitRouteData())
|
||||||
RenderTransitBackground();
|
RenderTransitBackground();
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ namespace df
|
|||||||
{
|
{
|
||||||
int constexpr kTransitSchemeMinZoomLevel = 10;
|
int constexpr kTransitSchemeMinZoomLevel = 10;
|
||||||
float constexpr kTransitLineHalfWidth = 0.8f;
|
float constexpr kTransitLineHalfWidth = 0.8f;
|
||||||
|
float constexpr kTransitLineCasingHalfWidth = 0.5f;
|
||||||
std::array<float, 20> constexpr kTransitLinesWidthInPixel =
|
std::array<float, 20> constexpr kTransitLinesWidthInPixel =
|
||||||
{
|
{
|
||||||
// 1 2 3 4 5 6 7 8 9 10
|
// 1 2 3 4 5 6 7 8 9 10
|
||||||
@@ -38,6 +39,7 @@ std::array<float, 20> constexpr kTransitLinesWidthInPixel =
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
float constexpr kCasingLineDepth = -1.0f;
|
||||||
float constexpr kBaseLineDepth = 0.0f;
|
float constexpr kBaseLineDepth = 0.0f;
|
||||||
float constexpr kDepthPerLine = 1.0f;
|
float constexpr kDepthPerLine = 1.0f;
|
||||||
float constexpr kBaseMarkerDepth = 300.0f;
|
float constexpr kBaseMarkerDepth = 300.0f;
|
||||||
@@ -57,6 +59,8 @@ std::string const kTransitMarkTextOutline = "TransitMarkPrimaryTextOutline";
|
|||||||
std::string const kTransitTransferOuterColor = "TransitTransferOuterMarker";
|
std::string const kTransitTransferOuterColor = "TransitTransferOuterMarker";
|
||||||
std::string const kTransitTransferInnerColor = "TransitTransferInnerMarker";
|
std::string const kTransitTransferInnerColor = "TransitTransferInnerMarker";
|
||||||
std::string const kTransitStopInnerColor = "TransitStopInnerMarker";
|
std::string const kTransitStopInnerColor = "TransitStopInnerMarker";
|
||||||
|
/// @todo(pastk): make the casing color configurable in styles.
|
||||||
|
auto const kCasingColor = dp::Color(255, 255, 255, 140);
|
||||||
|
|
||||||
float constexpr kTransitMarkTextSize = 11.0f;
|
float constexpr kTransitMarkTextSize = 11.0f;
|
||||||
|
|
||||||
@@ -429,7 +433,7 @@ void TransitSchemeBuilder::GenerateLinesSubway(MwmSchemeData const & scheme, dp:
|
|||||||
shape.second.m_forwardLines.size() + shape.second.m_backwardLines.size();
|
shape.second.m_forwardLines.size() + shape.second.m_backwardLines.size();
|
||||||
float shapeOffset =
|
float shapeOffset =
|
||||||
-static_cast<float>(linesCount / 2) * 2.0f - static_cast<float>(linesCount % 2) + 1.0f;
|
-static_cast<float>(linesCount / 2) * 2.0f - static_cast<float>(linesCount % 2) + 1.0f;
|
||||||
size_t constexpr shapeOffsetIncrement = 2.0f;
|
float constexpr shapeOffsetIncrement = 2.0f;
|
||||||
|
|
||||||
std::vector<std::pair<dp::Color, routing::transit::LineId>> coloredLines;
|
std::vector<std::pair<dp::Color, routing::transit::LineId>> coloredLines;
|
||||||
|
|
||||||
@@ -458,6 +462,8 @@ void TransitSchemeBuilder::GenerateLinesSubway(MwmSchemeData const & scheme, dp:
|
|||||||
|
|
||||||
GenerateLine(context, shape.second.m_polyline, scheme.m_pivot, colorConst, shapeOffset,
|
GenerateLine(context, shape.second.m_polyline, scheme.m_pivot, colorConst, shapeOffset,
|
||||||
kTransitLineHalfWidth, depth, batcher);
|
kTransitLineHalfWidth, depth, batcher);
|
||||||
|
GenerateLine(context, shape.second.m_polyline, scheme.m_pivot, kCasingColor, shapeOffset,
|
||||||
|
kTransitLineHalfWidth + kTransitLineCasingHalfWidth, kCasingLineDepth, batcher);
|
||||||
|
|
||||||
shapeOffset += shapeOffsetIncrement;
|
shapeOffset += shapeOffsetIncrement;
|
||||||
}
|
}
|
||||||
@@ -1127,8 +1133,7 @@ void TransitSchemeBuilder::GenerateLine(ref_ptr<dp::GraphicsContext> context,
|
|||||||
using TV = TransitStaticVertex;
|
using TV = TransitStaticVertex;
|
||||||
|
|
||||||
TGeometryBuffer geometry;
|
TGeometryBuffer geometry;
|
||||||
auto const color = glsl::vec4(colorConst.GetRedF(), colorConst.GetGreenF(), colorConst.GetBlueF(),
|
auto const color = glsl::vec4(colorConst.GetRedF(), colorConst.GetGreenF(), colorConst.GetBlueF(), colorConst.GetAlphaF());
|
||||||
1.0f /* alpha */);
|
|
||||||
size_t const kAverageSize = path.size() * 6;
|
size_t const kAverageSize = path.size() * 6;
|
||||||
size_t const kAverageCapSize = 12;
|
size_t const kAverageCapSize = 12;
|
||||||
geometry.reserve(kAverageSize + kAverageCapSize * 2);
|
geometry.reserve(kAverageSize + kAverageCapSize * 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user