OpenBarnyard
 
Loading...
Searching...
No Matches
AAnimatableObjectManager.h
Go to the documentation of this file.
1#pragma once
4#include "AAnimatableObject.h"
5#include "ASoundBreakpoint.h"
6
7#include <Toshi/TTask.h>
8#include <Toshi/T2DList.h>
9#include <Toshi/TPString8.h>
10#include <Toshi/T2ObjectPool.h>
11#include <File/TTRB.h>
13
14extern Toshi::T2ObjectPool<AToshiAnimationRef, 100> g_oAnimationRefPool;
15
17 : public Toshi::TTask
18 , public Toshi::TSingleton<AAnimatableObjectManager>
19{
20public:
22
23public:
24 // constructors/destructor
27
28 //-----------------------------------------------------------------------------
29 // TTask
30 //-----------------------------------------------------------------------------
31 virtual TBOOL OnUpdate( TFLOAT a_fDeltaTime ) OVERRIDE;
32
33 //-----------------------------------------------------------------------------
34 // Own Methods
35 //-----------------------------------------------------------------------------
36 AAnimatableObject* CreateAnimatableObject( AAnimatableObjectType* a_pObjectType, void* a_Unk1 = TNULL, TUINT a_eFlags = 0 );
37
38 // Loads all types specified in the library
39 void LoadTypesFromLibrary( const TCHAR* a_szLibName );
40 void LoadAnimObjType( const TCHAR* a_szName, const PBProperties* a_pProperties, TBOOL a_bNoBreakpoints );
41 void LoadAnimObjType( const Toshi::TPString8& a_rcName, const PBProperties* a_pProperties, TBOOL a_bNoBreakpoints );
42 TBOOL LoadAnimSoundBreakpoints( const TCHAR* a_szFilePath );
43
44 TINT FindNumAnimationSoundBreakpoints( const Toshi::TPString8& a_rcModelName, ANamedAnimation* a_pAnimation );
45 AAnimatableObjectType* FindType( const Toshi::TPString8& a_rcName );
46
47 void DetachObject( AAnimatableObject* a_pObject, AAnimatableObject* a_pParent );
48
49 void DestroyType( const Toshi::TPString8& a_rcName );
50 void DestroyAnimatableObject( AAnimatableObject* a_pAnimatableObject );
51 void DestroyAttachedObjects( AAnimatableObject* a_pAnimatableObject );
52
53private:
54 void AttachSoundBreakpoints( AAnimatableObjectType* a_pObjectType );
55
56private:
57 Toshi::T2DList<AAnimatableObject> m_llAnimatableObjects;
58 Toshi::T2DList<AAnimatableObjectType> m_llObjectTypes;
59 Toshi::TTRB* m_pAnimSoundBPsTRB;
60 ASoundBreakpointsTable* m_pSoundBreakpoints;
61};
TRB (Toshi Relocatable Binary) resource system for the Toshi engine.
#define OVERRIDE
Definition Defines.h:12
#define TDECLARE_CLASS(THIS_CLASS, PARENT_CLASS)
Definition TObject.h:38
unsigned int TUINT
Definition Typedefs.h:8
char TCHAR
Definition Typedefs.h:20
float TFLOAT
Definition Typedefs.h:4
#define TNULL
Definition Typedefs.h:23
int TINT
Definition Typedefs.h:7
bool TBOOL
Definition Typedefs.h:6
Toshi::T2ObjectPool< AToshiAnimationRef, 100 > g_oAnimationRefPool
AAnimatableObject * CreateAnimatableObject(AAnimatableObjectType *a_pObjectType, void *a_Unk1=nullptr, TUINT a_eFlags=0)
void LoadAnimObjType(const TCHAR *a_szName, const PBProperties *a_pProperties, TBOOL a_bNoBreakpoints)
void DestroyAnimatableObject(AAnimatableObject *a_pAnimatableObject)
TBOOL LoadAnimSoundBreakpoints(const TCHAR *a_szFilePath)
void LoadAnimObjType(const Toshi::TPString8 &a_rcName, const PBProperties *a_pProperties, TBOOL a_bNoBreakpoints)
AAnimatableObjectType * FindType(const Toshi::TPString8 &a_rcName)
void DetachObject(AAnimatableObject *a_pObject, AAnimatableObject *a_pParent)
void LoadTypesFromLibrary(const TCHAR *a_szLibName)
void DestroyType(const Toshi::TPString8 &a_rcName)
void DestroyAttachedObjects(AAnimatableObject *a_pAnimatableObject)
TINT FindNumAnimationSoundBreakpoints(const Toshi::TPString8 &a_rcModelName, ANamedAnimation *a_pAnimation)
virtual TBOOL OnUpdate(TFLOAT a_fDeltaTime) override