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
} 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))
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;
// 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;
// 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
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