]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - csprogs.h
support viewentity to be shared; DP_CSQC_V_CALCREFDEF
[xonotic/darkplaces.git] / csprogs.h
1 #ifndef CSPROGS_H
2 #define CSPROGS_H
3
4 // LordHavoc: changed to match MAX_EDICTS
5 #define CL_MAX_EDICTS MAX_EDICTS
6
7 #define ENTMASK_ENGINE                          1
8 #define ENTMASK_ENGINEVIEWMODELS        2
9 #define ENTMASK_NORMAL                          4
10
11 #define VF_MIN                  1       //(vector)
12 #define VF_MIN_X                2       //(float)
13 #define VF_MIN_Y                3       //(float)
14 #define VF_SIZE                 4       //(vector) (viewport size)
15 #define VF_SIZE_X               5       //(float)
16 #define VF_SIZE_Y               6       //(float)
17 #define VF_VIEWPORT             7       //(vector, vector)
18 #define VF_FOV                  8       //(vector)
19 #define VF_FOVX                 9       //(float)
20 #define VF_FOVY                 10      //(float)
21 #define VF_ORIGIN               11      //(vector)
22 #define VF_ORIGIN_X             12      //(float)
23 #define VF_ORIGIN_Y             13      //(float)
24 #define VF_ORIGIN_Z             14      //(float)
25 #define VF_ANGLES               15      //(vector)
26 #define VF_ANGLES_X             16      //(float)
27 #define VF_ANGLES_Y             17      //(float)
28 #define VF_ANGLES_Z             18      //(float)
29
30 #define VF_DRAWWORLD            19      //(float)       //actually world model and sky
31 #define VF_DRAWENGINESBAR       20      //(float)
32 #define VF_DRAWCROSSHAIR        21      //(float)
33
34 #define VF_CL_VIEWANGLES        33      //(vector)      //sweet thing for RPGs/...
35 #define VF_CL_VIEWANGLES_X      34      //(float)
36 #define VF_CL_VIEWANGLES_Y      35      //(float)
37 #define VF_CL_VIEWANGLES_Z      36      //(float)
38
39 #define VF_PERSPECTIVE          200 //(float)
40 #define VF_CLEARSCREEN          201 //(float)
41
42 #define VF_FOG_DENSITY          202 //(float)
43 #define VF_FOG_COLOR            203 //(vector)
44 #define VF_FOG_COLOR_R          204 //(float)
45 #define VF_FOG_COLOR_G          205 //(float)
46 #define VF_FOG_COLOR_B          206 //(float)
47 #define VF_FOG_ALPHA            207 //(float)
48 #define VF_FOG_START            208 //(float)
49 #define VF_FOG_END              209 //(float)
50 #define VF_FOG_HEIGHT           210 //(float)
51 #define VF_FOG_FADEDEPTH        211 //(float)
52 #define VF_MAINVIEW             212 //(float)
53 #define VF_MINFPS_QUALITY       213 //(float)
54
55 #define RF_VIEWMODEL            1       // The entity is never drawn in mirrors. In engines with realtime lighting, it casts no shadows.
56 #define RF_EXTERNALMODEL        2       // The entity is appears in mirrors but not in the normal view. It does still cast shadows in engines with realtime lighting.
57 #define RF_DEPTHHACK            4       // The entity appears closer to the view than normal, either by scaling it wierdly or by just using a depthrange. This will usually be found in conjunction with RF_VIEWMODEL
58 #define RF_ADDITIVE                     8       // Add the entity acording to it's alpha values instead of the normal blend
59 #define RF_USEAXIS                      16      // When set, the entity will use the v_forward, v_right and v_up globals instead of it's angles field for orientation. Angles will be ignored compleatly.
60                                                                 // Note that to use this properly, you'll NEED to use the predraw function to set the globals.
61 //#define RF_DOUBLESIDED                32
62 #define RF_USETRANSPARENTOFFSET 64   // Allows QC to customize origin used for transparent sorting via transparent_origin global, helps to fix transparent sorting bugs on a very large entities
63 #define RF_WORLDOBJECT          128  // for large outdoor entities that should not be culled
64 #define RF_MODELLIGHT           4096 // CSQC-set model light
65
66 #define RF_FULLBRIGHT                   256
67 #define RF_NOSHADOW                             512
68
69 extern cvar_t csqc_progname;    //[515]: csqc crc check and right csprogs name according to progs.dat
70 extern cvar_t csqc_progcrc;
71 extern cvar_t csqc_progsize;
72
73 void CL_VM_PreventInformationLeaks(void);
74
75 qboolean MakeDownloadPacket(const char *filename, unsigned char *data, size_t len, int crc, int cnt, sizebuf_t *buf, int protocol);
76
77 qboolean CL_VM_GetEntitySoundOrigin(int entnum, vec3_t out);
78
79 qboolean CL_VM_TransformView(int entnum, matrix4x4_t *viewmatrix, mplane_t *clipplane, vec3_t visorigin);
80
81 void CL_VM_Init(void);
82 void CL_VM_ShutDown(void);
83 void CL_VM_UpdateIntermissionState(int intermission);
84 void CL_VM_UpdateShowingScoresState(int showingscores);
85 qboolean CL_VM_InputEvent(int eventtype, int x, int y);
86 qboolean CL_VM_ConsoleCommand(const char *cmd);
87 void CL_VM_UpdateDmgGlobals(int dmg_take, int dmg_save, vec3_t dmg_origin);
88 void CL_VM_UpdateIntermissionState(int intermission);
89 qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos, int flags, float speed);
90 qboolean CL_VM_Parse_TempEntity(void);
91 void CL_VM_Parse_StuffCmd(const char *msg);
92 void CL_VM_Parse_CenterPrint(const char *msg);
93 int CL_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent);
94 int CL_GetTagMatrix(prvm_prog_t *prog, matrix4x4_t *out, prvm_edict_t *ent, int tagindex);
95 void CL_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatrix);
96 /* VMs exposing the polygon calls must call this on Init/Reset */
97 void VM_Polygons_Reset(prvm_prog_t *prog);
98 void QW_CL_StartUpload(unsigned char *data, int size);
99
100 void CSQC_UpdateNetworkTimes(double newtime, double oldtime);
101 void CSQC_AddPrintText(const char *msg);
102 void CSQC_ReadEntities(void);
103 void CSQC_RelinkAllEntities(int drawmask);
104 void CSQC_RelinkCSQCEntities(void);
105 void CSQC_Predraw(prvm_edict_t *ed);
106 void CSQC_Think(prvm_edict_t *ed);
107 qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum);//csprogs.c
108 void CSQC_R_RecalcView(void);
109
110 dp_model_t *CL_GetModelByIndex(int modelindex);
111
112 int CL_VM_GetViewEntity(void);
113
114 #endif