Linux makefiles
[canaan.git] / prj / cam / src / shock / shkganpr.cpp
blob590ee0fe9dfc4aedaae722c554c47f8f902aaada
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 // $Header: r:/t2repos/thief2/src/shock/shkganpr.cpp,v 1.3 1998/07/19 16:12:53 JON Exp $
8 #include <shkganpr.h>
10 #include <propert_.h>
11 #include <dataops_.h>
12 #include <prophash.h>
14 #include <sdesc.h>
15 #include <sdesbase.h>
17 // Must be last header
18 #include <dbmem.h>
20 // Base gun description
21 // the all new improved property system...
22 // data ops
23 class cGunAnimDataOps: public cClassDataOps<sGunAnim>
27 // storage class
28 class cGunAnimStore: public cHashPropertyStore<cGunAnimDataOps>
32 // property implementation class
33 class cGunAnimProperty: public cSpecificProperty<IGunAnimProperty, &IID_IGunAnimProperty, sGunAnim*, cGunAnimStore>
35 typedef cSpecificProperty<IGunAnimProperty, &IID_IGunAnimProperty, sGunAnim*, cGunAnimStore> cParent;
37 public:
38 cGunAnimProperty(const sPropertyDesc* desc)
39 : cParent(desc)
43 STANDARD_DESCRIBE_TYPE(sGunAnim);
47 static char *flagBits[] =
49 "Target 2",
52 static sFieldDesc GunAnimFields[] =
54 {"Flags", kFieldTypeBits, FieldLocation(sGunAnim, m_jointAnim.m_params.m_flags), kFieldFlagNone, 0, 1, 1, flagBits,},
55 {"Joint Num", kFieldTypeInt, FieldLocation(sGunAnim, m_jointAnim.m_num),},
56 {"Rate 1", kFieldTypeFloat, FieldLocation(sGunAnim, m_jointAnim.m_params.m_rate1),},
57 {"Rate 2", kFieldTypeFloat, FieldLocation(sGunAnim, m_jointAnim.m_params.m_rate2),},
58 {"Target 1", kFieldTypeFloat, FieldLocation(sGunAnim, m_jointAnim.m_params.m_target1),},
59 {"Target 2", kFieldTypeFloat, FieldLocation(sGunAnim, m_jointAnim.m_params.m_target2),},
62 static sStructDesc GunAnimStructDesc =
63 StructDescBuild(sGunAnim, kStructFlagNone, GunAnimFields);
65 IGunAnimProperty *CreateGunAnimProperty(sPropertyDesc *desc, ePropertyImpl impl)
67 StructDescRegister(&GunAnimStructDesc);
68 return new cGunAnimProperty(desc);
71 static sPropertyDesc gunAnimPostDesc =
73 PROP_GUN_ANIM_POST_NAME,
75 NULL,
76 1, // version
78 {"Gun", "Gun Anim Post"},
81 static sPropertyDesc gunAnimPreDesc =
83 PROP_GUN_ANIM_PRE_NAME,
85 NULL,
86 1, // version
88 {"Gun", "Gun Anim Pre"},
91 IGunAnimProperty *g_gunAnimPreProperty;
92 IGunAnimProperty *g_gunAnimPostProperty;
94 void GunAnimPropertyInit()
96 g_gunAnimPreProperty = CreateGunAnimProperty(&gunAnimPreDesc, kPropertyImplSparse);
97 g_gunAnimPostProperty = CreateGunAnimProperty(&gunAnimPostDesc, kPropertyImplSparse);
100 void GunAnimPropertyTerm(void)
102 SafeRelease(g_gunAnimPreProperty);
103 SafeRelease(g_gunAnimPostProperty);