Okay, that ruleset cvar actually works now, correctly locking out modified textures on backpack.mdl
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2911 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
04bdd8d827
commit
406a7645a5
2 changed files with 35 additions and 21 deletions
|
@ -1394,7 +1394,7 @@ static void *Q1_LoadSkins_GL (daliasskintype_t *pskintype, qboolean alpha)
|
||||||
}
|
}
|
||||||
|
|
||||||
//but only preload it if we have no replacement.
|
//but only preload it if we have no replacement.
|
||||||
if (!texture)
|
if (!texture || (loadmodel->engineflags & MDLF_NOTREPLACEMENTS))
|
||||||
{
|
{
|
||||||
//we're not using 24bits
|
//we're not using 24bits
|
||||||
texnums = Hunk_Alloc(sizeof(*texnums)+s);
|
texnums = Hunk_Alloc(sizeof(*texnums)+s);
|
||||||
|
@ -1403,18 +1403,21 @@ static void *Q1_LoadSkins_GL (daliasskintype_t *pskintype, qboolean alpha)
|
||||||
memcpy(saved, pskintype+1, s);
|
memcpy(saved, pskintype+1, s);
|
||||||
Mod_FloodFillSkin(saved, outskin->skinwidth, outskin->skinheight);
|
Mod_FloodFillSkin(saved, outskin->skinwidth, outskin->skinheight);
|
||||||
|
|
||||||
//the extra underscore is to stop
|
//the extra underscore is to stop
|
||||||
snprintf(skinname, sizeof(skinname), "%s__%i", loadname, i);
|
if (!texture)
|
||||||
texture = R_LoadTexture8(skinname, outskin->skinwidth, outskin->skinheight, saved, true, alpha);
|
|
||||||
if (r_fb_models.value)
|
|
||||||
{
|
{
|
||||||
snprintf(skinname, sizeof(skinname), "%s__%i_luma", loadname, i);
|
snprintf(skinname, sizeof(skinname), "%s__%i", loadname, i);
|
||||||
fbtexture = R_LoadTextureFB(skinname, outskin->skinwidth, outskin->skinheight, saved, true, true);
|
texture = R_LoadTexture8(skinname, outskin->skinwidth, outskin->skinheight, saved, true, alpha);
|
||||||
}
|
if (r_fb_models.value)
|
||||||
if (gl_bump.value)
|
{
|
||||||
{
|
snprintf(skinname, sizeof(skinname), "%s__%i_luma", loadname, i);
|
||||||
snprintf(skinname, sizeof(skinname), "%s__%i_bump", loadname, i);
|
fbtexture = R_LoadTextureFB(skinname, outskin->skinwidth, outskin->skinheight, saved, true, true);
|
||||||
bumptexture = R_LoadTexture8Bump(skinname, outskin->skinwidth, outskin->skinheight, saved, true, true);
|
}
|
||||||
|
if (gl_bump.value)
|
||||||
|
{
|
||||||
|
snprintf(skinname, sizeof(skinname), "%s__%i_bump", loadname, i);
|
||||||
|
bumptexture = R_LoadTexture8Bump(skinname, outskin->skinwidth, outskin->skinheight, saved, true, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1008,7 +1008,7 @@ static galiastexnum_t *GL_ChooseSkin(galiasinfo_t *inf, char *modelname, int sur
|
||||||
int tc, bc;
|
int tc, bc;
|
||||||
qboolean forced;
|
qboolean forced;
|
||||||
|
|
||||||
if ((e->model->engineflags & MDLF_NOTREPLACEMENTS) && ruleset_allow_sensative_texture_replacements.value)
|
if ((e->model->engineflags & MDLF_NOTREPLACEMENTS) && !ruleset_allow_sensative_texture_replacements.value)
|
||||||
forced = true;
|
forced = true;
|
||||||
else
|
else
|
||||||
forced = false;
|
forced = false;
|
||||||
|
@ -1039,18 +1039,29 @@ static galiastexnum_t *GL_ChooseSkin(galiasinfo_t *inf, char *modelname, int sur
|
||||||
char hashname[512];
|
char hashname[512];
|
||||||
cc = (tc<<4)|bc;
|
cc = (tc<<4)|bc;
|
||||||
|
|
||||||
if (e->scoreboard && e->scoreboard->skin)
|
if (forced)
|
||||||
{
|
{
|
||||||
snprintf(hashname, sizeof(hashname), "%s$%s$%i", modelname, e->scoreboard->skin->name, surfnum);
|
if (e->scoreboard && e->scoreboard->skin)
|
||||||
skinname = hashname;
|
snprintf(hashname, sizeof(hashname), "%s$%s$%i", modelname, e->scoreboard->skin->name, surfnum);
|
||||||
}
|
else
|
||||||
else if (surfnum)
|
snprintf(hashname, sizeof(hashname), "%s$%i", modelname, surfnum);
|
||||||
{
|
|
||||||
snprintf(hashname, sizeof(hashname), "%s$%i", modelname, surfnum);
|
|
||||||
skinname = hashname;
|
skinname = hashname;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
skinname = modelname;
|
{
|
||||||
|
if (e->scoreboard && e->scoreboard->skin)
|
||||||
|
{
|
||||||
|
snprintf(hashname, sizeof(hashname), "%s$%s$%i", modelname, e->scoreboard->skin->name, surfnum);
|
||||||
|
skinname = hashname;
|
||||||
|
}
|
||||||
|
else if (surfnum)
|
||||||
|
{
|
||||||
|
snprintf(hashname, sizeof(hashname), "%s$%i", modelname, surfnum);
|
||||||
|
skinname = hashname;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
skinname = modelname;
|
||||||
|
}
|
||||||
|
|
||||||
if (!skincolourmapped.numbuckets)
|
if (!skincolourmapped.numbuckets)
|
||||||
Hash_InitTable(&skincolourmapped, 256, BZ_Malloc(Hash_BytesForBuckets(256)));
|
Hash_InitTable(&skincolourmapped, 256, BZ_Malloc(Hash_BytesForBuckets(256)));
|
||||||
|
|
Loading…
Reference in a new issue