ShapeInfo.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003-2006 The Pentagram team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 */
00018 
00019 #ifndef SHAPEINFO_H
00020 #define SHAPEINFO_H
00021 
00022 #include "WeaponInfo.h"
00023 #include "ArmourInfo.h"
00024 #include "MonsterInfo.h"
00025 
00026 class ShapeInfo
00027 {
00028 public:
00029         enum SFlags { 
00030                 SI_FIXED   = 0x0001,
00031                 SI_SOLID   = 0x0002,
00032                 SI_SEA     = 0x0004,
00033                 SI_LAND    = 0x0008,
00034                 SI_OCCL    = 0x0010,
00035                 SI_BAG     = 0x0020,
00036                 SI_DAMAGING= 0x0040,
00037                 SI_NOISY   = 0x0080,
00038                 SI_DRAW    = 0x0100,
00039                 SI_IGNORE  = 0x0200,
00040                 SI_ROOF    = 0x0400,
00041                 SI_TRANSL  = 0x0800,
00042                 SI_EDITOR  = 0x1000,
00043                 SI_EXPLODE = 0x2000,
00044                 SI_UNKNOWN46 = 0x4000,
00045                 SI_UNKNOWN47 = 0x8000,
00046                 SI_CRUSUNK61 = 0x2000,
00047                 SI_CRUSUNK62 = 0x4000,
00048                 SI_CRUSUNK63 = 0x8000,
00049                 SI_CRUSUNK64 = 0x10000,
00050                 SI_CRUS_NPC  = 0x20000,
00051                 SI_CRUSUNK66 = 0x40000,
00052                 SI_CRUSUNK67 = 0x80000,
00053         };
00054 
00055         enum SFamily {
00056         SF_GENERIC     = 0,
00057                 SF_QUALITY     = 1,
00058                 SF_QUANTITY    = 2,
00059                 SF_GLOBEGG     = 3,
00060                 SF_UNKEGG      = 4,
00061                 SF_BREAKABLE   = 5,
00062                 SF_CONTAINER   = 6,
00063                 SF_MONSTEREGG  = 7,
00064                 SF_TELEPORTEGG = 8,
00065                 SF_REAGENT     = 9,
00066                 SF_15          = 15
00067         };
00068 
00069         enum SEquipType {
00070                 SE_NONE   = 0,
00071                 SE_SHIELD = 1,
00072                 SE_ARM    = 2,
00073                 SE_HEAD   = 3,
00074                 SE_BODY   = 4,
00075                 SE_LEGS   = 5,
00076                 SE_WEAPON = 6
00077         };
00078                    
00079         uint32 flags;
00080         uint32 x, y, z;
00081         uint32 family;
00082         uint32 equiptype;
00083         uint32 animtype, animdata;
00084         uint32 unknown;
00085         uint32 weight, volume;
00086 
00087         WeaponInfo* weaponinfo;
00088         ArmourInfo* armourinfo;
00089         MonsterInfo* monsterinfo;
00090 
00091         inline bool is_fixed() const { return (flags & SI_FIXED) != 0; }
00092         inline bool is_solid() const { return (flags & SI_SOLID) != 0; }
00093         inline bool is_sea() const { return (flags & SI_SEA) != 0; }
00094         inline bool is_land() const { return (flags & SI_LAND) != 0; }
00095         inline bool is_occl() const { return (flags & SI_OCCL) != 0; }
00096         inline bool is_bag() const { return (flags & SI_BAG) != 0; }
00097         inline bool is_damaging() const { return (flags & SI_DAMAGING) != 0; }
00098         inline bool is_noisy() const { return (flags & SI_NOISY) != 0; }
00099         inline bool is_draw() const { return (flags & SI_DRAW) != 0; }
00100         inline bool is_ignore() const { return (flags & SI_IGNORE) != 0; }
00101         inline bool is_roof() const { return (flags & SI_ROOF) != 0; }
00102         inline bool is_translucent() const { return (flags & SI_TRANSL) != 0; }
00103         inline bool is_editor() const { return (flags & SI_EDITOR) != 0; }
00104         inline bool is_explode() const { return (flags & SI_EXPLODE) != 0; }
00105 
00106         bool hasQuantity() const
00107                 { return (family == SF_QUANTITY || family == SF_REAGENT); }
00108 
00109         bool getTypeFlag(int typeflag);
00110         bool getTypeFlagU8(int typeflag);
00111         bool getTypeFlagCrusader(int typeflag);
00112 
00113         inline void getFootpadWorld(sint32& X, sint32& Y, sint32& Z, uint16 flipped) const;
00114 
00115         ShapeInfo() : weaponinfo(0), armourinfo(0), monsterinfo(0) { }
00116 
00117         ~ShapeInfo() {
00118                 delete weaponinfo;
00119                 delete[] armourinfo;
00120                 delete monsterinfo;
00121         }
00122 
00123 };
00124 
00125 inline void ShapeInfo::getFootpadWorld(sint32& X, sint32& Y, sint32& Z, uint16 flipped) const
00126 {
00127         Z = z *  8;
00128 
00129         if (flipped) {
00130                 X = y * 32;
00131                 Y = x * 32;
00132         } else {
00133                 X = x * 32;
00134                 Y = y * 32;
00135         }
00136 }
00137 
00138 #endif

Generated on Fri Jul 27 22:27:37 2007 for pentagram by  doxygen 1.4.7