24 : m_mapAnimations( a_pAllocator )
26 m_pAllocator = a_pAllocator;
52 m_strName = strSetName;
53 auto pNullAnim = m_mapAnimations.Find(
TPS8( null ) );
55 if ( !m_mapAnimations.IsValid( pNullAnim ) || pNullAnim.GetValue()->GetSecond() ==
TNULL )
63 m_mapAnimations.Insert(
TPS8( null ), pNullAnim );
70 it->GetName().GetString()[ 0 ] ==
'N' )
73 ANamedAnimation* pAnim = LoadNamedAnimation( it->GetValue()->GetProperties(), a_pSkeleton );
95 it->GetName().GetString()[ 0 ] ==
'A' )
97 TBOOL bRes = LoadAnimationTransition( it->GetValue()->GetProperties() );
109 while ( !m_mapAnimations.IsEmpty() )
111 auto it = m_mapAnimations.Begin();
117 m_mapAnimations.Remove( it );
134 auto it = m_mapAnimations.Find( a_strName );
136 if ( it != m_mapAnimations.End() )
151 if ( pNamedAnimation->
Create( a_pProperties, a_pSkeleton ) )
153 m_mapAnimations.Insert( strName, pNamedAnimation );
154 return pNamedAnimation;
158 delete pNamedAnimation;
170TBOOL ANamedAnimationSet::LoadAnimationTransition(
const PBProperties* a_pProperties )
178 TPString8 strTransitionName;
181 TBOOL bIsAutoTransition;
184 TPString8 strFinishType;
188 if ( bHasFinishType )
195 auto pLinkTo = m_mapAnimations.Find( strLinkTo );
196 if ( m_mapAnimations.IsValid( pLinkTo ) && pLinkTo->GetSecond() !=
TNULL )
198 const PBPropertyValue* pLinkFromProperty = a_pProperties->
GetProperty(
"LinkFrom" );
203 auto pLinkFrom = m_mapAnimations.Find( pLinkFromProperty->GetTPString8() );
205 if ( !m_mapAnimations.IsValid( pLinkFrom ) || pLinkFrom->GetSecond() ==
TNULL )
207 TERROR(
"Invalid LinkFrom property specified." );
#define TOSHI_NAMESPACE_USING
TFORCEINLINE T2Allocator * GetGlobalAllocator()
#define T2_FOREACH(vecName, iteratorName)
#define TDEFINE_CLASS(...)
#define TPSTRING8_DECLARE(STR)
const PBPropertyValue * GetProperty(const TCHAR *a_szName) const
TBOOL GetOptionalPropertyValue(T &a_rOutValue, const TCHAR *a_szName) const
static FINISHTYPE GetFinishType(const Toshi::TPString8 &a_rcFinishType)
TBOOL Create(const PBProperties *a_pProperties, Toshi::TSkeleton *a_pSkeleton)
const Toshi::TPString8 & GetName() const
TBOOL AddSoundBreakpoint(ASoundBreakpoint *a_pSoundBreakpoint, Toshi::TSkeleton *a_pSkeleton)
ANamedAnimation * GetNamedAnimation(const Toshi::TPString8 &a_strName)
TBOOL CreateFromProperties(const PBProperties *a_pProperties, Toshi::TSkeleton *a_pSkeleton)