- prog->globals.client->time = cl.time;
- prog->globals.client->frametime = max(0, cl.time - cl.oldtime);
- prog->globals.client->servercommandframe = cls.servermovesequence;
- prog->globals.client->clientcommandframe = cl.movecmd[0].sequence;
- VectorCopy(cl.viewangles, prog->globals.client->input_angles);
+ PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobalfloat(frametime) = max(0, cl.time - cl.oldtime);
+ PRVM_clientglobalfloat(servercommandframe) = cls.servermovesequence;
+ PRVM_clientglobalfloat(clientcommandframe) = cl.movecmd[0].sequence;
+ VectorCopy(cl.viewangles, PRVM_clientglobalvector(input_angles));
- prog->globals.client->input_buttons = cl.movecmd[0].buttons;
- VectorSet(prog->globals.client->input_movevalues, cl.movecmd[0].forwardmove, cl.movecmd[0].sidemove, cl.movecmd[0].upmove);
+ PRVM_clientglobalfloat(input_buttons) = cl.movecmd[0].buttons;
+ VectorSet(PRVM_clientglobalvector(input_movevalues), cl.movecmd[0].forwardmove, cl.movecmd[0].sidemove, cl.movecmd[0].upmove);
VectorCopy(cl.csqc_vieworiginfromengine, cl.csqc_vieworigin);
VectorCopy(cl.csqc_viewanglesfromengine, cl.csqc_viewangles);
// LordHavoc: Spike says not to do this, but without pmove_org the
// CSQC is useless as it can't alter the view origin without
// completely replacing it
VectorCopy(cl.csqc_vieworiginfromengine, cl.csqc_vieworigin);
VectorCopy(cl.csqc_viewanglesfromengine, cl.csqc_viewangles);
// LordHavoc: Spike says not to do this, but without pmove_org the
// CSQC is useless as it can't alter the view origin without
// completely replacing it
- Matrix4x4_OriginFromMatrix(&cl.entities[cl.viewentity].render.matrix, prog->globals.client->pmove_org);
- VectorCopy(cl.movement_velocity, prog->globals.client->pmove_vel);
+ Matrix4x4_OriginFromMatrix(&cl.entities[cl.viewentity].render.matrix, PRVM_clientglobalvector(pmove_org));
+ VectorCopy(cl.movement_velocity, PRVM_clientglobalvector(pmove_vel));
PRVM_clientglobalfloat(pmove_onground) = cl.onground;
PRVM_clientglobalfloat(pmove_inwater) = cl.inwater;
VectorCopy(cl.viewangles, PRVM_clientglobalvector(view_angles));
VectorCopy(cl.punchangle, PRVM_clientglobalvector(view_punchangle));
VectorCopy(cl.punchvector, PRVM_clientglobalvector(view_punchvector));
PRVM_clientglobalfloat(pmove_onground) = cl.onground;
PRVM_clientglobalfloat(pmove_inwater) = cl.inwater;
VectorCopy(cl.viewangles, PRVM_clientglobalvector(view_angles));
VectorCopy(cl.punchangle, PRVM_clientglobalvector(view_punchangle));
VectorCopy(cl.punchvector, PRVM_clientglobalvector(view_punchvector));
- b = prog->globals.client->self;
- prog->globals.client->self = PRVM_EDICT_TO_PROG(ed);
- PRVM_ExecuteProgram(ed->fields.client->predraw, "CSQC_Predraw: NULL function\n");
- prog->globals.client->self = b;
+ b = PRVM_clientglobaledict(self);
+ PRVM_clientglobaledict(self) = PRVM_EDICT_TO_PROG(ed);
+ PRVM_ExecuteProgram(PRVM_clientedictfunction(ed, predraw), "CSQC_Predraw: NULL function\n");
+ PRVM_clientglobaledict(self) = b;
- if(ed->fields.client->think)
- if(ed->fields.client->nextthink && ed->fields.client->nextthink <= prog->globals.client->time)
+ if(PRVM_clientedictfunction(ed, think))
+ if(PRVM_clientedictfloat(ed, nextthink) && PRVM_clientedictfloat(ed, nextthink) <= PRVM_clientglobalfloat(time))
- ed->fields.client->nextthink = 0;
- b = prog->globals.client->self;
- prog->globals.client->self = PRVM_EDICT_TO_PROG(ed);
- PRVM_ExecuteProgram(ed->fields.client->think, "CSQC_Think: NULL function\n");
- prog->globals.client->self = b;
+ PRVM_clientedictfloat(ed, nextthink) = 0;
+ b = PRVM_clientglobaledict(self);
+ PRVM_clientglobaledict(self) = PRVM_EDICT_TO_PROG(ed);
+ PRVM_ExecuteProgram(PRVM_clientedictfunction(ed, think), "CSQC_Think: NULL function\n");
+ PRVM_clientglobaledict(self) = b;
entrender->userwavefunc_param[3] = PRVM_clientedictfloat(ed, userwavefunc_param3);
entrender->model = model;
entrender->userwavefunc_param[3] = PRVM_clientedictfloat(ed, userwavefunc_param3);
entrender->model = model;
entrender->effects |= entrender->model->effects;
renderflags = (int)PRVM_clientedictfloat(ed, renderflags);
entrender->alpha = PRVM_clientedictfloat(ed, alpha);
entrender->scale = scale = PRVM_clientedictfloat(ed, scale);
VectorCopy(PRVM_clientedictvector(ed, colormod), entrender->colormod);
VectorCopy(PRVM_clientedictvector(ed, glowmod), entrender->glowmod);
entrender->effects |= entrender->model->effects;
renderflags = (int)PRVM_clientedictfloat(ed, renderflags);
entrender->alpha = PRVM_clientedictfloat(ed, alpha);
entrender->scale = scale = PRVM_clientedictfloat(ed, scale);
VectorCopy(PRVM_clientedictvector(ed, colormod), entrender->colormod);
VectorCopy(PRVM_clientedictvector(ed, glowmod), entrender->glowmod);
if (c <= 0)
CL_SetEntityColormapColors(entrender, -1);
else if (c <= cl.maxclients && cl.scores != NULL)
if (c <= 0)
CL_SetEntityColormapColors(entrender, -1);
else if (c <= cl.maxclients && cl.scores != NULL)
- prog->globals.client->time = cl.time;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
+ 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) = !down; // 0 is down, 1 is up
PRVM_G_FLOAT(OFS_PARM1) = key;
PRVM_G_FLOAT(OFS_PARM2) = ascii;
R_TimeReport("pre-UpdateView");
CSQC_BEGIN
//VectorCopy(cl.viewangles, oldangles);
R_TimeReport("pre-UpdateView");
CSQC_BEGIN
//VectorCopy(cl.viewangles, oldangles);
- prog->globals.client->time = cl.time;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
+ PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
CSQC_SetGlobals();
// clear renderable entity and light lists to prevent crashes if the
// CSQC_UpdateView function does not call R_ClearScene as it should
CSQC_SetGlobals();
// clear renderable entity and light lists to prevent crashes if the
// CSQC_UpdateView function does not call R_ClearScene as it should
- prog->globals.client->time = cl.time;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
+ PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(cmd);
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_ConsoleCommand), "QC function CSQC_ConsoleCommand is missing");
restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(cmd);
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_ConsoleCommand), "QC function CSQC_ConsoleCommand is missing");
- prog->globals.client->time = cl.time;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
+ PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
- prog->globals.client->time = cl.time;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
+ PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(msg);
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_StuffCmd), "QC function CSQC_Parse_StuffCmd is missing");
restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(msg);
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_StuffCmd), "QC function CSQC_Parse_StuffCmd is missing");
- prog->globals.client->time = cl.time;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
+ PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(msg);
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_Print), "QC function CSQC_Parse_Print is missing");
restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(msg);
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_Print), "QC function CSQC_Parse_Print is missing");
- prog->globals.client->time = cl.time;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
+ PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(msg);
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_CenterPrint), "QC function CSQC_Parse_CenterPrint is missing");
restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(msg);
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_CenterPrint), "QC function CSQC_Parse_CenterPrint is missing");
- prog->globals.client->time = cl.time;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
+ 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_INT(OFS_PARM2) = PRVM_SetTempString(cl.sound_name[sound_num] );
PRVM_G_FLOAT(OFS_PARM0) = ent;
PRVM_G_FLOAT(OFS_PARM1) = channel;
PRVM_G_INT(OFS_PARM2) = PRVM_SetTempString(cl.sound_name[sound_num] );
- prog->globals.client->time = cl.time;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
+ PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
PRVM_G_FLOAT(OFS_PARM0) = event;
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Event), "QC function CSQC_Event is missing");
r = CSQC_RETURNVAL;
PRVM_G_FLOAT(OFS_PARM0) = event;
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Event), "QC function CSQC_Event is missing");
r = CSQC_RETURNVAL;
while(1)
{
entnum = MSG_ReadShort();
if(!entnum || msg_badread)
break;
realentnum = entnum & 0x7FFF;
while(1)
{
entnum = MSG_ReadShort();
if(!entnum || msg_badread)
break;
realentnum = entnum & 0x7FFF;
{
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Ent_Remove), "QC function CSQC_Ent_Remove is missing");
cl.csqc_server2csqcentitynumber[realentnum] = 0;
{
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Ent_Remove), "QC function CSQC_Ent_Remove is missing");
cl.csqc_server2csqcentitynumber[realentnum] = 0;
- ed->fields.client->entnum = realentnum;
- prog->globals.client->self = cl.csqc_server2csqcentitynumber[realentnum] = PRVM_EDICT_TO_PROG(ed);
+ PRVM_clientedictfloat(ed, entnum) = realentnum;
+ PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[realentnum] = PRVM_EDICT_TO_PROG(ed);
// the qc function should set entnum, too (this way it also can return world [2/1/2008 Andreas]
PRVM_G_FLOAT(OFS_PARM0) = (float) realentnum;
// make sure no one gets wrong ideas
// the qc function should set entnum, too (this way it also can return world [2/1/2008 Andreas]
PRVM_G_FLOAT(OFS_PARM0) = (float) realentnum;
// make sure no one gets wrong ideas
}
PRVM_G_FLOAT(OFS_PARM0) = 1;
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Ent_Update), "QC function CSQC_Ent_Update is missing");
}
PRVM_G_FLOAT(OFS_PARM0) = 1;
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Ent_Update), "QC function CSQC_Ent_Update is missing");
R_DecalSystem_Reset(&entrender->decalsystem);
memset(entrender, 0, sizeof(*entrender));
World_UnlinkEdict(ed);
R_DecalSystem_Reset(&entrender->decalsystem);
memset(entrender, 0, sizeof(*entrender));
World_UnlinkEdict(ed);
VM_RemoveEdictSkeleton(ed);
World_Physics_RemoveFromEntity(&cl.world, ed);
World_Physics_RemoveJointFromEntity(&cl.world, ed);
VM_RemoveEdictSkeleton(ed);
World_Physics_RemoveFromEntity(&cl.world, ed);
World_Physics_RemoveJointFromEntity(&cl.world, ed);
- prog->globals.client->mapname = PRVM_SetEngineString(cl.worldname);
- prog->globals.client->player_localentnum = cl.playerentity;
+ PRVM_clientglobalstring(mapname) = PRVM_SetEngineString(cl.worldname);
+ PRVM_clientglobalfloat(player_localentnum) = cl.playerentity;
// set map description (use world entity 0)
PRVM_clientedictstring(prog->edicts, message) = PRVM_SetEngineString(cl.worldmessage);
// set map description (use world entity 0)
PRVM_clientedictstring(prog->edicts, message) = PRVM_SetEngineString(cl.worldmessage);
- VectorCopy(cl.world.mins, prog->edicts->fields.client->mins);
- VectorCopy(cl.world.maxs, prog->edicts->fields.client->maxs);
+ VectorCopy(cl.world.mins, PRVM_clientedictvector(prog->edicts, mins));
+ VectorCopy(cl.world.maxs, PRVM_clientedictvector(prog->edicts, maxs));
if (PRVM_clientfunction(CSQC_Shutdown))
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Shutdown), "QC function CSQC_Shutdown is missing");
PRVM_ResetProg();
if (PRVM_clientfunction(CSQC_Shutdown))
PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Shutdown), "QC function CSQC_Shutdown is missing");
PRVM_ResetProg();
if(CL_GetTagMatrix (&matrix, ed, 0) == 0)
Matrix4x4_OriginFromMatrix(&matrix, out);
if (mod && mod->soundfromcenter)
if(CL_GetTagMatrix (&matrix, ed, 0) == 0)
Matrix4x4_OriginFromMatrix(&matrix, out);
if (mod && mod->soundfromcenter)
{
Matrix4x4_ToVectors(viewmatrix, forward, left, up, origin);
AnglesFromVectors(ang, forward, up, false);
{
Matrix4x4_ToVectors(viewmatrix, forward, left, up, origin);
AnglesFromVectors(ang, forward, up, false);
VectorCopy(origin, PRVM_G_VECTOR(OFS_PARM0));
VectorCopy(ang, PRVM_G_VECTOR(OFS_PARM1));
VectorCopy(forward, PRVM_clientglobalvector(v_forward));
VectorCopy(origin, PRVM_G_VECTOR(OFS_PARM0));
VectorCopy(ang, PRVM_G_VECTOR(OFS_PARM1));
VectorCopy(forward, PRVM_clientglobalvector(v_forward));