}
if (!m)
+ {
+ Con_Printf("%s: no miptex lump to load textures from\n", loadmodel->name);
return;
+ }
s = loadmodel->name;
if (!strncasecmp(s, "maps/", 5))
for (i = 0;i < m->nummiptex;i++)
{
dofs[i] = LittleLong(dofs[i]);
- if (dofs[i] == -1 || r_nosurftextures.integer)
+ if (r_nosurftextures.integer)
+ continue;
+ if (dofs[i] == -1)
+ {
+ Con_DPrintf("%s: miptex #%i missing\n", loadmodel->name, i);
continue;
+ }
dmiptex = (miptex_t *)((unsigned char *)m + dofs[i]);
// copy name, but only up to 16 characters
name[j] = dmiptex->name[j];
name[j] = 0;
+ if (!name[0])
+ {
+ sprintf(name, "unnamed%i", i);
+ Con_Printf("warning: unnamed texture in %s, renaming to %s\n", loadmodel->name, name);
+ }
+
mtwidth = LittleLong(dmiptex->width);
mtheight = LittleLong(dmiptex->height);
mtdata = NULL;
if (name[j] >= 'A' && name[j] <= 'Z')
name[j] += 'a' - 'A';
- if (Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + i, name, true, false, false))
+ if (dmiptex->name[0] && Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + i, name, true, false, false))
continue;
tx = loadmodel->data_textures + i;
tx->width = mtwidth;
tx->height = mtheight;
- if (!tx->name[0])
- {
- sprintf(tx->name, "unnamed%i", i);
- Con_Printf("warning: unnamed texture in %s, renaming to %s\n", loadmodel->name, tx->name);
- }
-
if (tx->name[0] == '*')
{
if (!strncmp(tx->name, "*lava", 5))
qboolean success = true;
q3shaderinfo_t *shader;
strlcpy(texture->name, name, sizeof(texture->name));
- shader = Mod_LookupQ3Shader(name);
+ shader = name[0] ? Mod_LookupQ3Shader(name) : NULL;
if (shader)
{
+ if (developer.integer >= 100)
+ Con_DPrintf("%s: loaded shader for %s\n", loadmodel->name, name);
texture->surfaceparms = shader->surfaceparms;
texture->textureflags = shader->textureflags;
texture->basematerialflags = 0;
memcpy(texture->deforms, shader->deforms, sizeof(texture->deforms));
}
else if (!strcmp(texture->name, "noshader"))
+ {
+ if (developer.integer >= 100)
+ Con_DPrintf("%s: using default handler for %s\n", loadmodel->name, name);
texture->surfaceparms = 0;
+ }
else
{
success = false;
- Con_DPrintf("%s: No shader found for texture \"%s\"\n", loadmodel->name, texture->name);
+ if (developer.integer >= 100 || loadmodel->type == mod_brushq3)
+ Con_DPrintf("%s: No shader found for texture \"%s\"\n", loadmodel->name, texture->name);
texture->surfaceparms = 0;
if (texture->surfaceflags & Q3SURFACEFLAG_NODRAW)
texture->basematerialflags |= MATERIALFLAG_NODRAW | MATERIALFLAG_NOSHADOW;