]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - progsvm.h
fixed crashes when changing a few settings while playing a demo
[xonotic/darkplaces.git] / progsvm.h
index 0ef7dff3fc161e6fd32102bc8d1cc08d21f767e9..8f77619da01977c686f19fa9a83710423bb0807a 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -210,6 +210,7 @@ typedef struct prvm_edict_s
 } prvm_edict_t;
 
 #define PRVM_GETEDICTFIELDVALUE(ed, fieldoffset) (fieldoffset ? (prvm_eval_t *)((unsigned char *)ed->fields.vp + fieldoffset) : NULL)
+#define PRVM_GETGLOBALFIELDVALUE(fieldoffset) (fieldoffset ? (prvm_eval_t *)((unsigned char *)prog->globals.generic + fieldoffset) : NULL)
 
 /*// this struct is the basic requirement for a qc prog
 typedef struct prvm_pr_globalvars_s
@@ -265,6 +266,8 @@ typedef struct prvm_prog_s
 
        int                                     *statement_linenums; // NULL if not available
 
+       int                                     *statement_profile; // only incremented if prvm_statementprofiling is on
+
        union {
                float *generic;
                globalvars_t *server;
@@ -427,12 +430,14 @@ void _PRVM_Free (void *buffer, const char *filename, int fileline);
 void _PRVM_FreeAll (const char *filename, int fileline);
 
 void PRVM_Profile_f (void);
+void PRVM_PrintFunction_f (void);
 
 void PRVM_PrintState(void);
 void PRVM_CrashAll (void);
 void PRVM_Crash (void);
 
 int PRVM_ED_FindFieldOffset(const char *field);
+int PRVM_ED_FindGlobalOffset(const char *global);
 ddef_t *PRVM_ED_FindField (const char *name);
 mfunction_t *PRVM_ED_FindFunction (const char *name);
 
@@ -442,6 +447,7 @@ prvm_edict_t *PRVM_ED_Alloc (void);
 void PRVM_ED_Free (prvm_edict_t *ed);
 void PRVM_ED_ClearEdict (prvm_edict_t *e);
 
+void PRVM_PrintFunctionStatements (const char *name);
 void PRVM_ED_Print(prvm_edict_t *ed);
 void PRVM_ED_Write (qfile_t *f, prvm_edict_t *ed);
 const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent);