R_ConcatTransforms(bonepose[i], model->data_baseboneposeinverse + i * 12, boneposerelative[i]);
}
// blend the vertex bone weights
- // special case for the extremely common wf[0] == 1 because it saves 12 adds and multiplies (w[0] is always 1 if only one bone controls this vertex, artists only use multiple bones for certain special cases)
+ // special case for the extremely common wf[0] == 1 because it saves 3 multiplies per array when compared to the other case (w[0] is always 1 if only one bone controls this vertex, artists only use multiple bones for certain special cases)
// special case for the first bone because it avoids the need to memset the arrays before filling
{
const float *v = model->surfmesh.data_vertex3f;
texture->basematerialflags = MATERIALFLAG_WALL;
if (texture->currentskinframe->fog)
- texture->basematerialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_TRANSPARENT;
+ texture->basematerialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_TRANSPARENT | MATERIALFLAG_NOSHADOW;
texture->currentmaterialflags = texture->basematerialflags;
}
for (i = 0;skinfile;skinfile = skinfile->next, i++, skin += loadmodel->num_surfaces)
{
memset(skin, 0, sizeof(*skin));
+ Mod_BuildAliasSkinFromSkinFrame(skin, NULL);
+ // don't render unmentioned meshes
+ skin->basematerialflags = skin->currentmaterialflags = 0;
+ // see if a mesh
for (skinfileitem = skinfile->items;skinfileitem;skinfileitem = skinfileitem->next)
{
// leave the skin unitialized (nodraw) if the replacement is "common/nodraw" or "textures/common/nodraw"
if (!strcmp(skinfileitem->name, meshname) && strcmp(skinfileitem->replacement, "common/nodraw") && strcmp(skinfileitem->replacement, "textures/common/nodraw"))
{
- memset(&tempskinframe, 0, sizeof(tempskinframe));
- if (Mod_LoadSkinFrame(&tempskinframe, skinfileitem->replacement, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, true, true))
- Mod_BuildAliasSkinFromSkinFrame(skin, &tempskinframe);
- else
- {
+ if (!Mod_LoadSkinFrame(&tempskinframe, skinfileitem->replacement, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, true, true))
if (cls.state != ca_dedicated)
- Con_Printf("mesh \"%s\": failed to load skin #%i \"%s\", falling back to mesh's internal shader name \"%s\"\n", meshname, i, skinfileitem->replacement, shadername);
- if (Mod_LoadSkinFrame(&tempskinframe, shadername, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, true, true))
- Mod_BuildAliasSkinFromSkinFrame(skin, &tempskinframe);
- else
- {
- if (cls.state != ca_dedicated)
- Con_Printf("failed to load skin \"%s\"\n", shadername);
- Mod_BuildAliasSkinFromSkinFrame(skin, NULL);
- }
- }
+ Con_Printf("mesh \"%s\": failed to load skin #%i \"%s\"\n", meshname, i, skinfileitem->replacement);
+ Mod_BuildAliasSkinFromSkinFrame(skin, &tempskinframe);
+ break;
}
}
}
}
else
{
- memset(&tempskinframe, 0, sizeof(tempskinframe));
- if (Mod_LoadSkinFrame(&tempskinframe, shadername, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, true, true))
- Mod_BuildAliasSkinFromSkinFrame(skin, &tempskinframe);
- else
- {
+ if (!Mod_LoadSkinFrame(&tempskinframe, shadername, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, true, true))
if (cls.state != ca_dedicated)
Con_Printf("Can't find texture \"%s\" for mesh \"%s\", using grey checkerboard\n", shadername, meshname);
- Mod_BuildAliasSkinFromSkinFrame(skin, NULL);
- }
+ Mod_BuildAliasSkinFromSkinFrame(skin, &tempskinframe);
}
}
loadmodel->data_textures = (texture_t *)Mem_Alloc(loadmodel->mempool, loadmodel->num_surfaces * loadmodel->numskins * sizeof(texture_t));
for (i = 0;i < loadmodel->numskins;i++, inskin += MD2_SKINNAME)
{
- if (Mod_LoadSkinFrame(&tempskinframe, inskin, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, true, true))
- Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + i * loadmodel->num_surfaces, &tempskinframe);
- else
- {
+ if (!Mod_LoadSkinFrame(&tempskinframe, inskin, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, true, true))
Con_Printf("%s is missing skin \"%s\"\n", loadmodel->name, inskin);
- Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + i * loadmodel->num_surfaces, NULL);
- }
+ Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + i * loadmodel->num_surfaces, &tempskinframe);
}
}
else
pinmodel = (zymtype1header_t *)buffer;
pbase = (unsigned char *)buffer;
if (memcmp(pinmodel->id, "ZYMOTICMODEL", 12))
- Host_Error ("Mod_ZYMOTICMODEL_Load: %s is not a zymotic model");
+ Host_Error ("Mod_ZYMOTICMODEL_Load: %s is not a zymotic model", loadmodel->name);
if (BigLong(pinmodel->type) != 1)
Host_Error ("Mod_ZYMOTICMODEL_Load: only type 1 (skeletal pose) models are currently supported (name = %s)", loadmodel->name);
if (pheader->numtris < 1 || pheader->numverts < 3 || pheader->numshaders < 1)
{
- Con_Printf("%s has no geometry\n");
+ Con_Printf("%s has no geometry\n", loadmodel->name);
return;
}
if (pheader->numscenes < 1 || pheader->lump_poses.length < (int)sizeof(float[3][4]))
{
- Con_Printf("%s has no animations\n");
+ Con_Printf("%s has no animations\n", loadmodel->name);
return;
}
pheader = (dpmheader_t *)buffer;
pbase = (unsigned char *)buffer;
if (memcmp(pheader->id, "DARKPLACESMODEL\0", 16))
- Host_Error ("Mod_DARKPLACESMODEL_Load: %s is not a darkplaces model");
+ Host_Error ("Mod_DARKPLACESMODEL_Load: %s is not a darkplaces model", loadmodel->name);
if (BigLong(pheader->type) != 2)
Host_Error ("Mod_DARKPLACESMODEL_Load: only type 2 (hierarchical skeletal pose) models are currently supported (name = %s)", loadmodel->name);
if (pheader->num_bones < 1 || pheader->num_meshs < 1)
{
- Con_Printf("%s has no geometry\n");
+ Con_Printf("%s has no geometry\n", loadmodel->name);
return;
}
if (pheader->num_frames < 1)
{
- Con_Printf("%s has no frames\n");
+ Con_Printf("%s has no frames\n", loadmodel->name);
return;
}
pchunk = (pskchunk_t *)buffer;
if (strcmp(pchunk->id, "ACTRHEAD"))
- Host_Error ("Mod_PSKMODEL_Load: %s is not an Unreal Engine ActorX (.psk + .psa) model");
+ Host_Error ("Mod_PSKMODEL_Load: %s is not an Unreal Engine ActorX (.psk + .psa) model", loadmodel->name);
loadmodel->type = mod_alias;
loadmodel->DrawSky = NULL;
// positions from the psk, but this is hard for me to implement
// and people can easily make animations that match.
if (numanimbones != numbones)
- Host_Error("%s: this loader only supports animations with the same bones as the mesh");
+ Host_Error("%s: this loader only supports animations with the same bones as the mesh", loadmodel->name);
for (index = 0, p = (pskboneinfo_t *)animbuffer;index < numrecords;index++, p++)
{
p->numchildren = LittleLong(p->numchildren);