return true;
}
-qboolean CL_VM_InputEvent (qboolean down, int key, int ascii)
+// 0 = keydown, key, character (EXT_CSQC)
+// 1 = keyup, key, character (EXT_CSQC)
+// 2 = mousemove relative, x, y (EXT_CSQC)
+// 3 = mousemove absolute, x, y (DP_CSQC)
+qboolean CL_VM_InputEvent (int eventtype, int x, int y)
{
qboolean r;
{
PRVM_clientglobalfloat(time) = cl.time;
PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
- PRVM_G_FLOAT(OFS_PARM0) = !down; // 0 is down, 1 is up
- PRVM_G_FLOAT(OFS_PARM1) = key;
- PRVM_G_FLOAT(OFS_PARM2) = ascii;
+ PRVM_G_FLOAT(OFS_PARM0) = eventtype;
+ PRVM_G_FLOAT(OFS_PARM1) = x; // key or x
+ PRVM_G_FLOAT(OFS_PARM2) = y; // ascii or y
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_InputEvent), "QC function CSQC_InputEvent is missing");
r = CSQC_RETURNVAL != 0;
}
PRVM_clientglobalfloat(time) = cl.time;
PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
PRVM_G_FLOAT(OFS_PARM0) = ent;
- PRVM_G_FLOAT(OFS_PARM1) = channel;
+ PRVM_G_FLOAT(OFS_PARM1) = CHAN_ENGINE2USER(channel);
PRVM_G_INT(OFS_PARM2) = PRVM_SetTempString(cl.sound_name[sound_num] );
PRVM_G_FLOAT(OFS_PARM3) = volume;
PRVM_G_FLOAT(OFS_PARM4) = attenuation;
VectorCopy(pos, PRVM_G_VECTOR(OFS_PARM5) );
+ PRVM_G_FLOAT(OFS_PARM6) = 0; // pitch shift not supported yet
+ PRVM_G_FLOAT(OFS_PARM7) = 0; // flags - none can come in at this point yet
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Event_Sound), "QC function CSQC_Event_Sound is missing");
r = CSQC_RETURNVAL != 0;
}
return false;
}
+extern cvar_t csqc_usedemoprogs;
void CL_VM_Init (void)
{
const char* csprogsfn;
- unsigned char *csprogsdata;
+ unsigned char *csprogsdata = NULL;
fs_offset_t csprogsdatasize;
int csprogsdatacrc, requiredcrc;
int requiredsize;
// see if the requested csprogs.dat file matches the requested crc
csprogsdatacrc = -1;
- csprogsfn = va("dlcache/%s.%i.%i", csqc_progname.string, requiredsize, requiredcrc);
- csprogsdata = FS_LoadFile(csprogsfn, tempmempool, true, &csprogsdatasize);
+ if (!cls.demoplayback || csqc_usedemoprogs.integer)
+ {
+ csprogsfn = va("dlcache/%s.%i.%i", csqc_progname.string, requiredsize, requiredcrc);
+ csprogsdata = FS_LoadFile(csprogsfn, tempmempool, true, &csprogsdatasize);
+ }
if (!csprogsdata)
{
csprogsfn = csqc_progname.string;