]> icculus.org git repositories - divverent/darkplaces.git/blob - progs.h
attempt to fix white flicker when r_water is toggled
[divverent/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
25 #define ENTITYGRIDAREAS 16
26 #define MAX_ENTITYCLUSTERS 16
27
28 #define JOINTTYPE_POINT 1
29 #define JOINTTYPE_HINGE 2
30 #define JOINTTYPE_SLIDER 3
31 #define JOINTTYPE_UNIVERSAL 4
32 #define JOINTTYPE_HINGE2 5
33 #define JOINTTYPE_FIXED -1
34
35 typedef struct edict_engineprivate_s
36 {
37         // true if this edict is unused
38         qboolean free;
39         // sv.time when the object was freed (to prevent early reuse which could
40         // mess up client interpolation or obscure severe QuakeC bugs)
41         float freetime;
42         // mark for the leak detector
43         int mark;
44         // place in the code where it was allocated (for the leak detector)
45         const char *allocation_origin;
46         // initially false to prevent projectiles from moving on their first frame
47         // (even if they were spawned by an synchronous client think)
48         qboolean move;
49
50         // cached cluster links for quick stationary object visibility checking
51         vec3_t cullmins, cullmaxs;
52         int pvs_numclusters;
53         int pvs_clusterlist[MAX_ENTITYCLUSTERS];
54
55         // physics grid areas this edict is linked into
56         link_t areagrid[ENTITYGRIDAREAS];
57         // since the areagrid can have multiple references to one entity,
58         // we should avoid extensive checking on entities already encountered
59         int areagridmarknumber;
60         // mins/maxs passed to World_LinkEdict
61         vec3_t areamins, areamaxs;
62
63         // PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKEWORLD
64         // baseline values
65         entity_state_t baseline;
66
67         // LordHavoc: gross hack to make floating items still work
68         int suspendedinairflag;
69
70         // cached position to avoid redundant SV_CheckWaterTransition calls on monsters
71         qboolean waterposition_forceupdate; // force an update on this entity (set by SV_PushMove code for moving water entities)
72         vec3_t waterposition_origin; // updates whenever this changes
73
74         // used by PushMove to keep track of where objects were before they were
75         // moved, in case they need to be moved back
76         vec3_t moved_from;
77         vec3_t moved_fromangles;
78
79         framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS];
80         frameblend_t frameblend[MAX_FRAMEBLENDS];
81         skeleton_t skeleton;
82
83         // physics parameters
84         qboolean ode_physics;
85         void *ode_body;
86         void *ode_geom;
87         void *ode_joint;
88         float *ode_vertex3f;
89         int *ode_element3i;
90         int ode_numvertices;
91         int ode_numtriangles;
92         vec3_t ode_mins;
93         vec3_t ode_maxs;
94         vec_t ode_mass;
95         vec3_t ode_origin;
96         vec3_t ode_velocity;
97         vec3_t ode_angles;
98         vec3_t ode_avelocity;
99         qboolean ode_gravity;
100         int ode_modelindex;
101         vec_t ode_movelimit; // smallest component of (maxs[]-mins[])
102         matrix4x4_t ode_offsetmatrix;
103         matrix4x4_t ode_offsetimatrix;
104         int ode_joint_type;
105         int ode_joint_enemy;
106         int ode_joint_aiment;
107         vec3_t ode_joint_origin; // joint anchor
108         vec3_t ode_joint_angles; // joint axis
109         vec3_t ode_joint_velocity; // second joint axis
110         vec3_t ode_joint_movedir; // parameters
111         void *ode_massbuf;
112 }
113 edict_engineprivate_t;
114
115 #endif