VM_Warning("VM_CL_lightstyle >= MAX_LIGHTSTYLES\n");
return;
}
- strlcpy (cl.lightstyle[i].map, MSG_ReadString(), sizeof (cl.lightstyle[i].map));
+ strlcpy (cl.lightstyle[i].map, c, sizeof (cl.lightstyle[i].map));
cl.lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
cl.lightstyle[i].length = (int)strlen(cl.lightstyle[i].map);
}
extern void CSQC_Think (prvm_edict_t *ed);//csprogs.c
void VM_CL_R_AddEntities (void)
{
+ double t = Sys_DoubleTime();
int i, drawmask;
prvm_edict_t *ed;
VM_SAFEPARMCOUNT(1, VM_CL_R_AddEntities);
continue;
CSQC_AddRenderEdict(ed);
}
+
+ // callprofile fixing hack: do not include this time in what is counted for CSQC_UpdateView
+ prog->functions[prog->funcoffsets.CSQC_UpdateView].totaltime -= Sys_DoubleTime() - t;
}
//#302 void(entity ent) addentity (EXT_CSQC)
void VM_CL_R_AddEntity (void)
{
+ double t = Sys_DoubleTime();
VM_SAFEPARMCOUNT(1, VM_CL_R_AddEntity);
CSQC_AddRenderEdict(PRVM_G_EDICT(OFS_PARM0));
+ prog->functions[prog->funcoffsets.CSQC_UpdateView].totaltime -= Sys_DoubleTime() - t;
}
//#303 float(float property, ...) setproperty (EXT_CSQC)
CSQC_R_RecalcView();
break;
case VF_DRAWWORLD:
- cl.csqc_vidvars.drawworld = k;
+ cl.csqc_vidvars.drawworld = k != 0;
break;
case VF_DRAWENGINESBAR:
- cl.csqc_vidvars.drawenginesbar = k;
+ cl.csqc_vidvars.drawenginesbar = k != 0;
break;
case VF_DRAWCROSSHAIR:
- cl.csqc_vidvars.drawcrosshair = k;
+ cl.csqc_vidvars.drawcrosshair = k != 0;
break;
case VF_CL_VIEWANGLES:
VectorCopy(f, cl.viewangles);
//#305 void(vector org, float radius, vector lightcolours[, float style, string cubemapname, float pflags]) adddynamiclight (EXT_CSQC)
void VM_CL_R_AddDynamicLight (void)
{
+ double t = Sys_DoubleTime();
vec_t *org;
float radius = 300;
vec_t *col;
R_RTLight_Update(&r_refdef.scene.templights[r_refdef.scene.numlights], false, &matrix, col, style, cubemapname, castshadow, coronaintensity, coronasizescale, ambientscale, diffusescale, specularscale, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
r_refdef.scene.lights[r_refdef.scene.numlights] = &r_refdef.scene.templights[r_refdef.scene.numlights++];
+ prog->functions[prog->funcoffsets.CSQC_UpdateView].totaltime -= Sys_DoubleTime() - t;
}
//============================================================================
static void VM_CL_setcursormode (void)
{
VM_SAFEPARMCOUNT(1, VM_CL_setcursormode);
- cl.csqc_wantsmousemove = PRVM_G_FLOAT(OFS_PARM0);
+ cl.csqc_wantsmousemove = PRVM_G_FLOAT(OFS_PARM0) != 0;
cl_ignoremousemoves = 2;
}
// --blub
void VM_CL_R_RenderScene (void)
{
+ double t = Sys_DoubleTime();
vmpolygons_t* polys = vmpolygons + PRVM_GetProgNr();
VM_SAFEPARMCOUNT(0, VM_CL_R_RenderScene);
+
// we need to update any RENDER_VIEWMODEL entities at this point because
// csqc supplies its own view matrix
CL_UpdateViewEntities();
polys->num_vertices = polys->num_triangles = 0;
polys->progstarttime = prog->starttime;
+
+ // callprofile fixing hack: do not include this time in what is counted for CSQC_UpdateView
+ prog->functions[prog->funcoffsets.CSQC_UpdateView].totaltime -= Sys_DoubleTime() - t;
}
static void VM_ResizePolygons(vmpolygons_t *polys)