X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=progsvm.h;h=1251944b3054f610e4a8abb75aa507de6a83ae4f;hp=ce900af775355dc28c343485a8c1d20c03ca84ff;hb=ec4de32a3e07ae7193b0609fc7f41a73e8de58df;hpb=5aba57f18381d282c8a1be1dd5784bd94ec9f7f2 diff --git a/progsvm.h b/progsvm.h index ce900af7..1251944b 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; @@ -67,7 +69,7 @@ typedef struct prvm_edict_private_s { qboolean free; float freetime; - qboolean marked; + int mark; const char *allocation_origin; } prvm_edict_private_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; @@ -128,7 +130,8 @@ typedef struct prvm_prog_fieldoffsets_s { // server and client use a lot of similar fields, so this is combined int SendEntity; // ssqc - int Version; // ssqc + int SendFlags; // ssqc + int Version; // ssqc (legacy) int alpha; // ssqc / csqc int ammo_cells1; // ssqc - Dissolution of Eternity mission pack int ammo_lava_nails; // ssqc - Dissolution of Eternity mission pack @@ -156,7 +159,9 @@ typedef struct prvm_prog_fieldoffsets_s int buttonuse; // ssqc int chain; // common - used by find builtins int classname; // common + int clientcamera; // ssqc int clientcolors; // ssqc + int clientstatus; // ssqc int color; // ssqc int colormod; // ssqc / csqc int contentstransition; // ssqc @@ -178,17 +183,24 @@ typedef struct prvm_prog_fieldoffsets_s int frame1time; // csqc int frame2; // csqc int frame2time; // csqc + int frame3; // csqc + int frame3time; // csqc + int frame4; // csqc + int frame4time; // csqc int frame; // common - used by OP_STATE int fullbright; // ssqc - Nehahra support 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 int ideal_yaw; // ssqc / csqc int idealpitch; // ssqc / csqc int items2; // ssqc + int lerpfrac3; // csqc + int lerpfrac4; // csqc int lerpfrac; // csqc int light_lev; // ssqc int message; // csqc @@ -209,6 +221,8 @@ typedef struct prvm_prog_fieldoffsets_s int renderflags; // csqc 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 @@ -216,7 +230,27 @@ typedef struct prvm_prog_fieldoffsets_s int viewmodelforclient; // ssqc int viewzoom; // ssqc int yaw_speed; // ssqc / csqc - int clientcamera; // ssqc + 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; @@ -240,6 +274,7 @@ typedef struct prvm_prog_globaloffsets_s int trace_plane_normal; // ssqc / csqc int trace_plane_dist; // ssqc / csqc int trace_ent; // ssqc / csqc + int trace_networkentity; // csqc int trace_dphitcontents; // ssqc / csqc int trace_dphitq3surfaceflags; // ssqc / csqc int trace_dphittexturename; // ssqc / csqc @@ -253,6 +288,17 @@ typedef struct prvm_prog_globaloffsets_s int sb_showscores; // csqc int drawfont; // csqc / menu int require_spawnfunc_prefix; // ssqc + int worldstatus; // ssqc + int servertime; // csqc + int serverprevtime; // csqc + int serverdeltatime; // csqc + int gettaginfo_name; // ssqc / csqc + int gettaginfo_parent; // ssqc / csqc + int gettaginfo_offset; // ssqc / csqc + int gettaginfo_forward; // ssqc / csqc + int gettaginfo_right; // ssqc / csqc + int gettaginfo_up; // ssqc / csqc + int transparent_offset; // csqc } prvm_prog_globaloffsets_t; @@ -280,9 +326,13 @@ typedef struct prvm_prog_funcoffsets_s func_t SV_ChangeTeam; // ssqc func_t SV_ParseClientCommand; // ssqc func_t SV_PlayerPhysics; // ssqc + func_t SV_OnEntityPreSpawnFunction; // ssqc func_t SV_OnEntityNoSpawnFunction; // ssqc + func_t SV_OnEntityPostSpawnFunction; // ssqc func_t GameCommand; // any func_t SV_Shutdown; // ssqc + func_t URI_Get_Callback; // any + func_t SV_PausedTic; //ssqc // menu qc only uses some functions, nothing else func_t m_draw; // mqc @@ -315,15 +365,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; @@ -373,6 +423,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; @@ -385,7 +436,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 @@ -413,6 +464,9 @@ typedef struct prvm_prog_s qboolean loaded; qboolean leaktest_active; + // printed together with backtraces + const char *statestring; + // prvm_builtin_mem_t *mem_list; // now passed as parameter of PRVM_LoadProgs @@ -441,6 +495,7 @@ typedef struct prvm_prog_s 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; @@ -481,7 +536,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__) @@ -490,8 +548,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); @@ -499,7 +558,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); @@ -513,6 +572,7 @@ func_t PRVM_ED_FindFunctionOffset(const char *name); void PRVM_MEM_IncreaseEdicts(void); +qboolean PRVM_ED_CanAlloc(prvm_edict_t *e); prvm_edict_t *PRVM_ED_Alloc (void); void PRVM_ED_Free (prvm_edict_t *ed); void PRVM_ED_ClearEdict (prvm_edict_t *e); @@ -621,4 +681,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