]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - progsvm.h
Remove the CONFIG_CD macro, and enable faketracks unconditionally.
[xonotic/darkplaces.git] / progsvm.h
index fb40545e8fbca2bbdd4097d2c919e613253bff9e..6bcb808a1dd75fa1db884a068eb2f32745e74c48 100644 (file)
--- 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,8 +494,8 @@ 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;
@@ -634,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;
@@ -683,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
@@ -897,6 +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, int statement);
+void PRVM_ExplicitCoverageEvent(prvm_prog_t *prog, mfunction_t *func, int statement);
 
 #endif