]> git.xonotic.org Git - xonotic/darkplaces.git/blob - progs.h
README, sdl, sys, makefile: Bring up macOS support
[xonotic/darkplaces.git] / progs.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20
21 #ifndef PROGS_H
22 #define PROGS_H
23 #include "pr_comp.h"                    // defs shared with qcc
24 #include "qtypes.h"
25
26
27 #define ENTITYGRIDAREAS 16
28 #define MAX_ENTITYCLUSTERS 16
29
30 #ifdef PRVM_64
31 #define PRVM_FLOAT_IS_TRUE_FOR_INT(x) DOUBLE_IS_TRUE_FOR_INT(x)
32 #define PRVM_FLOAT_LOSSLESS_FORMAT DOUBLE_LOSSLESS_FORMAT
33 #define PRVM_VECTOR_LOSSLESS_FORMAT DOUBLE_VECTOR_LOSSLESS_FORMAT
34 #else
35 #define PRVM_FLOAT_IS_TRUE_FOR_INT(x) FLOAT_IS_TRUE_FOR_INT(x)
36 #define PRVM_FLOAT_LOSSLESS_FORMAT FLOAT_LOSSLESS_FORMAT
37 #define PRVM_VECTOR_LOSSLESS_FORMAT FLOAT_VECTOR_LOSSLESS_FORMAT
38 #endif
39
40 #ifdef USEODE
41 #define GEOMTYPE_NONE      -1
42 #define GEOMTYPE_SOLID      0
43 #define GEOMTYPE_BOX            1
44 #define GEOMTYPE_SPHERE         2
45 #define GEOMTYPE_CAPSULE        3
46 #define GEOMTYPE_TRIMESH        4
47 #define GEOMTYPE_CYLINDER       5
48 #define GEOMTYPE_CAPSULE_X      6
49 #define GEOMTYPE_CAPSULE_Y      7
50 #define GEOMTYPE_CAPSULE_Z      8
51 #define GEOMTYPE_CYLINDER_X     9
52 #define GEOMTYPE_CYLINDER_Y     10
53 #define GEOMTYPE_CYLINDER_Z     11
54
55 #define JOINTTYPE_NONE      0
56 #define JOINTTYPE_POINT     1
57 #define JOINTTYPE_HINGE     2
58 #define JOINTTYPE_SLIDER    3
59 #define JOINTTYPE_UNIVERSAL 4
60 #define JOINTTYPE_HINGE2    5
61 #define JOINTTYPE_FIXED    -1
62
63 #define FORCETYPE_NONE       0
64 #define FORCETYPE_FORCE      1
65 #define FORCETYPE_FORCEATPOS 2
66 #define FORCETYPE_TORQUE     3
67
68 #define ODEFUNC_ENABLE          1
69 #define ODEFUNC_DISABLE         2
70 #define ODEFUNC_FORCE       3
71 #define ODEFUNC_TORQUE      4
72
73 typedef struct edict_odefunc_s
74 {
75         int type;
76         vec3_t v1;
77         vec3_t v2;
78         struct edict_odefunc_s *next;
79 }edict_odefunc_t;
80 #endif
81
82 typedef struct edict_engineprivate_s
83 {
84         // mark for the leak detector
85         int mark;
86         // place in the code where it was allocated (for the leak detector)
87         const char *allocation_origin;
88
89         // initially false to prevent projectiles from moving on their first frame
90         // (even if they were spawned by an synchronous client think)
91         qbool move;
92
93         // cached cluster links for quick stationary object visibility checking
94         vec3_t cullmins, cullmaxs;
95         int pvs_numclusters;
96         int pvs_clusterlist[MAX_ENTITYCLUSTERS];
97
98         // physics grid areas this edict is linked into
99         link_t areagrid[ENTITYGRIDAREAS];
100         // since the areagrid can have multiple references to one entity,
101         // we should avoid extensive checking on entities already encountered
102         int areagridmarknumber;
103         // mins/maxs passed to World_LinkEdict
104         vec3_t areamins, areamaxs;
105
106         // PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKEWORLD
107         // baseline values
108         entity_state_t baseline;
109
110         // LadyHavoc: gross hack to make floating items still work
111         int suspendedinairflag;
112
113         // cached position to avoid redundant SV_CheckWaterTransition calls on monsters
114         qbool waterposition_forceupdate; // force an update on this entity (set by SV_PushMove code for moving water entities)
115         vec3_t waterposition_origin; // updates whenever this changes
116
117         // used by PushMove to keep track of where objects were before they were
118         // moved, in case they need to be moved back
119         vec3_t moved_from;
120         vec3_t moved_fromangles;
121
122         framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS];
123         frameblend_t frameblend[MAX_FRAMEBLENDS];
124         skeleton_t skeleton;
125
126 #ifdef USEODE
127         // physics parameters
128         qbool ode_physics;
129         void *ode_body;
130         void *ode_geom;
131         void *ode_joint;
132         float *ode_vertex3f;
133         int *ode_element3i;
134         int ode_numvertices;
135         int ode_numtriangles;
136         edict_odefunc_t *ode_func;
137         vec3_t ode_mins;
138         vec3_t ode_maxs;
139         vec3_t ode_scale;
140         vec_t ode_mass;
141         float ode_friction;
142         vec3_t ode_origin;
143         vec3_t ode_velocity;
144         vec3_t ode_angles;
145         vec3_t ode_avelocity;
146         qbool ode_gravity;
147         int ode_modelindex;
148         vec_t ode_movelimit; // smallest component of (maxs[]-mins[])
149         matrix4x4_t ode_offsetmatrix;
150         matrix4x4_t ode_offsetimatrix;
151         int ode_joint_type;
152         int ode_joint_enemy;
153         int ode_joint_aiment;
154         vec3_t ode_joint_origin; // joint anchor
155         vec3_t ode_joint_angles; // joint axis
156         vec3_t ode_joint_velocity; // second joint axis
157         vec3_t ode_joint_movedir; // parameters
158         void *ode_massbuf;
159 #endif
160 }
161 edict_engineprivate_t;
162
163 #endif