Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
See license in Gwen.h
|
||||
*/
|
||||
|
||||
|
||||
#include "Gwen/Anim.h"
|
||||
#include "Gwen/Utility.h"
|
||||
#include <math.h>
|
||||
@@ -13,17 +12,17 @@ using namespace Gwen;
|
||||
|
||||
#ifndef GWEN_NO_ANIMATION
|
||||
|
||||
static Gwen::Anim::Animation::List g_Animations;
|
||||
static Gwen::Anim::Animation::List g_Animations;
|
||||
static Gwen::Anim::Animation::ChildList g_AnimationsListed;
|
||||
|
||||
void Gwen::Anim::Add( Gwen::Controls::Base* control, Animation* animation )
|
||||
void Gwen::Anim::Add(Gwen::Controls::Base* control, Animation* animation)
|
||||
{
|
||||
animation->m_Control = control;
|
||||
|
||||
g_Animations[control].push_back( animation );
|
||||
g_Animations[control].push_back(animation);
|
||||
}
|
||||
|
||||
void Gwen::Anim::Cancel( Gwen::Controls::Base* control )
|
||||
void Gwen::Anim::Cancel(Gwen::Controls::Base* control)
|
||||
{
|
||||
/* cannot use std::list iterator with algoryhtmns based on pointers
|
||||
struct AnimDeletePredicate
|
||||
@@ -46,14 +45,14 @@ void Gwen::Anim::Cancel( Gwen::Controls::Base* control )
|
||||
Gwen::Anim::Animation::List::iterator iAnimations;
|
||||
if ((iAnimations = g_Animations.find(control)) != g_Animations.end())
|
||||
{
|
||||
Gwen::Anim::Animation::ChildList &ChildAnimationsForControl = iAnimations->second;
|
||||
Gwen::Anim::Animation::ChildList& ChildAnimationsForControl = iAnimations->second;
|
||||
Gwen::Anim::Animation::ChildList::iterator iAnimationChild = ChildAnimationsForControl.begin();
|
||||
if (iAnimationChild != ChildAnimationsForControl.end())
|
||||
{
|
||||
do
|
||||
{
|
||||
delete (*iAnimationChild);
|
||||
}while(++iAnimationChild != ChildAnimationsForControl.end());
|
||||
} while (++iAnimationChild != ChildAnimationsForControl.end());
|
||||
}
|
||||
g_Animations.erase(iAnimations);
|
||||
}
|
||||
@@ -63,10 +62,10 @@ void Gwen::Anim::Think()
|
||||
{
|
||||
Gwen::Anim::Animation::List::iterator it = g_Animations.begin();
|
||||
|
||||
if ( it != g_Animations.end() )
|
||||
if (it != g_Animations.end())
|
||||
{
|
||||
Gwen::Anim::Animation::ChildList::iterator itChild;
|
||||
|
||||
|
||||
Gwen::Anim::Animation* anim;
|
||||
|
||||
do
|
||||
@@ -79,9 +78,9 @@ void Gwen::Anim::Think()
|
||||
|
||||
anim->Think();
|
||||
|
||||
if ( anim->Finished() )
|
||||
if (anim->Finished())
|
||||
{
|
||||
itChild = it->second.erase( itChild );
|
||||
itChild = it->second.erase(itChild);
|
||||
|
||||
delete anim;
|
||||
}
|
||||
@@ -90,15 +89,14 @@ void Gwen::Anim::Think()
|
||||
++itChild;
|
||||
}
|
||||
|
||||
}while(itChild != it->second.end());
|
||||
} while (itChild != it->second.end());
|
||||
}
|
||||
|
||||
}while(++it != g_Animations.end());
|
||||
}
|
||||
|
||||
} while (++it != g_Animations.end());
|
||||
}
|
||||
}
|
||||
|
||||
Gwen::Anim::TimedAnimation::TimedAnimation( float fLength, float fDelay, float fEase )
|
||||
Gwen::Anim::TimedAnimation::TimedAnimation(float fLength, float fDelay, float fEase)
|
||||
{
|
||||
m_fStart = Platform::GetTimeInSeconds() + fDelay;
|
||||
m_fEnd = m_fStart + fLength;
|
||||
@@ -109,25 +107,25 @@ Gwen::Anim::TimedAnimation::TimedAnimation( float fLength, float fDelay, float f
|
||||
|
||||
void Gwen::Anim::TimedAnimation::Think()
|
||||
{
|
||||
if ( m_bFinished ) return;
|
||||
if (m_bFinished) return;
|
||||
|
||||
float fCurrent = Platform::GetTimeInSeconds();
|
||||
float fSecondsIn = fCurrent - m_fStart;
|
||||
if ( fSecondsIn < 0.0f ) return;
|
||||
if (fSecondsIn < 0.0f) return;
|
||||
|
||||
if ( !m_bStarted )
|
||||
if (!m_bStarted)
|
||||
{
|
||||
m_bStarted = true;
|
||||
OnStart();
|
||||
}
|
||||
|
||||
float fDelta = fSecondsIn / ( m_fEnd - m_fStart );
|
||||
if ( fDelta < 0.0f ) fDelta = 0.0f;
|
||||
if ( fDelta > 1.0f ) fDelta = 1.0f;
|
||||
float fDelta = fSecondsIn / (m_fEnd - m_fStart);
|
||||
if (fDelta < 0.0f) fDelta = 0.0f;
|
||||
if (fDelta > 1.0f) fDelta = 1.0f;
|
||||
|
||||
Run( pow( fDelta, m_fEase ) );
|
||||
Run(pow(fDelta, m_fEase));
|
||||
|
||||
if ( fDelta == 1.0f )
|
||||
if (fDelta == 1.0f)
|
||||
{
|
||||
m_bFinished = true;
|
||||
OnFinish();
|
||||
|
||||
Reference in New Issue
Block a user