-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMd3AnimationInfo.h
executable file
·81 lines (61 loc) · 2.14 KB
/
CMd3AnimationInfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
CMd3AnimationInfo.h
Author: Tom Naughton
Description: <describe the CMd3AnimationInfo class here>
*/
#ifndef CMd3AnimationInfo_H
#define CMd3AnimationInfo_H
#include <map>
#include <vector>
#include <string>
#include <string.h>
#include "CPakStream.h"
#include "CMd3.h"
using std::string;
using std::map;
using std::vector;
class CWav;
// animation
typedef enum animation_type {
animation_LEGS = 0,
animation_TORSO,
animation_BOTH,
animation_ALL
} animation_part_type;
#define ANIMATION_NAME_LENGTH 64
class CMd3Animation
{
public:
SInt16 _id;
SInt16 _first;
SInt16 _num;
SInt16 _looping;
SInt16 _fps;
char _name[ANIMATION_NAME_LENGTH];
char _nextSequence[ANIMATION_NAME_LENGTH];
CWav *_sound;
Boolean _loopSound;
animation_part_type _type;
};
class CMd3AnimationInfo
{
public:
CMd3AnimationInfo(CResourceManager *resources, CPakStream *animationFile);
virtual ~CMd3AnimationInfo();
string _sex;
mdl_vertex_t _headoffset;
string _footsteps;
string _soundpath;
vector<CMd3Animation*> *_animations;
map<string, UInt16> *_nameToIndexMap;
Boolean _ravenFormat;
void parseAnimationInfo(CResourceManager *resources, const char *pathname, char *animationdata, long size);
void parseExtendedAnimationInfo(CResourceManager *resources, const char *pathname);
Boolean hasAnimationNamed(string name);
CMd3Animation animationWithID(UInt16 id) { return *((*_animations)[id]); }
UInt16 size() { return _animations->size(); }
// this will add unknown names to the map and assign them to 0.
// Use hasAnimationNamed first. Thanks STL.
UInt16 animationIDWithName(string name) { return (*_nameToIndexMap)[name]; }
};
#endif // CMd3AnimationInfo_H