]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - progs.h
got rid of AreaNode stuff, now only has AreaGrid (had to add sv_areagrid_outside...
[xonotic/darkplaces.git] / progs.h
diff --git a/progs.h b/progs.h
index f08a73fc481aebcb5150f50f11c99f001cf289c4..f9d1bde401a5f27bab9d9c5f012380b171f6d793 100644 (file)
--- a/progs.h
+++ b/progs.h
@@ -30,30 +30,49 @@ typedef union eval_s
        float                   _float;
        float                   vector[3];
        func_t                  function;
+       int                             ivector[3];
        int                             _int;
        int                             edict;
 } eval_t;
 
 typedef struct link_s
 {
+       void *entity;
        struct link_s   *prev, *next;
 } link_t;
 
-// LordHavoc: increased number of leafs per entity limit from 16 to 256
-#define        MAX_ENT_LEAFS   256
+#define ENTITYGRIDAREAS 16
+
+// the entire server entity structure
 typedef struct edict_s
 {
-       qboolean free; // true if this edict is unused
-       link_t area; // physics area this edict is linked into
-
+       // true if this edict is unused
+       qboolean free;
+       // physics grid areas this edict is linked into
+       link_t areagrid[ENTITYGRIDAREAS];
+       // since the areagrid can have multiple references to one entity,
+       // we should avoid extensive checking on entities already encountered
+       int areagridmarknumber;
+
+       // old entity protocol, not used
 #ifdef QUAKEENTITIES
-       entity_state_t baseline; // baseline values
-       entity_state_t deltabaseline; // LordHavoc: previous frame
+       // baseline values
+       entity_state_t baseline;
+       // LordHavoc: previous frame
+       entity_state_t deltabaseline;
 #endif
 
-       int suspendedinairflag; // LordHavoc: gross hack to make floating items still work
-       float freetime; // sv.time when the object was freed
-       entvars_t *v; // edict fields
+       // LordHavoc: gross hack to make floating items still work
+       int suspendedinairflag;
+       // sv.time when the object was freed (to prevent early reuse which could
+       // mess up client interpolation or obscure severe QuakeC bugs)
+       float freetime;
+       // used by PushMove to keep track of where objects were before they were
+       // moved, in case they need to be moved back
+       vec3_t moved_from;
+       vec3_t moved_fromangles;
+       // edict fields (stored in another array)
+       entvars_t *v;
 } edict_t;
 
 // LordHavoc: in an effort to eliminate time wasted on GetEdictFieldValue...  see pr_edict.c for the functions which use these.
@@ -95,13 +114,13 @@ extern int eval_viewzoom;
 #define GETEDICTFIELDVALUE(ed, fieldoffset) (fieldoffset ? (eval_t *)((qbyte *)ed->v + fieldoffset) : NULL)
 
 
-extern dfunction_t *SV_PlayerPhysicsQC;
-extern dfunction_t *EndFrameQC;
+extern mfunction_t *SV_PlayerPhysicsQC;
+extern mfunction_t *EndFrameQC;
 
 //============================================================================
 
 extern dprograms_t             *progs;
-extern dfunction_t             *pr_functions;
+extern mfunction_t             *pr_functions;
 extern char                    *pr_strings;
 extern ddef_t                  *pr_globaldefs;
 extern ddef_t                  *pr_fielddefs;
@@ -173,7 +192,7 @@ extern int pr_numbuiltins;
 extern int             pr_argc;
 
 extern int                     pr_trace;
-extern dfunction_t     *pr_xfunction;
+extern mfunction_t     *pr_xfunction;
 extern int                     pr_xstatement;
 
 extern unsigned short          pr_crc;
@@ -183,8 +202,8 @@ void PR_Execute_ProgsLoaded(void);
 void ED_PrintEdicts (void);
 void ED_PrintNum (int ent);
 
-char *PR_GetString (int num);
-int PR_SetString (char *s);
+#define PR_GetString(num) (pr_strings + num)
+#define PR_SetString(s) ((int) (s - pr_strings))
 
 #endif