diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 19f3d74f77..1daf8687f0 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -190,9 +190,18 @@ TStatus Framework::GetCountryStatus(TIndex const & idx) const } /// @param[in] mask Active pointers bits : 0x0 - no, 0x1 - (x1, y1), 0x2 - (x2, y2), 0x3 - (x1, y1)(x2, y2). + +namespace +{ + int const MASK_NO_TOUCHES = 0x0; + int const MASK_FIRST_TOUCH = 0x1; + int const MASK_SECOND_TOUCH = 0x2; + int const MASK_BOTH_TOUCHES = 0x3; +} // namespace + void Framework::Touch(int action, int mask, double x1, double y1, double x2, double y2) { - if (mask == 0) + if (mask == MASK_NO_TOUCHES) return; MultiTouchAction eventType = static_cast(action); @@ -216,7 +225,7 @@ void Framework::Touch(int action, int mask, double x1, double y1, double x2, dou return; } - if (mask == 0x2) + if (mask == MASK_SECOND_TOUCH) { x1 = x2; y1 = y2; @@ -224,7 +233,7 @@ void Framework::Touch(int action, int mask, double x1, double y1, double x2, dou event.m_touches[0].m_location = m2::PointD(x1, y1); event.m_touches[0].m_id = 0; - if (mask == 0x3) + if (mask == MASK_BOTH_TOUCHES) { event.m_touches[1].m_location = m2::PointD(x2, y2); event.m_touches[1].m_id = 1; diff --git a/drape/glyph_manager.cpp b/drape/glyph_manager.cpp index b71ce7a63a..3ab6f7fd62 100644 --- a/drape/glyph_manager.cpp +++ b/drape/glyph_manager.cpp @@ -263,9 +263,6 @@ struct UnicodeBlock int GetFontOffset(int idx) const { - if (m_fontsWeight.empty()) - return -1; - ASSERT(!m_fontsWeight.empty(), ()); int maxWight = 0; int upperBoundWeight = numeric_limits::max(); diff --git a/drape_frontend/tile_tree.cpp b/drape_frontend/tile_tree.cpp index de10902657..d905f853f8 100755 --- a/drape_frontend/tile_tree.cpp +++ b/drape_frontend/tile_tree.cpp @@ -51,11 +51,6 @@ void TileTree::EndRequesting() SimplifyTree(); } -void TileTree::GetTilesCollection(TTilesCollection & tiles, int const zoomLevel) const -{ - FillTilesCollection(m_root, tiles, zoomLevel); -} - void TileTree::ClipByRect(m2::RectD const & rect) { ClipNode(m_root, rect); @@ -202,17 +197,6 @@ void TileTree::AbortTiles(TNodePtr const & node, int const zoomLevel) } } -void TileTree::FillTilesCollection(TNodePtr const & node, TTilesCollection & tiles, int const zoomLevel) const -{ - for (TNodePtr const & childNode : node->m_children) - { - if (childNode->m_tileStatus != TileStatus::Unknown && childNode->m_tileKey.m_zoomLevel == zoomLevel) - tiles.insert(childNode->m_tileKey); - - FillTilesCollection(childNode, tiles, zoomLevel); - } -} - void TileTree::ClipNode(TNodePtr const & node, m2::RectD const & rect) { for (auto it = node->m_children.begin(); it != node->m_children.end();) diff --git a/drape_frontend/tile_tree.hpp b/drape_frontend/tile_tree.hpp index f0a53e18a4..eadb0a1782 100755 --- a/drape_frontend/tile_tree.hpp +++ b/drape_frontend/tile_tree.hpp @@ -49,9 +49,6 @@ public: /// This method processes a message about finishing reading tiles on BR. void FinishTiles(TTilesCollection const & tiles, int const zoomLevel); - /// It returns actual tile collection to send to BR. - void GetTilesCollection(TTilesCollection & tiles, int const zoomLevel) const; - private: struct Node; using TNodePtr = unique_ptr; @@ -66,8 +63,6 @@ private: void ClipByRect(m2::RectD const & rect); - void FillTilesCollection(TNodePtr const & node, TTilesCollection & tiles, int const zoomLevel) const; - void ClipNode(TNodePtr const & node, m2::RectD const & rect); void CheckDeferredTiles(TNodePtr const & node); diff --git a/drape_frontend/user_event_stream.cpp b/drape_frontend/user_event_stream.cpp index 1735acb2c6..ec94e000ac 100644 --- a/drape_frontend/user_event_stream.cpp +++ b/drape_frontend/user_event_stream.cpp @@ -97,7 +97,7 @@ ScreenBase const & UserEventStream::ProcessEvents(bool & modelViewChange, bool & } } - if (m_state == STATE_TAP_DETECTION && m_validPointersCount == 1) + if (m_state == STATE_TAP_DETECTION && m_validTouchesCount == 1) DetectLongTap(m_touches[0]); return m_navigator.Screen(); @@ -109,11 +109,6 @@ void UserEventStream::SetTapListener(TTapDetectedFn const & tapCallback, TSingle m_filterFn = filterFn; } -void UserEventStream::Clear() -{ - m_events.clear(); -} - void UserEventStream::SetCenter(m2::PointD const & center, int zoom) { m2::RectD rect = df::GetRectForDrawScale(zoom, center); @@ -299,7 +294,7 @@ void UserEventStream::TouchUp(array const & touches) void UserEventStream::UpdateTouches(array const & touches, size_t validCount) { m_touches = touches; - m_validPointersCount = validCount; + m_validTouchesCount = validCount; #ifdef DEBUG if (validCount > 0) ASSERT(m_touches[0].m_id != -1, ()); diff --git a/drape_frontend/user_event_stream.hpp b/drape_frontend/user_event_stream.hpp index 4e7b023316..51398cb4ca 100644 --- a/drape_frontend/user_event_stream.hpp +++ b/drape_frontend/user_event_stream.hpp @@ -20,7 +20,7 @@ namespace df struct Touch { m2::PointF m_location = m2::PointF::Zero(); - int m_id = -1; // if id == -1 than touch invalid + int m_id = -1; // if id == -1 then touch invalid }; struct TouchEvent @@ -157,7 +157,6 @@ public: #endif private: - void Clear(); void SetCenter(m2::PointD const & center, int zoom); void SetRect(m2::RectD rect, int zoom, bool applyRotation); void SetRect(m2::AnyRectD const & rect); @@ -208,7 +207,7 @@ private: } m_state; array m_touches; - size_t m_validPointersCount; + size_t m_validTouchesCount; #ifdef DEBUG TTestBridge m_testFn; diff --git a/map/framework.cpp b/map/framework.cpp index 463a1f949b..a71c7b4517 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -727,7 +727,7 @@ namespace double ScaleModeToFactor(Framework::EScaleMode mode) { - double factors[] = { 2.0, 1.5, 0.5, 0.67}; + double factors[] = { 2.0, 1.5, 0.5, 0.67 }; return factors[mode]; }