X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=progsvm.h;h=6bcb808a1dd75fa1db884a068eb2f32745e74c48;hp=406a9eb21cf5bfdaea156f931097fc6bf5e61f80;hb=85a33377d64ae8438e6582a7b8472f5a4bd41942;hpb=a57871c2f86386e3bed44f645aac4ef15c3024cf diff --git a/progsvm.h b/progsvm.h index 406a9eb2..6bcb808a 100644 --- a/progsvm.h +++ b/progsvm.h @@ -70,7 +70,7 @@ typedef struct prvm_required_field_s typedef struct prvm_edict_private_s { qboolean free; - float freetime; + float freetime; // realtime of last change to "free" (i.e. also set on allocation) int mark; // used during leaktest (0 = unref, >0 = referenced); special values during server physics: #define PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN -1 #define PRVM_EDICT_MARK_SETORIGIN_CAUGHT -2 @@ -116,43 +116,6 @@ typedef struct prvm_edict_s } fields; } prvm_edict_t; -#define VMPOLYGONS_MAXPOINTS 64 - -typedef struct vmpolygons_triangle_s -{ - rtexture_t *texture; - int drawflag; - qboolean hasalpha; - unsigned short elements[3]; -} vmpolygons_triangle_t; - -typedef struct vmpolygons_s -{ - mempool_t *pool; - qboolean initialized; - - int max_vertices; - int num_vertices; - float *data_vertex3f; - float *data_color4f; - float *data_texcoord2f; - - int max_triangles; - int num_triangles; - vmpolygons_triangle_t *data_triangles; - unsigned short *data_sortedelement3s; - - qboolean begin_active; - int begin_draw2d; - rtexture_t *begin_texture; - int begin_drawflag; - int begin_vertices; - float begin_vertex[VMPOLYGONS_MAXPOINTS][3]; - float begin_color[VMPOLYGONS_MAXPOINTS][4]; - float begin_texcoord[VMPOLYGONS_MAXPOINTS][2]; - qboolean begin_texture_hasalpha; -} vmpolygons_t; - extern prvm_eval_t prvm_badvalue; #define PRVM_alledictfloat(ed, fieldname) (PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname)) @@ -531,9 +494,10 @@ prvm_stringbuffer_t; typedef struct prvm_prog_s { double starttime; // system time when PRVM_Prog_Load was called + double inittime; // system time when QC initialization code finished (any entity created before is not a leak) double profiletime; // system time when last PRVM_CallProfile was called (or PRVM_Prog_Load initially) - unsigned int id; // increasing unique id of progs instance mfunction_t *functions; + int functions_covered; char *strings; int stringssize; ddef_t *fielddefs; @@ -562,8 +526,13 @@ typedef struct prvm_prog_s int numglobals; int *statement_linenums; // NULL if not available + int *statement_columnnums; // NULL if not available double *statement_profile; // only incremented if prvm_statementprofiling is on + int statements_covered; + double *explicit_profile; // only incremented if prvm_statementprofiling is on + int explicit_covered; + int numexplicitcoveragestatements; union { prvm_vec_t *fp; @@ -628,9 +597,17 @@ typedef struct prvm_prog_s // buffer for storing all tempstrings created during one invocation of ExecuteProgram sizebuf_t tempstringsbuf; - // LordHavoc: moved this here to clean up things that relied on prvm_prog_list too much - // FIXME: make VM_CL_R_Polygon functions use Debug_Polygon functions? - vmpolygons_t vmpolygons; + // in csqc the polygonbegin,polygonvertex,polygonend sequencing is + // stateful, so this tracks the last polygonbegin's choice of + // CL_Mesh_CSQC or CL_Mesh_UI for this polygon + dp_model_t *polygonbegin_model; + // indicates if polygonbegin should be interpreted as 2d + // (clearscene sets this to false, renderscene sets this to true, drawpic + // also sets this to true) + // note that in FTEQW polygonbegin with 2 args is handled very differently, + // where the behavior is always 3D unless DRAWFLAG_2D is passed, but + // DRAWFLAG_2D conflicts with our DRAWFLAG_SCREEN. + qboolean polygonbegin_guess2d; // copies of some vars that were former read from sv int num_edicts; @@ -677,6 +654,8 @@ typedef struct prvm_prog_s // printed together with backtraces const char *statestring; + struct animatemodel_cache *animatemodel_cache; + // prvm_builtin_mem_t *mem_list; // now passed as parameter of PRVM_LoadProgs @@ -724,7 +703,9 @@ prvm_prog_t *PRVM_FriendlyProgFromString(const char *str); // for console comman #define PRVM_ProgLoaded(n) (PRVM_GetProg(n)->loaded) #define SVVM_prog (&prvm_prog_list[PRVM_PROG_SERVER]) #define CLVM_prog (&prvm_prog_list[PRVM_PROG_CLIENT]) +#ifdef CONFIG_MENU #define MVM_prog (&prvm_prog_list[PRVM_PROG_MENU]) +#endif //============================================================================ // prvm_cmds part @@ -746,8 +727,10 @@ void SVVM_reset_cmd(prvm_prog_t *prog); void CLVM_init_cmd(prvm_prog_t *prog); void CLVM_reset_cmd(prvm_prog_t *prog); +#ifdef CONFIG_MENU void MVM_init_cmd(prvm_prog_t *prog); void MVM_reset_cmd(prvm_prog_t *prog); +#endif void VM_Cmd_Init(prvm_prog_t *prog); void VM_Cmd_Reset(prvm_prog_t *prog); @@ -758,11 +741,15 @@ void PRVM_Init (void); #ifdef PROFILING void SVVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage); void CLVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage); +#ifdef CONFIG_MENU void MVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage); +#endif #else #define SVVM_ExecuteProgram PRVM_ExecuteProgram #define CLVM_ExecuteProgram PRVM_ExecuteProgram +#ifdef CONFIG_MENU #define MVM_ExecuteProgram PRVM_ExecuteProgram +#endif void PRVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage); #endif @@ -883,4 +870,6 @@ void VM_FrameBlendFromFrameGroupBlend(frameblend_t *frameblend, const framegroup void VM_UpdateEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed, const dp_model_t *edmodel, const frameblend_t *frameblend); void VM_RemoveEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed); +void PRVM_ExplicitCoverageEvent(prvm_prog_t *prog, mfunction_t *func, int statement); + #endif