From 24ad732af8eaa584b38525494d1c88b6bf55c2d0 Mon Sep 17 00:00:00 2001 From: Daria Volvenkova Date: Tue, 28 Nov 2017 13:35:45 +0300 Subject: [PATCH] Review fixes. --- drape_frontend/frontend_renderer.cpp | 2 ++ drape_frontend/user_mark_shapes.cpp | 4 ++-- map/transit/transit_display.cpp | 10 +++++----- map/transit/transit_display.hpp | 2 +- map/user_mark.hpp | 8 ++++---- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp index 6527214c36..363c5e239c 100755 --- a/drape_frontend/frontend_renderer.cpp +++ b/drape_frontend/frontend_renderer.cpp @@ -1314,6 +1314,7 @@ void FrontendRenderer::RenderTrafficLayer(ScreenBase const & modelView) m_trafficRenderer->RenderTraffic(modelView, m_currentZoomLevel, 1.0f /* opacity */, make_ref(m_gpuProgramManager), m_generalUniforms); } + GLFunctions::glDisable(gl_const::GLDepthTest); } void FrontendRenderer::RenderRouteLayer(ScreenBase const & modelView) @@ -1322,6 +1323,7 @@ void FrontendRenderer::RenderRouteLayer(ScreenBase const & modelView) GLFunctions::glEnable(gl_const::GLDepthTest); m_routeRenderer->RenderRoute(modelView, m_trafficRenderer->HasRenderData(), make_ref(m_gpuProgramManager), m_generalUniforms); + GLFunctions::glDisable(gl_const::GLDepthTest); } void FrontendRenderer::RenderUserMarksLayer(ScreenBase const & modelView, RenderState::DepthLayer layerId) diff --git a/drape_frontend/user_mark_shapes.cpp b/drape_frontend/user_mark_shapes.cpp index d7b3d71d4c..ad5b8c17b8 100644 --- a/drape_frontend/user_mark_shapes.cpp +++ b/drape_frontend/user_mark_shapes.cpp @@ -204,8 +204,8 @@ void CacheUserMarks(TileKey const & tileKey, ref_ptr texture if (!symbolName.empty()) { textures->GetSymbolRegion(symbolName, region); - symbolSize.x = max(region.GetPixelSize().x, symbolSize.x); - symbolSize.y = max(region.GetPixelSize().y, symbolSize.y); + symbolSize.x = std::max(region.GetPixelSize().x, symbolSize.x); + symbolSize.y = std::max(region.GetPixelSize().y, symbolSize.y); } if (renderInfo.m_titleDecl != nullptr && renderInfo.m_minTitleZoom <= tileKey.m_zoomLevel) diff --git a/map/transit/transit_display.cpp b/map/transit/transit_display.cpp index ac0b8b3d49..78c0b77ee2 100644 --- a/map/transit/transit_display.cpp +++ b/map/transit/transit_display.cpp @@ -376,7 +376,7 @@ void TransitRouteDisplay::ProcessSubroute(vector const & segments, strings::EndsWith(symbolName, "-m") || strings::EndsWith(symbolName, "-l")) { - symbolName = symbolName.substr(0, symbolName.length() - 2); + symbolName = symbolName.substr(0, symbolName.rfind('-')); } gateMarkInfo.m_featureId = fid; @@ -481,7 +481,7 @@ void TransitRouteDisplay::CreateTransitMarks(std::vector const symbolNames[kMediumIconZoom] = mark.m_symbolName + "-m"; symbolNames[kLargeIconZoom] = mark.m_symbolName + "-l"; transitMark->SetSymbolNames(symbolNames); - transitMark->SetPriority(UserMark::Priority::Transit_Gate); + transitMark->SetPriority(UserMark::Priority::TransitGate); } else if (mark.m_type == TransitMarkInfo::Type::Transfer) { @@ -514,7 +514,7 @@ void TransitRouteDisplay::CreateTransitMarks(std::vector const coloredSymbol.insert(make_pair(zoomLevel, params)); } transitMark->SetColoredSymbols(coloredSymbol); - transitMark->SetPriority(UserMark::Priority::Transit_Transfer); + transitMark->SetPriority(UserMark::Priority::TransitTransfer); } else { @@ -553,7 +553,7 @@ void TransitRouteDisplay::CreateTransitMarks(std::vector const coloredSymbol[kLargeIconZoom] = params; transitMark->SetColoredSymbols(coloredSymbol); - transitMark->SetPriority(UserMark::Priority::Transit_KeyStop); + transitMark->SetPriority(UserMark::Priority::TransitKeyStop); } else { @@ -569,7 +569,7 @@ void TransitRouteDisplay::CreateTransitMarks(std::vector const coloredSymbol.insert(make_pair(zoomLevel, params)); } transitMark->SetColoredSymbols(coloredSymbol); - transitMark->SetPriority(UserMark::Priority::Transit_Stop); + transitMark->SetPriority(UserMark::Priority::TransitStop); transitMark->SetMinTitleZoom(kMinStopTitleZoom); } } diff --git a/map/transit/transit_display.hpp b/map/transit/transit_display.hpp index 1ec1242dd4..12cfb635c9 100644 --- a/map/transit/transit_display.hpp +++ b/map/transit/transit_display.hpp @@ -126,4 +126,4 @@ private: TransitRouteInfo m_routeInfo; int m_subrouteIndex = 0; -}; \ No newline at end of file +}; diff --git a/map/user_mark.hpp b/map/user_mark.hpp index 1e739b3785..55af91fff7 100644 --- a/map/user_mark.hpp +++ b/map/user_mark.hpp @@ -21,10 +21,10 @@ public: enum class Priority: uint16_t { Default = 0, - Transit_Stop, - Transit_Gate, - Transit_Transfer, - Transit_KeyStop + TransitStop, + TransitGate, + TransitTransfer, + TransitKeyStop }; enum class Type