X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=progsvm.h;h=2dd9e0ff1f4d4fe7416e5c75e262dfae79f31886;hb=66d1df20a5ed5ff954d7bf9db2db23cbe304281a;hp=b14c99fa8f873b07911453dd0946e1b5628afecb;hpb=9c086b32f381d18eddf8f081504b026cf16fa412;p=xonotic%2Fdarkplaces.git diff --git a/progsvm.h b/progsvm.h index b14c99fa..2dd9e0ff 100644 --- a/progsvm.h +++ b/progsvm.h @@ -40,6 +40,8 @@ typedef struct prvm_stack_s { int s; mfunction_t *f; + double profile_acc; + double builtinsprofile_acc; } prvm_stack_t; @@ -78,7 +80,7 @@ typedef struct prvm_edict_s union { prvm_edict_private_t *required; - void *vp; + vec_t *vp; // FIXME: this server pointer really means world, not server // (it is used by both server qc and client qc, but not menu qc) edict_engineprivate_t *server; @@ -102,7 +104,7 @@ typedef struct prvm_edict_s // QuakeC fields (stored in dynamically resized array) union { - void *vp; + vec_t *vp; entvars_t *server; cl_entvars_t *client; } fields; @@ -190,6 +192,7 @@ typedef struct prvm_prog_fieldoffsets_s int glow_color; // ssqc int glow_size; // ssqc int glow_trail; // ssqc + int glowmod; // ssqc / csqc int gravity; // ssqc int groundentity; // ssqc / csqc int hull; // ssqc / csqc @@ -219,6 +222,7 @@ typedef struct prvm_prog_fieldoffsets_s int rendermode; // ssqc - HalfLife support int scale; // ssqc / csqc int shadertime; // csqc + int skeletonindex; // csqc / ssqc FTE_CSQC_SKELETONOBJECTS / DP_SKELETONOBJECTS int style; // ssqc int tag_entity; // ssqc / csqc int tag_index; // ssqc / csqc @@ -228,6 +232,25 @@ typedef struct prvm_prog_fieldoffsets_s int yaw_speed; // ssqc / csqc int bouncefactor; // ssqc int bouncestop; // ssqc + + int solid; // ssqc / csqc (physics) + int movetype; // ssqc / csqc (physics) + int modelindex; // ssqc / csqc (physics) + int mins; // ssqc / csqc (physics) + int maxs; // ssqc / csqc (physics) + int mass; // ssqc / csqc (physics) + int origin; // ssqc / csqc (physics) + int velocity; // ssqc / csqc (physics) + //int axis_forward; // ssqc / csqc (physics) + //int axis_left; // ssqc / csqc (physics) + //int axis_up; // ssqc / csqc (physics) + //int spinvelocity; // ssqc / csqc (physics) + //int angles; // ssqc / csqc (physics) + int avelocity; // ssqc / csqc (physics) + int jointtype; // ssqc / csqc (physics) + int enemy; // ssqc / csqc (physics) + int aiment; // ssqc / csqc (physics) + int movedir; // ssqc / csqc (physics) } prvm_prog_fieldoffsets_t; @@ -275,6 +298,7 @@ typedef struct prvm_prog_globaloffsets_s int gettaginfo_forward; // ssqc / csqc int gettaginfo_right; // ssqc / csqc int gettaginfo_up; // ssqc / csqc + int transparent_offset; // csqc } prvm_prog_globaloffsets_t; @@ -334,6 +358,7 @@ prvm_stringbuffer_t; typedef struct prvm_prog_s { double starttime; + unsigned int id; // increasing unique id of progs instance dprograms_t *progs; mfunction_t *functions; char *strings; @@ -341,15 +366,15 @@ typedef struct prvm_prog_s ddef_t *fielddefs; ddef_t *globaldefs; dstatement_t *statements; - int edict_size; // in bytes - int edictareasize; // LordHavoc: in bytes (for bound checking) + int entityfields; // number of vec_t fields in progs (some variables are 3) + int entityfieldsarea; // LordHavoc: equal to max_edicts * entityfields (for bounds checking) int *statement_linenums; // NULL if not available double *statement_profile; // only incremented if prvm_statementprofiling is on union { - float *generic; + vec_t *generic; globalvars_t *server; cl_globalvars_t *client; } globals; @@ -399,6 +424,7 @@ typedef struct prvm_prog_s fssearch_t *opensearches[PRVM_MAX_OPENSEARCHES]; const char * opensearches_origin[PRVM_MAX_OPENSEARCHES]; struct clgecko_s *opengeckoinstances[PRVM_MAX_GECKOINSTANCES]; + skeleton_t *skeletons[MAX_EDICTS]; // copies of some vars that were former read from sv int num_edicts; @@ -411,7 +437,7 @@ typedef struct prvm_prog_s int reserved_edicts; // [INIT] prvm_edict_t *edicts; - void *edictsfields; + vec_t *edictsfields; void *edictprivate; // size of the engine private struct @@ -469,6 +495,8 @@ typedef struct prvm_prog_s void (*reset_cmd)(void); // [INIT] used by PRVM_ResetProg void (*error_cmd)(const char *format, ...) DP_FUNC_PRINTF(1); // [INIT] + + void (*ExecuteProgram)(func_t fnum, const char *errormessage); // pointer to one of the *VM_ExecuteProgram functions } prvm_prog_t; extern prvm_prog_t * prog; @@ -509,7 +537,10 @@ void VM_Cmd_Reset(void); void PRVM_Init (void); -void PRVM_ExecuteProgram (func_t fnum, const char *errormessage); +void MVM_ExecuteProgram (func_t fnum, const char *errormessage); +void CLVM_ExecuteProgram (func_t fnum, const char *errormessage); +void SVVM_ExecuteProgram (func_t fnum, const char *errormessage); +#define PRVM_ExecuteProgram prog->ExecuteProgram #define PRVM_Alloc(buffersize) _PRVM_Alloc(buffersize, __FILE__, __LINE__) #define PRVM_Free(buffer) _PRVM_Free(buffer, __FILE__, __LINE__) @@ -518,8 +549,9 @@ void *_PRVM_Alloc (size_t buffersize, const char *filename, int fileline); void _PRVM_Free (void *buffer, const char *filename, int fileline); void _PRVM_FreeAll (const char *filename, int fileline); -void PRVM_Profile (int maxfunctions, int mininstructions); +void PRVM_Profile (int maxfunctions, int mininstructions, int sortby); void PRVM_Profile_f (void); +void PRVM_ChildProfile_f (void); void PRVM_CallProfile_f (void); void PRVM_PrintFunction_f (void); @@ -527,7 +559,7 @@ void PRVM_PrintState(void); void PRVM_CrashAll (void); void PRVM_Crash (void); void PRVM_ShortStackTrace(char *buf, size_t bufsize); -const char *PRVM_AllocationOrigin(); +const char *PRVM_AllocationOrigin(void); ddef_t *PRVM_ED_FindField(const char *name); ddef_t *PRVM_ED_FindGlobal(const char *name); @@ -597,6 +629,7 @@ void PRVM_ED_PrintNum (int ent, const char *wildcard_fieldname); const char *PRVM_GetString(int num); int PRVM_SetEngineString(const char *s); +const char *PRVM_ChangeEngineString(int i, const char *s); int PRVM_SetTempString(const char *s); int PRVM_AllocString(size_t bufferlength, char **pointer); void PRVM_FreeString(int num); @@ -650,4 +683,9 @@ void VM_Warning(const char *fmt, ...) DP_FUNC_PRINTF(1); // TODO: fill in the params //void PRVM_Create(); +void VM_GenerateFrameGroupBlend(framegroupblend_t *framegroupblend, const prvm_edict_t *ed); +void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroupblend_t *framegroupblend, const dp_model_t *model); +void VM_UpdateEdictSkeleton(prvm_edict_t *ed, const dp_model_t *edmodel, const frameblend_t *frameblend); +void VM_RemoveEdictSkeleton(prvm_edict_t *ed); + #endif