2019-06-11 06:59:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AnimBlendHierarchy.h"
|
2020-04-19 16:34:08 +00:00
|
|
|
#include "AnimationId.h"
|
2019-06-11 06:59:28 +00:00
|
|
|
|
|
|
|
enum AssocGroupId
|
|
|
|
{
|
|
|
|
ASSOCGRP_STD,
|
|
|
|
ASSOCGRP_PLAYER,
|
|
|
|
ASSOCGRP_PLAYERROCKET,
|
|
|
|
ASSOCGRP_PLAYER1ARMED,
|
|
|
|
ASSOCGRP_PLAYER2ARMED,
|
|
|
|
ASSOCGRP_PLAYERBBBAT,
|
|
|
|
ASSOCGRP_SHUFFLE,
|
|
|
|
ASSOCGRP_OLD,
|
|
|
|
ASSOCGRP_GANG1,
|
|
|
|
ASSOCGRP_GANG2,
|
|
|
|
ASSOCGRP_FAT,
|
|
|
|
ASSOCGRP_OLDFAT,
|
|
|
|
ASSOCGRP_WOMAN,
|
|
|
|
ASSOCGRP_WOMANSHOP,
|
|
|
|
ASSOCGRP_BUSYWOMAN,
|
|
|
|
ASSOCGRP_SEXYWOMAN,
|
|
|
|
ASSOCGRP_OLDWOMAN,
|
2020-05-10 15:09:57 +00:00
|
|
|
ASSOCGRP_FATWOMAN,
|
2019-06-11 06:59:28 +00:00
|
|
|
ASSOCGRP_PANICCHUNKY,
|
2020-12-21 19:48:40 +00:00
|
|
|
#ifdef PC_PLAYER_CONTROLS
|
2019-06-11 06:59:28 +00:00
|
|
|
ASSOCGRP_PLAYERBACK,
|
|
|
|
ASSOCGRP_PLAYERLEFT,
|
|
|
|
ASSOCGRP_PLAYERRIGHT,
|
|
|
|
ASSOCGRP_ROCKETBACK,
|
|
|
|
ASSOCGRP_ROCKETLEFT,
|
|
|
|
ASSOCGRP_ROCKETRIGHT,
|
2020-12-21 19:48:40 +00:00
|
|
|
#endif
|
2019-06-11 06:59:28 +00:00
|
|
|
|
|
|
|
NUM_ANIM_ASSOC_GROUPS
|
|
|
|
};
|
|
|
|
|
|
|
|
class CAnimBlendAssociation;
|
|
|
|
class CAnimBlendAssocGroup;
|
|
|
|
|
|
|
|
// A block of hierarchies
|
|
|
|
struct CAnimBlock
|
|
|
|
{
|
|
|
|
char name[24];
|
|
|
|
int32 firstIndex;
|
|
|
|
int32 numAnims;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AnimAssocDesc
|
|
|
|
{
|
|
|
|
int32 animId;
|
|
|
|
int32 flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AnimAssocDefinition
|
|
|
|
{
|
2019-08-16 18:17:15 +00:00
|
|
|
char const *name;
|
|
|
|
char const *blockName;
|
2019-06-11 06:59:28 +00:00
|
|
|
int32 modelIndex;
|
|
|
|
int32 numAnims;
|
2019-08-16 18:17:15 +00:00
|
|
|
char const **animNames;
|
2019-06-11 06:59:28 +00:00
|
|
|
AnimAssocDesc *animDescs;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CAnimManager
|
|
|
|
{
|
2019-08-16 18:17:15 +00:00
|
|
|
static const AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS];
|
2020-05-08 18:58:40 +00:00
|
|
|
static CAnimBlock ms_aAnimBlocks[NUMANIMBLOCKS];
|
|
|
|
static CAnimBlendHierarchy ms_aAnimations[NUMANIMATIONS];
|
2020-04-16 19:19:56 +00:00
|
|
|
static int32 ms_numAnimBlocks;
|
|
|
|
static int32 ms_numAnimations;
|
|
|
|
static CAnimBlendAssocGroup *ms_aAnimAssocGroups;
|
|
|
|
static CLinkList<CAnimBlendHierarchy*> ms_animCache;
|
2019-06-11 06:59:28 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
static void Initialise(void);
|
|
|
|
static void Shutdown(void);
|
|
|
|
static void UncompressAnimation(CAnimBlendHierarchy *anim);
|
|
|
|
static CAnimBlock *GetAnimationBlock(const char *name);
|
|
|
|
static CAnimBlendHierarchy *GetAnimation(const char *name, CAnimBlock *animBlock);
|
|
|
|
static CAnimBlendHierarchy *GetAnimation(int32 n) { return &ms_aAnimations[n]; }
|
|
|
|
static const char *GetAnimGroupName(AssocGroupId groupId);
|
|
|
|
static CAnimBlendAssociation *CreateAnimAssociation(AssocGroupId groupId, AnimationId animId);
|
|
|
|
static CAnimBlendAssociation *GetAnimAssociation(AssocGroupId groupId, AnimationId animId);
|
|
|
|
static CAnimBlendAssociation *GetAnimAssociation(AssocGroupId groupId, const char *name);
|
|
|
|
static CAnimBlendAssociation *AddAnimation(RpClump *clump, AssocGroupId groupId, AnimationId animId);
|
|
|
|
static CAnimBlendAssociation *AddAnimationAndSync(RpClump *clump, CAnimBlendAssociation *syncanim, AssocGroupId groupId, AnimationId animId);
|
|
|
|
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 RemoveLastAnimFile(void);
|
|
|
|
};
|