diff options
Diffstat (limited to 'src/animation/AnimManager.h')
-rw-r--r-- | src/animation/AnimManager.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/animation/AnimManager.h b/src/animation/AnimManager.h index 1b333b60..7df10777 100644 --- a/src/animation/AnimManager.h +++ b/src/animation/AnimManager.h @@ -31,17 +31,21 @@ enum AssocGroupId ASSOCGRP_ROCKETLEFT, ASSOCGRP_ROCKETRIGHT, - NUM_ANIM_ASSOC_GROUPS + NUM_ANIM_ASSOC_GROUPS // should be 61 in the end }; class CAnimBlendAssociation; class CAnimBlendAssocGroup; +#define MAX_ANIMBLOCK_NAME 20 + // A block of hierarchies struct CAnimBlock { - char name[24]; - int32 firstIndex; + char name[MAX_ANIMBLOCK_NAME]; + bool isLoaded; + int16 refCount; + int32 firstIndex; // first animtion in ms_aAnimations int32 numAnims; }; @@ -64,8 +68,8 @@ struct AnimAssocDefinition class CAnimManager { static const AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS]; - static CAnimBlock ms_aAnimBlocks[2]; - static CAnimBlendHierarchy ms_aAnimations[250]; + static CAnimBlock ms_aAnimBlocks[NUMANIMBLOCKS]; + static CAnimBlendHierarchy ms_aAnimations[NUMANIMATIONS]; static int32 ms_numAnimBlocks; static int32 ms_numAnimations; static CAnimBlendAssocGroup *ms_aAnimAssocGroups; @@ -75,7 +79,15 @@ public: static void Initialise(void); static void Shutdown(void); static void UncompressAnimation(CAnimBlendHierarchy *anim); + static void RemoveFromUncompressedCache(CAnimBlendHierarchy *hier); static CAnimBlock *GetAnimationBlock(const char *name); + static int32 GetAnimationBlockIndex(const char *name); + static int32 RegisterAnimBlock(const char *name); + static int32 GetNumRefsToAnimBlock(int32 block); + static void AddAnimBlockRef(int32 block); + static void RemoveAnimBlockRefWithoutDelete(int32 block); + static void RemoveAnimBlockRef(int32 block); + static void RemoveAnimBlock(int32 block); static CAnimBlendHierarchy *GetAnimation(const char *name, CAnimBlock *animBlock); static CAnimBlendHierarchy *GetAnimation(int32 n) { return &ms_aAnimations[n]; } static const char *GetAnimGroupName(AssocGroupId groupId); @@ -87,6 +99,7 @@ public: static CAnimBlendAssociation *BlendAnimation(RpClump *clump, AssocGroupId groupId, AnimationId animId, float delta); static void LoadAnimFiles(void); static void LoadAnimFile(const char *filename); - static void LoadAnimFile(int fd, bool compress); + static void LoadAnimFile(RwStream *stream, bool compress, char (*somename)[32] = nil); + static void CreateAnimAssocGroups(void); static void RemoveLastAnimFile(void); }; |