]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - csprogs.c
make DP compile with C++ again
[xonotic/darkplaces.git] / csprogs.c
index 3961e6bf85f38f4cb072b47afd9a8cc079d45ff2..8539312e897ae41b1d3e84c459f76cedd2d3d55e 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -69,6 +69,22 @@ void CL_VM_UpdateDmgGlobals (int dmg_take, int dmg_save, vec3_t dmg_origin)
                CSQC_END
        }
 }
+
+void CSQC_UpdateNetworkTimes(double newtime, double oldtime)
+{
+       prvm_eval_t *val;
+       if(!cl.csqc_loaded)
+               return;
+       CSQC_BEGIN
+       if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.servertime)))
+               val->_float = newtime;
+       if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.serverprevtime)))
+               val->_float = oldtime;
+       if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.serverdeltatime)))
+               val->_float = newtime - oldtime;
+       CSQC_END
+}
+
 //[515]: set globals before calling R_UpdateView, WEIRD CRAP
 static void CSQC_SetGlobals (void)
 {
@@ -188,8 +204,8 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed)
        // self.frame1time is the animation base time for the interpolation target
        // self.frame2 is the interpolation start (previous frame)
        // self.frame2time is the animation base time for the interpolation start
-       entrender->frame1 = entrender->frame2 = ed->fields.client->frame;
-       if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2))) entrender->frame2 = val->_float;
+       entrender->frame1 = entrender->frame2 = (int) ed->fields.client->frame;
+       if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2))) entrender->frame2 = (int) val->_float;
        if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame1time))) entrender->frame2time = val->_float;
        if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2time))) entrender->frame1time = val->_float;
        if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.lerpfrac))) entrender->framelerp = val->_float;
@@ -504,7 +520,7 @@ void CL_VM_UpdateShowingScoresState (int showingscores)
                CSQC_END
        }
 }
-qboolean CL_VM_Event_Sound(int sound_num, int volume, int channel, float attenuation, int ent, vec3_t pos)
+qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos)
 {
        qboolean r = false;
        if(cl.csqc_loaded)
@@ -864,7 +880,7 @@ void CL_VM_Init (void)
                        sizebuf_t sb;
                        unsigned char *demobuf; fs_offset_t demofilesize;
 
-                       sb.data = (void *) buf;
+                       sb.data = (unsigned char *) buf;
                        sb.maxsize = sizeof(buf);
                        i = 0;