OpenBarnyard
 
Loading...
Searching...
No Matches
AKeyFrameLibraryManager.h
Go to the documentation of this file.
1#pragma once
2#include "Memory/AMemory.h"
3
5#include <Render/TAnimation.h>
6#include <Toshi/TPString8.h>
7#include <Toshi/T2Map.h>
8
9class AKeyFrameLibraryManager : public Toshi::TObject
10 , public Toshi::TSingleton<AKeyFrameLibraryManager>
11{
12public:
14
15 using LibraryMap = Toshi::T2Map<Toshi::TPString8, Toshi::TKeyframeLibrary*, Toshi::TPString8::Comparator>;
16
17public:
20
21 // Loads all libraries listed in the a_pArray
22 void LoadLibrariesFromProperties( const PBPropertyValue* a_pArray, Toshi::TTRB* a_pTRB );
23
24 // Creates a reference to library if it exists or loads if from the file
25 TBOOL LoadLibrary( const Toshi::TPString8& a_rLibraryName, Toshi::TTRB* a_pTRB = TNULL );
26
27 // Removes reference to the library and unloads it if no references left
28 TBOOL UnrefLibrary( const Toshi::TPString8& a_rLibraryName );
29
30private:
31 void UnloadLibrary( LibraryMap::Iterator& a_rLibrary );
32 void UnloadAllLibraries();
33
34private:
35 LibraryMap m_Libraries;
36 Toshi::T2Map<Toshi::TPString8, TINT, Toshi::TPString8::Comparator> m_LibrariesRefs;
37};
#define TDECLARE_CLASS(THIS_CLASS, PARENT_CLASS)
Definition TObject.h:38
#define TNULL
Definition Typedefs.h:23
bool TBOOL
Definition Typedefs.h:6
void LoadLibrariesFromProperties(const PBPropertyValue *a_pArray, Toshi::TTRB *a_pTRB)
Toshi::T2Map< Toshi::TPString8, Toshi::TKeyframeLibrary *, Toshi::TPString8::Comparator > LibraryMap
TBOOL UnrefLibrary(const Toshi::TPString8 &a_rLibraryName)
TBOOL LoadLibrary(const Toshi::TPString8 &a_rLibraryName, Toshi::TTRB *a_pTRB=nullptr)