{
if (strcasecmp (entry->shader.name, shader->name) == 0)
{
- Con_Printf("Shader '%s' already defined\n", shader->name);
+ unsigned char *start, *end, *start2;
+ start = (unsigned char *) (&shader->Q3SHADERINFO_COMPARE_START);
+ end = ((unsigned char *) (&shader->Q3SHADERINFO_COMPARE_END)) + sizeof(shader->Q3SHADERINFO_COMPARE_END);
+ start2 = (unsigned char *) (&entry->shader.Q3SHADERINFO_COMPARE_START);
+ if(memcmp(start, start2, end - start))
+ Con_Printf("Shader '%s' already defined, ignoring mismatching redeclaration\n", shader->name);
+ else
+ Con_DPrintf("Shader '%s' already defined\n", shader->name);
return;
}
lastEntry = entry;
typedef struct q3shaderinfo_s
{
char name[Q3PATHLENGTH];
+#define Q3SHADERINFO_COMPARE_START surfaceparms
int surfaceparms;
int textureflags;
int numlayers;
float reflectfactor; // amount of reflection distort (1.0 = like the cvar specifies)
vec4_t reflectcolor4f; // color tint of reflection (including alpha factor)
float r_water_wateralpha; // additional wateralpha to apply when r_water is active
+#define Q3SHADERINFO_COMPARE_END r_water_wateralpha
}
q3shaderinfo_t;