--- deliantra/server/include/face.h 2007/05/28 21:15:56 1.15 +++ deliantra/server/include/face.h 2007/10/01 00:44:44 1.22 @@ -1,23 +1,22 @@ /* - * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. + * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. * * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team * Copyright (©) 1994,2007 Mark Wedel * Copyright (©) 1992,2007 Frank Tore Johansen * - * Crossfire TRT is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. + * Crossfire TRT is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . * * The authors can be reached via e-mail to */ @@ -45,22 +44,28 @@ * face only - you can not change the color of an item - you need to instead * create a new face with that color. */ -struct faceinfo +struct faceinfo : zero_initialised { shstr name; - facedata data32, data64; + std::string meta; + facedata data32, data64; // either 32/64 face or data32 == generic resource 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 type; // 0 normal face, otherwise other resource 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), smoothlevel (0), visibility (0), magicmap (0) - { } + facedata *data (int faceset) const; }; +inline void +object_freezer::put (keyword k, faceinfo *v) +{ + put (k, v ? &v->name : (const char *)0); +} + typedef std::tr1::unordered_map >, true> facehash_t; extern facehash_t facehash; @@ -90,11 +95,11 @@ 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 */ + int num_animations; /* How many different faces to animate */ + sint8 facings; /* How many facings (1,2,4,8) */ + animidx number; + shstr name; /* Name of the animation sequence */ static animation &create (const char *name, uint8 frames, uint8 facings = 1); static animation &find (const char *name);