OpenBarnyard
 
Loading...
Searching...
No Matches
TKeyframeLibraryInstance.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
13{
14 m_pLibrary = TNULL;
15 m_iTBaseIndex = 0;
16 m_iQBaseIndex = 0;
17 m_iSBaseIndex = 0;
18 m_iTKeyCount = 0;
19 m_iQKeyCount = 0;
20 m_iSKeyCount = 0;
21 m_pTranslations = TNULL;
22 m_pQuaternions = TNULL;
23 m_pScales = TNULL;
24}
25
27{
28 return CreateEx( a_pLibrary, a_pLibrary->m_iNumTranslations, a_pLibrary->m_iNumQuaternions, a_pLibrary->m_iNumScales, 0, 0, 0 );
29}
30
31// $Barnyard: FUNCTION 006c9c90
32TKeyframeLibrary* TKeyframeLibraryInstance::CreateEx( TKeyframeLibrary* a_pLibrary, TINT a_iTKeyCount, TINT a_iQKeyCount, TINT a_iSKeyCount, TINT a_iTBaseIndex, TINT a_iQBaseIndex, TINT a_iSBaseIndex )
33{
34 TKeyframeLibrary* pOldLibrary = m_pLibrary;
35
36 Destroy();
37 m_pLibrary = a_pLibrary;
38
39 if ( a_pLibrary != TNULL )
40 {
41 a_pLibrary->IncreaseRefCount();
42
43 m_iTKeyCount = a_iTKeyCount;
44 m_iQKeyCount = a_iQKeyCount;
45 m_iTBaseIndex = a_iTBaseIndex;
46 m_iQBaseIndex = a_iQBaseIndex;
47 m_iSBaseIndex = a_iSBaseIndex;
48 m_iSKeyCount = a_iSKeyCount;
49 m_pTranslations = a_pLibrary->m_pTranslations + a_iTBaseIndex;
50 m_pQuaternions = a_pLibrary->m_pQuaternions + a_iQBaseIndex;
51 m_pScales = a_pLibrary->m_pScales + a_iSBaseIndex;
52 }
53
54 return pOldLibrary;
55}
56
57// $Barnyard: FUNCTION 006c9c80
59{
60 if ( m_pLibrary != TNULL )
61 {
62 m_pLibrary->DecreaseRefCount();
63 m_pLibrary = TNULL;
64 }
65}
66
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
#define TNULL
Definition Typedefs.h:23
int TINT
Definition Typedefs.h:7
TKeyframeLibrary * Create(TKeyframeLibrary *a_pLibrary)
TKeyframeLibrary * CreateEx(TKeyframeLibrary *a_pLibrary, TINT a_iTKeyCount, TINT a_iQKeyCount, TINT a_iSKeyCount, TINT a_iTBaseIndex, TINT a_iQBaseIndex, TINT a_iSBaseIndex)