diff --git a/drape_frontend/drape_engine.cpp b/drape_frontend/drape_engine.cpp index faea275bb6..c52ef805bd 100644 --- a/drape_frontend/drape_engine.cpp +++ b/drape_frontend/drape_engine.cpp @@ -861,6 +861,7 @@ drape_ptr DrapeEngine::GenerateMarkRenderInfo(UserPointMar renderInfo->m_index = mark->GetIndex(); renderInfo->m_featureId = mark->GetFeatureID(); renderInfo->m_hasCreationAnimation = mark->HasCreationAnimation(); + renderInfo->m_isMarkAboveText = mark->IsMarkAboveText(); return renderInfo; } diff --git a/drape_frontend/user_mark_shapes.cpp b/drape_frontend/user_mark_shapes.cpp index e02ee9e672..fd7d2e341d 100644 --- a/drape_frontend/user_mark_shapes.cpp +++ b/drape_frontend/user_mark_shapes.cpp @@ -334,14 +334,8 @@ void CacheUserMarks(ref_ptr context, TileKey const & tileKe UserMarksRenderCollection & renderParams, dp::Batcher & batcher) { using UPV = UserPointVertex; - size_t const vertexCount = marksId.size() * dp::Batcher::VertexPerQuad; - buffer_vector buffer; - bool isAnimated = false; + buffer_vector buffer; - dp::TextureManager::SymbolRegion region; - dp::TextureManager::SymbolRegion backgroundRegion; - DepthLayer depthLayer = DepthLayer::UserMarkLayer; - bool depthTestEnabled = true; for (auto const id : marksId) { auto const it = renderParams.find(id); @@ -353,8 +347,6 @@ void CacheUserMarks(ref_ptr context, TileKey const & tileKe continue; m2::PointD const tileCenter = tileKey.GetGlobalRect().Center(); - depthLayer = renderInfo.m_depthLayer; - depthTestEnabled = renderInfo.m_depthTestEnabled; m2::PointF symbolSize(0.0f, 0.0f); m2::PointF symbolOffset(0.0f, 0.0f); @@ -380,8 +372,10 @@ void CacheUserMarks(ref_ptr context, TileKey const & tileKe } else if (renderInfo.m_symbolNames != nullptr) { - buffer.reserve(vertexCount); + dp::TextureManager::SymbolRegion region; + dp::TextureManager::SymbolRegion backgroundRegion; + buffer.clear(); textures->GetSymbolRegion(symbolName, region); auto const backgroundSymbol = GetBackgroundForSymbol(symbolName, textures); if (!backgroundSymbol.empty()) @@ -395,7 +389,6 @@ void CacheUserMarks(ref_ptr context, TileKey const & tileKe kShapeCoordScalar); glsl::vec3 const pos = glsl::vec3(glsl::ToVec2(pt), renderInfo.m_depth); bool const runAnim = renderInfo.m_hasCreationAnimation && renderInfo.m_justCreated; - isAnimated |= runAnim; glsl::vec2 left, right, up, down; AlignHorizontal(pxSize.x * 0.5f, anchor, left, right); @@ -420,10 +413,38 @@ void CacheUserMarks(ref_ptr context, TileKey const & tileKe buffer.emplace_back(pos, right + up, glsl::ToVec4(m2::PointD(texRect.RightBottom()), m2::PointD(bgTexRect.RightBottom())), colorAndAnimate); + + gpu::Program program; + gpu::Program program3d; + if (renderInfo.m_isMarkAboveText) + { + program = runAnim ? gpu::Program::BookmarkAnimAboveText + : gpu::Program::BookmarkAboveText; + program3d = runAnim ? gpu::Program::BookmarkAnimAboveTextBillboard + : gpu::Program::BookmarkAboveTextBillboard; + } + else + { + program = runAnim ? gpu::Program::BookmarkAnim + : gpu::Program::Bookmark; + program3d = runAnim ? gpu::Program::BookmarkAnimBillboard + : gpu::Program::BookmarkBillboard; + } + auto state = CreateRenderState(program, renderInfo.m_depthLayer); + state.SetProgram3d(program3d); + state.SetColorTexture(region.GetTexture()); + state.SetTextureFilter(dp::TextureFilter::Nearest); + state.SetDepthTestEnabled(renderInfo.m_depthTestEnabled); + + dp::AttributeProvider attribProvider(1, static_cast(buffer.size())); + attribProvider.InitStream(0, UPV::GetBinding(), make_ref(buffer.data())); + + batcher.InsertListOfStrip(context, state, make_ref(&attribProvider), dp::Batcher::VertexPerQuad); } if (!symbolName.empty()) { + dp::TextureManager::SymbolRegion region; textures->GetSymbolRegion(symbolName, region); symbolSize.x = std::max(region.GetPixelSize().x, symbolSize.x); symbolSize.y = std::max(region.GetPixelSize().y, symbolSize.y); @@ -449,22 +470,6 @@ void CacheUserMarks(ref_ptr context, TileKey const & tileKe renderInfo.m_justCreated = false; } - - if (!buffer.empty()) - { - auto state = CreateRenderState(isAnimated ? gpu::Program::BookmarkAnim - : gpu::Program::Bookmark, depthLayer); - state.SetProgram3d(isAnimated ? gpu::Program::BookmarkAnimBillboard - : gpu::Program::BookmarkBillboard); - state.SetColorTexture(region.GetTexture()); - state.SetTextureFilter(dp::TextureFilter::Nearest); - state.SetDepthTestEnabled(depthTestEnabled); - - dp::AttributeProvider attribProvider(1, static_cast(buffer.size())); - attribProvider.InitStream(0, UPV::GetBinding(), make_ref(buffer.data())); - - batcher.InsertListOfStrip(context, state, make_ref(&attribProvider), dp::Batcher::VertexPerQuad); - } } void ProcessSplineSegmentRects(m2::SharedSpline const & spline, double maxSegmentLength, diff --git a/drape_frontend/user_mark_shapes.hpp b/drape_frontend/user_mark_shapes.hpp index f13ec6737a..432942fda9 100644 --- a/drape_frontend/user_mark_shapes.hpp +++ b/drape_frontend/user_mark_shapes.hpp @@ -38,6 +38,7 @@ struct UserMarkRenderParams bool m_justCreated = false; bool m_isVisible = true; FeatureID m_featureId; + bool m_isMarkAboveText = false; }; struct LineLayer diff --git a/drape_frontend/user_marks_provider.hpp b/drape_frontend/user_marks_provider.hpp index 31a6bf3a3b..edc5866ef7 100644 --- a/drape_frontend/user_marks_provider.hpp +++ b/drape_frontend/user_marks_provider.hpp @@ -79,6 +79,7 @@ public: virtual FeatureID GetFeatureID() const = 0; virtual bool HasCreationAnimation() const = 0; virtual df::ColorConstant GetColorConstant() const = 0; + virtual bool IsMarkAboveText() const = 0; private: kml::MarkId m_id; diff --git a/map/framework.cpp b/map/framework.cpp index 4572e2a274..bac43df5fb 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -1709,15 +1709,9 @@ void Framework::FillSearchResultsMarks(search::Results::ConstIter begin, { auto product = GetProductInfo(r); auto const type = r.GetFeatureType(); + mark->SetFromType(type, m_localAdsManager.Contains(r.GetFeatureID())); if (product.m_ugcRating != search::ProductInfo::kInvalidRating) - { - mark->SetUGCType(); mark->SetRating(product.m_ugcRating); - } - else - { - mark->SetFromType(type, m_localAdsManager.Contains(r.GetFeatureID())); - } } if (fn) diff --git a/map/search_mark.cpp b/map/search_mark.cpp index 3a47cfe8bb..2cd9928346 100644 --- a/map/search_mark.cpp +++ b/map/search_mark.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace { @@ -19,7 +20,6 @@ enum class SearchMarkType { Default = 0, Booking, - UGC, Cafe, Bakery, Bar, @@ -66,7 +66,6 @@ SearchMarkType SMT(uint8_t type) std::array(SearchMarkType::Count)> const kSymbols = { "search-result", // Default. "coloredmark-default-l", // Booking. - "coloredmark-default-l", // UGC. "search-result-cafe", // Cafe. "search-result-bakery", // Bakery. "search-result-bar", // Bar. @@ -101,14 +100,17 @@ std::array(SearchMarkType::Count)> const kSymbo "non-found-search-result", // NotFound. }; -std::string const kSaleBadgeName = "searchbooking-sale-1"; +std::string const kSaleBadgeName = "search-badge-booking-sale"; +std::string const kUGCRatingBadgeName = "search-badge-rating"; +std::string const kRatedDefaultSearchIcon = "rated-default-search-result"; +std::string const kLocalAdsRatedDefaultSearchIcon = "local_ads-rated-default-search-result"; float const kRatingThreshold = 6.0f; float const kMetricThreshold = 0.38f; -inline bool HasNoRating(float rating) +inline bool HasRating(float rating) { - return fabs(rating) < 1e-5; + return rating > kInvalidRatingValue; } float CalculateAggregateMetric(float rating, int pricing) @@ -126,7 +128,7 @@ std::string GetBookingBadgeName(int pricing) if (pricing == 0) return {}; - return std::string("searchbooking-ext-") + strings::to_string(pricing); + return std::string("search-badge-booking-ext-") + strings::to_string(pricing); } bool NeedShowBookingBadge(float rating, int pricing) @@ -145,8 +147,11 @@ std::string GetBookingSmallIcon(SearchMarkType type, bool hasLocalAds) return hasLocalAds ? "search-adv" : "coloredmark-default-s"; } -std::string GetSymbol(SearchMarkType searchMarkType, bool hasLocalAds) +std::string GetSymbol(SearchMarkType searchMarkType, bool hasLocalAds, bool isRated) { + if (searchMarkType == SearchMarkType::Default && isRated) + return hasLocalAds ? kLocalAdsRatedDefaultSearchIcon : kRatedDefaultSearchIcon; + auto const index = static_cast(searchMarkType); ASSERT_LESS(index, kSymbols.size(), ()); if (!hasLocalAds) @@ -160,28 +165,26 @@ std::string GetSymbol(SearchMarkType searchMarkType, bool hasLocalAds) bool HasLocalAdsVariant(SearchMarkType searchMarkType) { - if (searchMarkType == SearchMarkType::UGC || searchMarkType == SearchMarkType::NotFound) + if (searchMarkType == SearchMarkType::NotFound) return false; return true; } -std::string GetPreparingSymbol(SearchMarkType searchMarkType, bool hasLocalAds) +std::string GetPreparingSymbol(SearchMarkType searchMarkType, bool hasLocalAds, bool isRated) { - if (!hasLocalAds && - (searchMarkType == SearchMarkType::Booking || searchMarkType == SearchMarkType::UGC)) - { + if (!hasLocalAds && searchMarkType == SearchMarkType::Booking) return "coloredmark-inactive"; - } - return GetSymbol(searchMarkType, hasLocalAds); + return GetSymbol(searchMarkType, hasLocalAds, isRated); } -m2::PointD GetSize(SearchMarkType searchMarkType, bool hasLocalAds, ScreenBase const & modelView) +m2::PointD GetSize(SearchMarkType searchMarkType, bool hasLocalAds, bool isRated, + ScreenBase const & modelView) { if (!SearchMarks::HaveSizes()) return {}; auto const pixelSize = - SearchMarks::GetSize(GetSymbol(searchMarkType, hasLocalAds)).get_value_or({}); + SearchMarks::GetSize(GetSymbol(searchMarkType, hasLocalAds, isRated)).get_value_or({}); double const pixelToMercator = modelView.GetScale(); return {pixelToMercator * pixelSize.x, pixelToMercator * pixelSize.y}; } @@ -272,27 +275,37 @@ SearchMarkPoint::SearchMarkPoint(m2::PointD const & ptOrg) m_titleDecl.m_primaryTextFont.m_color = df::GetColorConstant("RatingText"); m_titleDecl.m_primaryTextFont.m_size = static_cast(12.0 / df::VisualParams::Instance().GetFontScale()); + + m_ugcTitleDecl.m_anchor = dp::LeftTop; + m_ugcTitleDecl.m_primaryTextFont.m_color = df::GetColorConstant("UGCRatingText"); + m_ugcTitleDecl.m_primaryTextFont.m_size = + static_cast(14.0 / df::VisualParams::Instance().GetFontScale()); } -drape_ptr SearchMarkPoint::GetSymbolNames() const +std::string SearchMarkPoint::GetSymbolName() const { std::string name; if (m_type >= static_cast(SearchMarkType::Count)) { ASSERT(false, ("Unknown search mark symbol.")); - name = GetSymbol(SearchMarkType::Default, false /* hasLocalAds */); + name = GetSymbol(SearchMarkType::Default, false /* hasLocalAds */, HasRating(m_rating)); } else if (m_isPreparing) { - name = GetPreparingSymbol(SMT(m_type), m_hasLocalAds); + name = GetPreparingSymbol(SMT(m_type), m_hasLocalAds, HasRating(m_rating)); } else { - name = GetSymbol(SMT(m_type), m_hasLocalAds); + name = GetSymbol(SMT(m_type), m_hasLocalAds, HasRating(m_rating)); } + return name; +} +drape_ptr SearchMarkPoint::GetSymbolNames() const +{ + auto const name = GetSymbolName(); auto symbol = make_unique_dp(); - if (IsMarkWithRating()) + if (IsBookingSpecialMark()) { symbol->insert(std::make_pair( 1 /* zoomLevel */, @@ -308,52 +321,69 @@ drape_ptr SearchMarkPoint::GetSymbolNames drape_ptr SearchMarkPoint::GetBadgeNames() const { - if (!IsBookingSpecialMark()) + auto const badgeName = GetBadgeName(); + if (badgeName.empty()) return nullptr; - - auto const badgeName = m_hasSale ? kSaleBadgeName : GetBookingBadgeName(m_pricing); - if (badgeName.empty() || !SearchMarks::GetSize(badgeName)) - return nullptr; - - auto symbol = make_unique_dp(); - if (NeedShowBookingBadge(m_rating, m_pricing) && m_rating >= kRatingThreshold) + + if (IsBookingSpecialMark()) + { + auto symbol = make_unique_dp(); + if (NeedShowBookingBadge(m_rating, m_pricing) && m_rating >= kRatingThreshold) + symbol->insert(std::make_pair(10 /* zoomLevel */, badgeName)); + else + symbol->insert(std::make_pair(17 /* zoomLevel */, badgeName)); + return symbol; + } + + if (IsUGCMark()) + { + auto symbol = make_unique_dp(); symbol->insert(std::make_pair(10 /* zoomLevel */, badgeName)); - else - symbol->insert(std::make_pair(17 /* zoomLevel */, badgeName)); - return symbol; + return symbol; + } + + return nullptr; } drape_ptr SearchMarkPoint::GetSymbolOffsets() const { - if (!IsBookingSpecialMark()) + auto const badgeName = GetBadgeName(); + if (badgeName.empty()) return nullptr; - auto const badgeName = m_hasSale ? kSaleBadgeName : GetBookingBadgeName(m_pricing); - if (badgeName.empty() || !SearchMarks::GetSize(badgeName)) - return nullptr; - - auto const name = GetSymbol(SearchMarkType::Booking, false /* hasLocalAds */); + auto const name = GetSymbolName(); auto const iconSz = SearchMarks::GetSize(name).get_value_or({}); + float horizontalOffset = 0.0f; + if (SMT(m_type) != SearchMarkType::Booking && m_hasLocalAds) + { + float constexpr kLocalAdsSymbolOffset = 0.4f; + horizontalOffset = kLocalAdsSymbolOffset; + } SymbolOffsets offsets(scales::UPPER_STYLE_SCALE); for (size_t i = 0; i < offsets.size(); i++) { auto const badgeSz = SearchMarks::GetSize(badgeName).get_value_or({}); - offsets[i] = {0.5f * static_cast(badgeSz.x - iconSz.x), 0.0}; + offsets[i] = {(0.5f + horizontalOffset) * static_cast(badgeSz.x - iconSz.x), 0.0}; } return make_unique_dp(offsets); } +bool SearchMarkPoint::IsMarkAboveText() const +{ + return !IsBookingSpecialMark(); +} + df::ColorConstant SearchMarkPoint::GetColorConstant() const { - if (!IsMarkWithRating()) + if (!IsBookingSpecialMark()) return {}; if (SMT(m_type) == SearchMarkType::Booking && m_hasLocalAds) return "RatingLocalAds"; - if (HasNoRating(m_rating)) + if (!HasRating(m_rating)) return "RatingNone"; if (m_rating < 2.0f) return "RatingHorrible"; @@ -368,17 +398,34 @@ df::ColorConstant SearchMarkPoint::GetColorConstant() const drape_ptr SearchMarkPoint::GetTitleDecl() const { - if (!IsMarkWithRating() || fabs(m_rating) < 1e-5) + auto const isUGC = IsUGCMark(); + if ((!IsBookingSpecialMark() && !isUGC) || !HasRating(m_rating)) return nullptr; auto titles = make_unique_dp(); - titles->push_back(m_titleDecl); + if (isUGC) + { + auto titleDecl = m_ugcTitleDecl; + auto const sz = SearchMarks::GetSize(GetSymbolName()); + if (!sz) + return nullptr; + auto constexpr kShadowOffset = 4.0; + auto const centerOffset = -0.5 * sz.get().y - kShadowOffset; + titleDecl.m_primaryOffset.y = + static_cast(centerOffset / df::VisualParams::Instance().GetVisualScale()) - + 0.5f * titleDecl.m_primaryTextFont.m_size; + titles->push_back(titleDecl); + } + else + { + titles->push_back(m_titleDecl); + } return titles; } int SearchMarkPoint::GetMinTitleZoom() const { - if (IsMarkWithRating() && m_rating < kRatingThreshold) + if (IsBookingSpecialMark() && m_rating < kRatingThreshold) return 17; return 1; } @@ -410,12 +457,6 @@ void SearchMarkPoint::SetBookingType(bool hasLocalAds) SetAttributeValue(m_type, static_cast(SearchMarkType::Booking)); } -void SearchMarkPoint::SetUGCType() -{ - SetAttributeValue(m_hasLocalAds, false); - SetAttributeValue(m_type, static_cast(SearchMarkType::UGC)); -} - void SearchMarkPoint::SetNotFoundType() { SetAttributeValue(m_hasLocalAds, false); @@ -431,6 +472,7 @@ void SearchMarkPoint::SetRating(float rating) { SetAttributeValue(m_rating, rating); m_titleDecl.m_primaryText = place_page::rating::GetRatingFormatted(rating); + m_ugcTitleDecl.m_primaryText = m_titleDecl.m_primaryText; } void SearchMarkPoint::SetPricing(int pricing) @@ -450,12 +492,21 @@ bool SearchMarkPoint::IsBookingSpecialMark() const bool SearchMarkPoint::IsUGCMark() const { - return SMT(m_type) == SearchMarkType::UGC; + return (SMT(m_type) != SearchMarkType::Booking) && HasRating(m_rating); } -bool SearchMarkPoint::IsMarkWithRating() const +std::string SearchMarkPoint::GetBadgeName() const { - return IsBookingSpecialMark() || IsUGCMark(); + std::string badgeName; + if (IsBookingSpecialMark()) + badgeName = m_hasSale ? kSaleBadgeName : GetBookingBadgeName(m_pricing); + else if (IsUGCMark()) + badgeName = kUGCRatingBadgeName; + + if (badgeName.empty() || !SearchMarks::GetSize(badgeName)) + return {}; + + return badgeName; } // static @@ -473,18 +524,24 @@ void SearchMarks::SetDrapeEngine(ref_ptr engine) std::vector symbols; auto const searchMarkTypesCount = static_cast(SearchMarkType::Count); - symbols.reserve(searchMarkTypesCount * 2); for (size_t t = 0; t < searchMarkTypesCount; ++t) { auto const searchMarkType = SMT(t); - symbols.push_back(GetSymbol(searchMarkType, false /* hasLocalAds */)); + symbols.emplace_back(GetSymbol(searchMarkType, false /* hasLocalAds */, false /* isRated */)); + symbols.emplace_back(GetSymbol(searchMarkType, false /* hasLocalAds */, true /* isRated */)); if (HasLocalAdsVariant(searchMarkType)) - symbols.push_back(GetSymbol(searchMarkType, true /* hasLocalAds */)); + { + symbols.emplace_back(GetSymbol(searchMarkType, true /* hasLocalAds */, false /* isRated */)); + symbols.emplace_back(GetSymbol(searchMarkType, true /* hasLocalAds */, true /* isRated */)); + } } for (int pricing = 1; pricing <= 3; pricing++) - symbols.push_back(GetBookingBadgeName(pricing)); - symbols.push_back(kSaleBadgeName); + symbols.emplace_back(GetBookingBadgeName(pricing)); + symbols.emplace_back(kSaleBadgeName); + symbols.emplace_back(kUGCRatingBadgeName); + + base::SortUnique(symbols); m_drapeEngine.SafeCall(&df::DrapeEngine::RequestSymbolsSize, symbols, [](std::map && sizes) @@ -504,16 +561,25 @@ void SearchMarks::SetBookmarkManager(BookmarkManager * bmManager) double SearchMarks::GetMaxDimension(ScreenBase const & modelView) const { double dimension = 0.0; + m2::PointD markSize; + auto measurer = [&dimension, &markSize](SearchMarkType searchMarkType, + bool hasLocalAds, + ScreenBase const & modelView) + { + for (size_t j = 0; j < 2; ++j) + { + markSize = ::GetSize(searchMarkType, true /* hasLocalAds */, + j > 0 /* isRated */, modelView); + dimension = std::max(dimension, std::max(markSize.x, markSize.y)); + } + }; + for (size_t i = 0; i < static_cast(SearchMarkType::Count); ++i) { auto const searchMarkType = SMT(i); - m2::PointD markSize = ::GetSize(searchMarkType, false /* hasLocalAds */, modelView); - dimension = std::max(dimension, std::max(markSize.x, markSize.y)); + measurer(searchMarkType, false /* hasLocalAds */, modelView); if (HasLocalAdsVariant(searchMarkType)) - { - markSize = ::GetSize(searchMarkType, true /* hasLocalAds */, modelView); - dimension = std::max(dimension, std::max(markSize.x, markSize.y)); - } + measurer(searchMarkType, true /* hasLocalAds */, modelView); } return dimension; } diff --git a/map/search_mark.hpp b/map/search_mark.hpp index 5ff40af62d..c014490698 100644 --- a/map/search_mark.hpp +++ b/map/search_mark.hpp @@ -32,6 +32,7 @@ public: drape_ptr GetBadgeNames() const override; drape_ptr GetSymbolOffsets() const override; bool GetDepthTestEnabled() const override { return false; } + bool IsMarkAboveText() const override; FeatureID GetFeatureID() const override { return m_featureID; } void SetFoundFeature(FeatureID const & feature); @@ -41,7 +42,6 @@ public: void SetFromType(uint32_t type, bool hasLocalAds); void SetBookingType(bool hasLocalAds); - void SetUGCType(); void SetNotFoundType(); void SetPreparing(bool isPreparing); @@ -61,7 +61,8 @@ protected: bool IsBookingSpecialMark() const; bool IsUGCMark() const; - bool IsMarkWithRating() const; + std::string GetSymbolName() const; + std::string GetBadgeName() const; uint8_t m_type = 0; bool m_hasLocalAds = false; @@ -73,6 +74,7 @@ protected: int m_pricing = 0; bool m_hasSale = false; dp::TitleDecl m_titleDecl; + dp::TitleDecl m_ugcTitleDecl; }; class SearchMarks diff --git a/map/user_mark.hpp b/map/user_mark.hpp index d4d9a2c448..4ca1194117 100644 --- a/map/user_mark.hpp +++ b/map/user_mark.hpp @@ -78,6 +78,7 @@ public: FeatureID GetFeatureID() const override { return FeatureID(); } bool HasCreationAnimation() const override { return false; } df::ColorConstant GetColorConstant() const override { return {}; } + bool IsMarkAboveText() const override { return false; } ms::LatLon GetLatLon() const; diff --git a/shaders/GL/shader_index.txt b/shaders/GL/shader_index.txt index a984dca95c..be8ba206ea 100644 --- a/shaders/GL/shader_index.txt +++ b/shaders/GL/shader_index.txt @@ -29,6 +29,8 @@ RouteDash route.vsh.glsl route_dash.fsh.glsl RouteArrow route_arrow.vsh.glsl route_arrow.fsh.glsl RouteMarker route_marker.vsh.glsl route_marker.fsh.glsl CirclePoint circle_point.vsh.glsl circle_point.fsh.glsl +BookmarkAboveText user_mark.vsh.glsl user_mark.fsh.glsl +BookmarkAnimAboveText user_mark.vsh.glsl user_mark.fsh.glsl DebugRect debug_rect.vsh.glsl debug_rect.fsh.glsl ScreenQuad screen_quad.vsh.glsl texturing.fsh.glsl Arrow3d arrow3d.vsh.glsl arrow3d.fsh.glsl @@ -39,6 +41,8 @@ TexturingBillboard texturing_billboard.vsh.glsl texturing.fsh.glsl MaskedTexturingBillboard masked_texturing_billboard.vsh.glsl masked_texturing.fsh.glsl BookmarkBillboard user_mark_billboard.vsh.glsl user_mark.fsh.glsl BookmarkAnimBillboard user_mark_billboard.vsh.glsl user_mark.fsh.glsl +BookmarkAboveTextBillboard user_mark_billboard.vsh.glsl user_mark.fsh.glsl +BookmarkAnimAboveTextBillboard user_mark_billboard.vsh.glsl user_mark.fsh.glsl TextOutlinedBillboard text_outlined_billboard.vsh.glsl text.fsh.glsl TextBillboard text_billboard.vsh.glsl text.fsh.glsl TextFixedBillboard text_billboard.vsh.glsl text_fixed.fsh.glsl diff --git a/shaders/metal_program_pool.mm b/shaders/metal_program_pool.mm index 4f0f92768c..1496643882 100644 --- a/shaders/metal_program_pool.mm +++ b/shaders/metal_program_pool.mm @@ -78,6 +78,8 @@ std::array(Program::ProgramsCount)> const kMeta ProgramInfo("vsRouteArrow", "fsRouteArrow", {{0, 2}}), // RouteArrow ProgramInfo("vsRouteMarker", "fsRouteMarker", {{0, 2}}), // RouteMarker ProgramInfo("vsCirclePoint", "fsCirclePoint", {{0, 0}, {1, 2}}), // CirclePoint + ProgramInfo("vsUserMark", "fsUserMark", {{0, 3}}), // BookmarkAboveText + ProgramInfo("vsUserMark", "fsUserMark", {{0, 3}}), // BookmarkAnimAboveText ProgramInfo("vsDebugRect", "fsDebugRect", {{0, 0}}), // DebugRect ProgramInfo("vsScreenQuad", "fsScreenQuad", {{0, 1}}), // ScreenQuad ProgramInfo("vsArrow3d", "fsArrow3d", {{0, 0}, {1, 1}}), // Arrow3d @@ -88,6 +90,8 @@ std::array(Program::ProgramsCount)> const kMeta ProgramInfo("vsMaskedTexturingBillboard", "fsMaskedTexturing", {{0, 3}}), // MaskedTexturingBillboard ProgramInfo("vsUserMarkBillboard", "fsUserMark", {{0, 3}}), // BookmarkBillboard ProgramInfo("vsUserMarkBillboard", "fsUserMark", {{0, 3}}), // BookmarkAnimBillboard + ProgramInfo("vsUserMarkBillboard", "fsUserMark", {{0, 3}}), // BookmarkAboveTextBillboard + ProgramInfo("vsUserMarkBillboard", "fsUserMark", {{0, 3}}), // BookmarkAnimAboveTextBillboard ProgramInfo("vsTextOutlinedBillboard", "fsText", {{0, 2}, {3, 4}}), // TextOutlinedBillboard ProgramInfo("vsTextBillboard", "fsText", {{0, 1}, {2, 3}}), // TextBillboard ProgramInfo("vsTextBollboard", "fsTextFixed", {{0, 1}, {2, 3}}), // TextFixedBillboard diff --git a/shaders/program_params.hpp b/shaders/program_params.hpp index 4ce73ebc0c..2e70898d55 100644 --- a/shaders/program_params.hpp +++ b/shaders/program_params.hpp @@ -89,7 +89,11 @@ struct MapProgramParams Program::TextOutlined, Program::TextOutlinedBillboard, Program::Texturing, - Program::TexturingBillboard) + Program::TexturingBillboard, + Program::BookmarkAboveText, + Program::BookmarkAnimAboveText, + Program::BookmarkAnimAboveTextBillboard, + Program::BookmarkAboveTextBillboard) } ALIGNMENT; struct RouteProgramParams diff --git a/shaders/programs.hpp b/shaders/programs.hpp index ca4fc30fec..3bf81b9805 100644 --- a/shaders/programs.hpp +++ b/shaders/programs.hpp @@ -40,6 +40,8 @@ enum class Program RouteArrow, RouteMarker, CirclePoint, + BookmarkAboveText, + BookmarkAnimAboveText, DebugRect, ScreenQuad, Arrow3d, @@ -50,6 +52,8 @@ enum class Program MaskedTexturingBillboard, BookmarkBillboard, BookmarkAnimBillboard, + BookmarkAboveTextBillboard, + BookmarkAnimAboveTextBillboard, TextOutlinedBillboard, TextBillboard, TextFixedBillboard, @@ -98,6 +102,8 @@ inline std::string DebugPrint(Program p) case Program::RouteArrow: return "RouteArrow"; case Program::RouteMarker: return "RouteMarker"; case Program::CirclePoint: return "CirclePoint"; + case Program::BookmarkAboveText: return "BookmarkAboveText"; + case Program::BookmarkAnimAboveText: return "BookmarkAnimAboveText"; case Program::DebugRect: return "DebugRect"; case Program::ScreenQuad: return "ScreenQuad"; case Program::Arrow3d: return "Arrow3d"; @@ -108,6 +114,8 @@ inline std::string DebugPrint(Program p) case Program::MaskedTexturingBillboard: return "MaskedTexturingBillboard"; case Program::BookmarkBillboard: return "BookmarkBillboard"; case Program::BookmarkAnimBillboard: return "BookmarkAnimBillboard"; + case Program::BookmarkAboveTextBillboard: return "BookmarkAboveTextBillboard"; + case Program::BookmarkAnimAboveTextBillboard: return "BookmarkAnimAboveTextBillboard"; case Program::TextOutlinedBillboard: return "TextOutlinedBillboard"; case Program::TextBillboard: return "TextBillboard"; case Program::TextFixedBillboard: return "TextFixedBillboard"; diff --git a/tools/unix/generate_symbols.sh b/tools/unix/generate_symbols.sh index 6a29392690..9a4cc225de 100755 --- a/tools/unix/generate_symbols.sh +++ b/tools/unix/generate_symbols.sh @@ -49,9 +49,9 @@ function BuildSkin() { echo "Building skin for $styleName/$resourceName" # Set environment STYLE_PATH="$DATA_PATH/styles/$styleType/style-$styleName" - PNG_PATH="$STYLE_PATH/symbols/png" + PNG_PATH="$STYLE_PATH/symbols$symbolsSuffix/png" rm -rf "$PNG_PATH" || true - ln -s "$STYLE_PATH/$resourceName" "$PNG_PATH" + ln -s "$STYLE_PATH/$resourceName$symbolsSuffix" "$PNG_PATH" # Run sking generator if [ $colorCorrection = "true" ]; then COLOR_CORR="--colorCorrection true"