strlcpy(shader.dpreflectcube, parameter[1], sizeof(shader.dpreflectcube));
else if (!strcasecmp(parameter[0], "dpmeshcollisions"))
shader.dpmeshcollisions = true;
+ else if (!strcasecmp(parameter[0], "dpshaderkillifcvarzero") && numparameters >= 2)
+ {
+ if (Cvar_VariableValue(parameter[1]) == 0.0f)
+ shader.dpshaderkill = true;
+ }
+ else if (!strcasecmp(parameter[0], "dpshaderkillifcvar") && numparameters >= 2)
+ {
+ if (Cvar_VariableValue(parameter[1]) != 0.0f)
+ shader.dpshaderkill = true;
+ }
else if (!strcasecmp(parameter[0], "sky") && numparameters >= 2)
{
// some q3 skies don't have the sky parm set
}
}
}
+ // hide this shader if a cvar said it should be killed
+ if (shader.dpshaderkill)
+ shader.numlayers = 0;
// pick the primary layer to render with
if (shader.numlayers)
{
if (shader->dpmeshcollisions)
texture->basematerialflags |= MATERIALFLAG_MESHCOLLISIONS;
+ if (shader->dpshaderkill && developer_extra.integer)
+ Con_DPrintf("^1%s:^7 killing shader ^3\"%s\" because of cvar\n", loadmodel->name, name);
}
else if (!strcmp(texture->name, "noshader") || !texture->name[0])
{
// add collisions to all triangles of the surface
qboolean dpmeshcollisions;
+ // kill shader based on cvar checks
+ qboolean dpshaderkill;
+
// fake reflection
char dpreflectcube[Q3PATHLENGTH];