Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2016-06-07 12:40:37 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-06-23 18:58:28 +0300
commitc50413ea557f9eae44d5d171171036f6b81892ff (patch)
tree701b791ff54cdd7abfd7669e0588374eab43bacd /drape_frontend
parent6911dc38b7913b4c7af70a38e89f4a26bc21d1bf (diff)
Review fixes.
Diffstat (limited to 'drape_frontend')
-rw-r--r--drape_frontend/animation/animation.hpp2
-rw-r--r--drape_frontend/animation/sequence_animation.cpp2
-rw-r--r--drape_frontend/animation/sequence_animation.hpp2
-rw-r--r--drape_frontend/animation_system.hpp22
-rw-r--r--drape_frontend/user_event_stream.cpp2
5 files changed, 7 insertions, 23 deletions
diff --git a/drape_frontend/animation/animation.hpp b/drape_frontend/animation/animation.hpp
index 8338f7688c..57c96764df 100644
--- a/drape_frontend/animation/animation.hpp
+++ b/drape_frontend/animation/animation.hpp
@@ -113,7 +113,7 @@ public:
virtual void Interrupt() { if (m_onInterruptAction != nullptr) m_onInterruptAction(this); }
virtual Type GetType() const = 0;
- virtual string const & GetCustomType() const { return ""; }
+ virtual string GetCustomType() const { return string(); }
virtual TAnimObjects const & GetObjects() const = 0;
virtual bool HasObject(TObject object) const = 0;
diff --git a/drape_frontend/animation/sequence_animation.cpp b/drape_frontend/animation/sequence_animation.cpp
index 3185e5bcfb..13ed1ad7a1 100644
--- a/drape_frontend/animation/sequence_animation.cpp
+++ b/drape_frontend/animation/sequence_animation.cpp
@@ -12,7 +12,7 @@ SequenceAnimation::SequenceAnimation()
{
}
-string const & SequenceAnimation::GetCustomType() const
+string SequenceAnimation::GetCustomType() const
{
return m_customType;
}
diff --git a/drape_frontend/animation/sequence_animation.hpp b/drape_frontend/animation/sequence_animation.hpp
index 9e58d573d5..0cffac5c15 100644
--- a/drape_frontend/animation/sequence_animation.hpp
+++ b/drape_frontend/animation/sequence_animation.hpp
@@ -20,7 +20,7 @@ public:
bool HasProperty(TObject object, TProperty property) const override;
bool HasTargetProperty(TObject object, TProperty property) const override;
- string const & GetCustomType() const override;
+ string GetCustomType() const override;
void SetCustomType(string const & type);
void SetMaxDuration(double maxDuration) override;
diff --git a/drape_frontend/animation_system.hpp b/drape_frontend/animation_system.hpp
index ce4c034d91..7a23337e1a 100644
--- a/drape_frontend/animation_system.hpp
+++ b/drape_frontend/animation_system.hpp
@@ -38,31 +38,15 @@ public:
void FinishAnimations(Animation::Type type, string const & customType, bool rewind, bool finishAll);
void FinishObjectAnimations(Animation::TObject object, bool rewind, bool finishAll);
- template<typename T> T const * FindAnimation(Animation::Type type) const
+ template<typename T> T const * FindAnimation(Animation::Type type, char const * customType = nullptr) const
{
for (auto & pList : m_animationChain)
{
auto & lst = *pList;
for (auto const & anim : lst)
{
- if (anim->GetType() == type)
- {
- ASSERT(dynamic_cast<T const *>(anim.get()) != nullptr, ());
- return static_cast<T const *>(anim.get());
- }
- }
- }
- return nullptr;
- }
-
- template<typename T> T const * FindAnimation(Animation::Type type, string const & customType) const
- {
- for (auto & pList : m_animationChain)
- {
- auto & lst = *pList;
- for (auto const & anim : lst)
- {
- if (anim->GetType() == type && anim->GetCustomType() == customType)
+ if ((anim->GetType() == type) &&
+ (customType == nullptr || strcmp(anim->GetCustomType().c_str(), customType) == 0))
{
ASSERT(dynamic_cast<T const *>(anim.get()) != nullptr, ());
return static_cast<T const *>(anim.get());
diff --git a/drape_frontend/user_event_stream.cpp b/drape_frontend/user_event_stream.cpp
index 4c17f3745b..0a7cdc687f 100644
--- a/drape_frontend/user_event_stream.cpp
+++ b/drape_frontend/user_event_stream.cpp
@@ -477,7 +477,7 @@ bool UserEventStream::InterruptFollowAnimations(bool force)
Animation const * followAnim = m_animationSystem.FindAnimation<MapFollowAnimation>(Animation::MapFollow);
if (followAnim == nullptr)
- followAnim = m_animationSystem.FindAnimation<SequenceAnimation>(Animation::Sequence, kPrettyFollowAnim);
+ followAnim = m_animationSystem.FindAnimation<SequenceAnimation>(Animation::Sequence, kPrettyFollowAnim.c_str());
if (followAnim != nullptr)
{