OpenBarnyard
 
Loading...
Searching...
No Matches
TKeyframeLibraryManager.cpp
Go to the documentation of this file.
1#include "ToshiPCH.h"
2#include "TAnimation.h"
3
4//-----------------------------------------------------------------------------
5// Enables memory debugging.
6// Note: Should be the last include!
7//-----------------------------------------------------------------------------
9
11
12// $Barnyard: FUNCTION 006cb0e0
16
17// $Barnyard: FUNCTION 006cbf80
21
22// $Barnyard: FUNCTION 006ca710
24{
25 for ( auto it = m_List.Begin(); it != m_List.End(); ++it )
26 {
27 if ( TStringManager::String8Length( a_szName ) == it->GetNameLength() &&
28 TStringManager::String8CompareNoCase( it->GetName(), a_szName, it->GetNameLength() ) == 0 )
29 {
30 return it;
31 }
32 }
33
34 return TNULL;
35}
36
37// $Barnyard: FUNCTION 006cb0f0
39{
40 TVALIDPTR( a_szFilePath );
41
42 auto pTRB = new TTRB();
43
44 if ( pTRB->Load( a_szFilePath, 0 ) != TTRB::ERROR_OK )
45 {
46 delete pTRB;
47 return TNULL;
48 }
49
50 TKeyframeLibrary* pLibrary = TKeyframeLibrary::CreateFromTRB( pTRB, "keylib" );
51
52 m_List.InsertHead( pLibrary );
53 m_iNumLibraries++;
54
55 pLibrary->SetTRB( pTRB );
56 return pLibrary;
57}
58
59// $Barnyard: FUNCTION 006ca6d0
61{
62 TKeyframeLibrary* pLibrary = TKeyframeLibrary::CreateFromTRB( a_pTRB, a_szSymbolName );
63
64 m_List.InsertHead( pLibrary );
65 m_iNumLibraries++;
66
67 return pLibrary;
68}
69
70// $Barnyard: FUNCTION 006ca3c0
72{
73 TVALIDPTR( a_pLibrary );
74
75 a_pLibrary->Remove();
76 a_pLibrary->Delete();
77 m_iNumLibraries--;
78}
79
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
#define TVALIDPTR(PTR)
Definition Defines.h:139
char TCHAR
Definition Typedefs.h:20
#define TNULL
Definition Typedefs.h:23
Definition TTRB.h:253
@ ERROR_OK
Definition TTRB.h:258
static TKeyframeLibrary * CreateFromTRB(TTRB *a_pTRB, const TCHAR *a_szSymbolName)
void SetTRB(TTRB *a_pTRB)
Definition TAnimation.h:119
TKeyframeLibrary * GetLibrary(const TCHAR *a_szName)
TKeyframeLibrary * LoadLibrary(const TCHAR *a_szFilePath)
void UnloadLibrary(TKeyframeLibrary *a_pLibrary)
static TSIZE String8Length(const TCHAR *str)
static TINT String8CompareNoCase(const TCHAR *str1, const TCHAR *str2, TSIZE size=-1)