--- deliantra/server/include/face.h 2007/04/03 00:21:37 1.12 +++ deliantra/server/include/face.h 2007/04/12 14:18:05 1.14 @@ -51,11 +51,12 @@ faceidx number; /* This is the image id. It should be the */ /* same value as its position in the array */ faceidx smooth; /* the smooth face for this face, or 0 */ + uint8 smoothlevel; // smoothlevel is per-face in 2.x servers uint8 visibility; uint8 magicmap; /* Color to show this in magic map */ faceinfo () - : number (0), smooth (0), visibility (0), magicmap (0) + : number (0), smooth (0), smoothlevel (0), visibility (0), magicmap (0) { } }; @@ -84,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