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_PROPERTY(32, float, ReadApproxPastTime, WriteApproxPastTime, death_time) \
25 CSQCMODEL_IF(!isplayer) \
26 CSQCMODEL_PROPERTY(64, TAG_ENTITY_TYPE, ReadShort, WriteEntity, TAG_ENTITY_NAME) \
27 CSQCMODEL_PROPERTY_SCALED(128, float, ReadByte, WriteByte, glowmod_x, 255, 0, 255) \
28 CSQCMODEL_PROPERTY_SCALED(128, float, ReadByte, WriteByte, glowmod_y, 255, 0, 255) \
29 CSQCMODEL_PROPERTY_SCALED(128, float, ReadByte, WriteByte, glowmod_z, 255, 0, 255) \
31 // 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
33 // add hook function calls here
34 #define CSQCMODEL_HOOK_PREUPDATE \
35 CSQCModel_Hook_PreUpdate(isnew, isplayer, islocalplayer);
36 #define CSQCMODEL_HOOK_POSTUPDATE \
37 CSQCModel_Hook_PostUpdate(isnew, isplayer, islocalplayer);
38 #define CSQCMODEL_HOOK_PREDRAW \
39 CSQCModel_Hook_PreDraw();
40 #define CSQCPLAYER_HOOK_POSTCAMERASETUP
42 // force updates of player entities that often even if unchanged
43 #define CSQCPLAYER_FORCE_UPDATES 0.25
46 //vector PL_MIN = ...;
47 //vector PL_MAX = ...;
48 //vector PL_VIEW_OFS = ...;
49 //vector PL_CROUCH_MIN = ...;
50 //vector PL_CROUCH_MAX = ...;
51 //vector PL_CROUCH_VIEW_OFS = ...;
54 # ifdef NO_LEGACY_NETWORKING
55 # define CSQCMODEL_AUTOINIT() CSQCModel_LinkEntity()
56 # define CSQCMODEL_AUTOUPDATE() CSQCModel_CheckUpdate()
59 float autocvar_sv_use_csqc_players;
60 # define CSQCMODEL_AUTOINIT() \
61 if(autocvar_sv_use_csqc_players) \
63 CSQCModel_LinkEntity(); \
64 self.iscsqcmodel = 1; \
68 # define CSQCMODEL_AUTOUPDATE() \
69 if(autocvar_sv_use_csqc_players && !self.iscsqcmodel) \
71 CSQCModel_LinkEntity(); \
72 self.iscsqcmodel = 1; \
74 if(!autocvar_sv_use_csqc_players && self.iscsqcmodel) \
76 CSQCModel_UnlinkEntity(); \
77 self.iscsqcmodel = 0; \
79 if(self.iscsqcmodel) \
80 CSQCModel_CheckUpdate()
84 #define CSQCMODEL_EF_RESPAWNGHOST EF_SELECTABLE