1 // define this if svqc code wants to use .frame2 and .lerpfrac
2 #define CSQCMODEL_HAVE_TWO_FRAMES
4 // don't define this ever
5 //#define CSQCMODEL_SUPPORT_GETTAGINFO_BEFORE_DRAW
9 # define TAG_ENTITY_NAME tag_networkentity
10 # define TAG_ENTITY_TYPE float
11 .float tag_networkentity;
13 # define TAG_ENTITY_NAME tag_entity
14 # define TAG_ENTITY_TYPE entity
17 // add properties you want networked to CSQC here
18 #define CSQCMODEL_EXTRAPROPERTIES \
19 CSQCMODEL_PROPERTY(1, float, ReadShort, WriteShort, colormap) \
20 CSQCMODEL_PROPERTY(2, float, ReadInt24_t, WriteInt24_t, effects) \
21 CSQCMODEL_PROPERTY(4, float, ReadByte, WriteByte, modelflags) \
22 CSQCMODEL_PROPERTY_SCALED(8, float, ReadByte, WriteByte, alpha, 254, -1, 254) \
23 CSQCMODEL_PROPERTY(16, float, ReadByte, WriteByte, skin) \
24 CSQCMODEL_IF(isplayer) \
26 CSQCMODEL_IF(!isplayer) \
27 CSQCMODEL_PROPERTY(32, TAG_ENTITY_TYPE, ReadShort, WriteEntity, TAG_ENTITY_NAME) \
28 CSQCMODEL_PROPERTY_SCALED(64, float, ReadByte, WriteByte, glowmod_x, 255, 0, 255) \
29 CSQCMODEL_PROPERTY_SCALED(64, float, ReadByte, WriteByte, glowmod_y, 255, 0, 255) \
30 CSQCMODEL_PROPERTY_SCALED(64, float, ReadByte, WriteByte, glowmod_z, 255, 0, 255) \
32 // TODO get rid of colormod/glowmod here, find good solution for nex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
34 // add hook function calls here
35 #define CSQCMODEL_HOOK_PREUPDATE \
36 CSQCModel_Hook_PreUpdate(isnew, isplayer, islocalplayer);
37 #define CSQCMODEL_HOOK_POSTUPDATE \
38 CSQCModel_Hook_PostUpdate(isnew, isplayer, islocalplayer);
39 #define CSQCMODEL_HOOK_PREDRAW \
40 CSQCModel_Hook_PreDraw();
41 #define CSQCPLAYER_HOOK_POSTCAMERASETUP
43 // force updates of player entities that often even if unchanged
44 #define CSQCPLAYER_FORCE_UPDATES 0.25
47 //vector PL_MIN = ...;
48 //vector PL_MAX = ...;
49 //vector PL_VIEW_OFS = ...;
50 //vector PL_CROUCH_MIN = ...;
51 //vector PL_CROUCH_MAX = ...;
52 //vector PL_CROUCH_VIEW_OFS = ...;
55 # ifdef NO_LEGACY_NETWORKING
56 # define CSQCMODEL_AUTOINIT() CSQCModel_LinkEntity()
57 # define CSQCMODEL_AUTOUPDATE() CSQCModel_CheckUpdate()
60 float autocvar_sv_use_csqc_players;
61 # define CSQCMODEL_AUTOINIT() \
62 if(autocvar_sv_use_csqc_players) \
64 CSQCModel_LinkEntity(); \
65 self.iscsqcmodel = 1; \
69 # define CSQCMODEL_AUTOUPDATE() \
70 if(autocvar_sv_use_csqc_players && !self.iscsqcmodel) \
72 CSQCModel_LinkEntity(); \
73 self.iscsqcmodel = 1; \
75 if(!autocvar_sv_use_csqc_players && self.iscsqcmodel) \
77 CSQCModel_UnlinkEntity(); \
78 self.iscsqcmodel = 0; \
80 if(self.iscsqcmodel) \
81 CSQCModel_CheckUpdate()
85 #define CSQCMODEL_EF_INVISIBLE EF_SELECTABLE