]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - progsvm.h
added GL_AlphaTest function to enable/disable GL_ALPHA_TEST
[xonotic/darkplaces.git] / progsvm.h
index aae25ce99ca5612ab353b5bc2ed0a422f34af7e8..673caea3a02955a1560117d34a9f2a1c8c36d065 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -31,6 +31,7 @@ The code uses void pointers instead.
 
 #include "pr_comp.h"                   // defs shared with qcc
 #include "progdefs.h"                  // generated by program cdefs
+#include "clprogdefs.h"                        // generated by program cdefs
 
 /*
 typedef union vm_eval_s
@@ -203,11 +204,13 @@ typedef struct prvm_edict_s
        union
        {
                void *vp;
-               entvars_t *server;
+               entvars_t               *server;
+               cl_entvars_t    *client;
        } fields;
 } prvm_edict_t;
 
-#define PRVM_GETEDICTFIELDVALUE(ed, fieldoffset) (fieldoffset ? (prvm_eval_t *)((qbyte *)ed->fields.vp + fieldoffset) : NULL)
+#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
@@ -266,6 +269,7 @@ typedef struct prvm_prog_s
        union {
                float *generic;
                globalvars_t *server;
+               cl_globalvars_t *client;
        } globals;
 
        int                                     maxknownstrings;
@@ -274,7 +278,7 @@ typedef struct prvm_prog_s
        // (simple optimization of the free string search)
        int                                     firstfreeknownstring;
        const char                      **knownstrings;
-       qbyte                           *knownstrings_freeable;
+       unsigned char                           *knownstrings_freeable;
        const char                      ***stringshash;
 
        // all memory allocations related to this vm_prog (code, edicts, strings)
@@ -430,6 +434,7 @@ 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);