X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=progs.h;h=b69e0caac4801812f11d6ee1a1e8c95c0293906d;hb=279f0872533dc81f28514584be5e41481fc106da;hp=a6603d5d02337c58b139ffa6831036665c41eb4a;hpb=7305ab0695a23466c3554c8670c3b8a38bbc54a9;p=xonotic%2Fdarkplaces.git diff --git a/progs.h b/progs.h index a6603d5d..b69e0caa 100644 --- a/progs.h +++ b/progs.h @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -18,6 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef PROGS_H +#define PROGS_H + #include "pr_comp.h" // defs shared with qcc #include "progdefs.h" // generated by program cdefs @@ -29,32 +32,30 @@ typedef union eval_s func_t function; int _int; int edict; -} eval_t; +} eval_t; + +typedef struct link_s +{ + struct link_s *prev, *next; +} link_t; // LordHavoc: increased number of leafs per entity limit from 16 to 256 #define MAX_ENT_LEAFS 256 typedef struct edict_s { qboolean free; - link_t area; // linked to a division node or leaf - - int num_leafs; - short leafnums[MAX_ENT_LEAFS]; + link_t area; +#ifdef QUAKEENTITIES entity_state_t baseline; entity_state_t deltabaseline; // LordHavoc: previous frame - +#endif + + int suspendedinairflag; // LordHavoc: gross hack to make floating items still work float freetime; // sv.time when the object was freed - // LordHavoc: for MOVETYPE_STEP interpolation - vec3_t steporigin; - vec3_t stepangles; - vec3_t stepoldorigin; - vec3_t stepoldangles; - float steplerptime; entvars_t v; // C exported fields from progs // other fields from progs come immediately after } edict_t; -#define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l,edict_t,area) // LordHavoc: in an effort to eliminate time wasted on GetEdictFieldValue... see pr_edict.c for the functions which use these. extern int eval_gravity; @@ -86,11 +87,11 @@ extern int eval_viewmodelforclient; extern int eval_nodrawtoclient; extern int eval_exteriormodeltoclient; extern int eval_drawonlytoclient; -extern int eval_colormod; extern int eval_ping; extern int eval_movement; extern int eval_pmodel; extern int eval_punchvector; +extern int eval_viewzoom; #define GETEDICTFIELDVALUE(ed, fieldoffset) (fieldoffset ? (eval_t*)((char*)&ed->v + fieldoffset) : NULL) @@ -116,44 +117,43 @@ extern int pr_edictareasize; // LordHavoc: for bounds checking void PR_Init (void); -void PR_ExecuteProgram (func_t fnum, char *errormessage); +void PR_ExecuteProgram (func_t fnum, const char *errormessage); void PR_LoadProgs (void); void PR_Profile_f (void); +void PR_Crash (void); + edict_t *ED_Alloc (void); void ED_Free (edict_t *ed); -char *ED_NewString (char *string); +char *ED_NewString (const char *string); // returns a copy of the string allocated from the server's string heap void ED_Print (edict_t *ed); void ED_Write (QFile *f, edict_t *ed); -char *ED_ParseEdict (char *data, edict_t *ent); +const char *ED_ParseEdict (const char *data, edict_t *ent); void ED_WriteGlobals (QFile *f); -void ED_ParseGlobals (char *data); +void ED_ParseGlobals (const char *data); -void ED_LoadFromFile (char *data); +void ED_LoadFromFile (const char *data); edict_t *EDICT_NUM_ERROR(int n); -#define EDICT_NUM(n) (n >= 0 ? (n < sv.max_edicts ? (edict_t *)((byte *)sv.edicts + (n) * pr_edict_size) : EDICT_NUM_ERROR(n)) : EDICT_NUM_ERROR(n)) -//define EDICT_NUM(n) ((edict_t *)(sv.edicts+ (n)*pr_edict_size)) -//define NUM_FOR_EDICT(e) (((byte *)(e) - sv.edicts)/pr_edict_size) +#define EDICT_NUM(n) (n >= 0 ? (n < sv.max_edicts ? (edict_t *)((qbyte *)sv.edicts + (n) * pr_edict_size) : EDICT_NUM_ERROR(n)) : EDICT_NUM_ERROR(n)) -//edict_t *EDICT_NUM(int n); int NUM_FOR_EDICT(edict_t *e); -#define NEXT_EDICT(e) ((edict_t *)( (byte *)e + pr_edict_size)) +#define NEXT_EDICT(e) ((edict_t *)( (qbyte *)e + pr_edict_size)) -#define EDICT_TO_PROG(e) ((byte *)e - (byte *)sv.edicts) -#define PROG_TO_EDICT(e) ((edict_t *)((byte *)sv.edicts + e)) +#define EDICT_TO_PROG(e) ((qbyte *)e - (qbyte *)sv.edicts) +#define PROG_TO_EDICT(e) ((edict_t *)((qbyte *)sv.edicts + e)) //============================================================================ #define G_FLOAT(o) (pr_globals[o]) #define G_INT(o) (*(int *)&pr_globals[o]) -#define G_EDICT(o) ((edict_t *)((byte *)sv.edicts+ *(int *)&pr_globals[o])) +#define G_EDICT(o) ((edict_t *)((qbyte *)sv.edicts+ *(int *)&pr_globals[o])) #define G_EDICTNUM(o) NUM_FOR_EDICT(G_EDICT(o)) #define G_VECTOR(o) (&pr_globals[o]) #define G_STRING(o) (pr_strings + *(string_t *)&pr_globals[o]) @@ -178,10 +178,10 @@ extern int pr_xstatement; extern unsigned short pr_crc; -void PR_RunError (char *error, ...); +void PR_Execute_ProgsLoaded(void); void ED_PrintEdicts (void); void ED_PrintNum (int ent); -//eval_t *GetEdictFieldValue(edict_t *ed, char *field); +#endif