… | |
… | |
83 | { |
83 | { |
84 | faceinfo *face; |
84 | faceinfo *face; |
85 | uint8 flags; |
85 | uint8 flags; |
86 | }; |
86 | }; |
87 | |
87 | |
|
|
88 | typedef uint16 animidx; |
|
|
89 | |
88 | struct animation |
90 | struct animation |
89 | { |
91 | { |
90 | shstr name; /* Name of the animation sequence */ |
92 | shstr name; /* Name of the animation sequence */ |
|
|
93 | animidx number; |
91 | uint8 num_animations; /* How many different faces to animate */ |
94 | uint8 num_animations; /* How many different faces to animate */ |
92 | uint8 facings; /* How many facings (1,2,4,8) */ |
95 | uint8 facings; /* How many facings (1,2,4,8) */ |
93 | faceidx *faces; /* The different animations */ |
96 | faceidx *faces; /* The different animations */ |
94 | uint16 num; /* Where we are in the array */ |
97 | |
|
|
98 | static animation &create (const char *name, uint8 frames, uint8 facings = 1); |
|
|
99 | static animation &find (const char *name); |
|
|
100 | |
|
|
101 | void resize (int new_size); |
95 | }; |
102 | }; |
|
|
103 | |
|
|
104 | typedef std::tr1::unordered_map<const char *, int, str_hash, str_equal, slice_allocator< std::pair<const char *const, int> >, true> animhash_t; |
|
|
105 | |
|
|
106 | extern animhash_t animhash; |
|
|
107 | extern std::vector<animation> animations; |
96 | |
108 | |
97 | #endif |
109 | #endif |
98 | |
110 | |