--- deliantra/server/include/face.h 2007/04/10 09:35:23 1.13 +++ deliantra/server/include/face.h 2007/04/12 14:18:05 1.14 @@ -85,14 +85,26 @@ uint8 flags; }; +typedef uint16 animidx; + struct animation { shstr name; /* Name of the animation sequence */ + animidx number; uint8 num_animations; /* How many different faces to animate */ uint8 facings; /* How many facings (1,2,4,8) */ faceidx *faces; /* The different animations */ - uint16 num; /* Where we are in the array */ + + static animation &create (const char *name, uint8 frames, uint8 facings = 1); + static animation &find (const char *name); + + void resize (int new_size); }; +typedef std::tr1::unordered_map >, true> animhash_t; + +extern animhash_t animhash; +extern std::vector animations; + #endif