]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/csqcmodel_settings.qh
Merge branch 'master' of git://de.git.xonotic.org/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / csqcmodel_settings.qh
1 // define this if svqc code wants to use .frame2 and .lerpfrac
2 #define CSQCMODEL_HAVE_TWO_FRAMES
3
4 // don't define this ever
5 //#define CSQCMODEL_SUPPORT_GETTAGINFO_BEFORE_DRAW
6
7 // a hack for Xonotic
8 #ifdef CSQC
9 # define TAG_ENTITY_NAME tag_networkentity
10 # define TAG_ENTITY_TYPE float
11 .float tag_networkentity;
12 #else
13 # define TAG_ENTITY_NAME tag_entity
14 # define TAG_ENTITY_TYPE entity
15 #endif
16
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) \
25         CSQCMODEL_ENDIF \
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) \
31         CSQCMODEL_ENDIF
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
33
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
42
43 // force updates of player entities that often even if unchanged
44 #define CSQCPLAYER_FORCE_UPDATES 0.25
45
46 // mod must define:
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  = ...;
53
54 #ifdef SVQC
55 # ifdef NO_LEGACY_NETWORKING
56 #  define CSQCMODEL_AUTOINIT() CSQCModel_LinkEntity()
57 #  define CSQCMODEL_AUTOUPDATE() CSQCModel_CheckUpdate()
58 # else
59 .float iscsqcmodel;
60 float autocvar_sv_use_csqc_players;
61 #  define CSQCMODEL_AUTOINIT() \
62         if(autocvar_sv_use_csqc_players) \
63         { \
64                 CSQCModel_LinkEntity(); \
65                 self.iscsqcmodel = 1; \
66         } \
67         else \
68                 self.iscsqcmodel = 0
69 #  define CSQCMODEL_AUTOUPDATE() \
70         if(autocvar_sv_use_csqc_players && !self.iscsqcmodel) \
71         { \
72                 CSQCModel_LinkEntity(); \
73                 self.iscsqcmodel = 1; \
74         } \
75         if(!autocvar_sv_use_csqc_players && self.iscsqcmodel) \
76         { \
77                 CSQCModel_UnlinkEntity(); \
78                 self.iscsqcmodel = 0; \
79         } \
80         if(self.iscsqcmodel) \
81                 CSQCModel_CheckUpdate()
82 # endif
83 #endif
84
85 #define CSQCMODEL_EF_INVISIBLE EF_SELECTABLE