mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
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.
|
||||
if (!texture)
|
||||
if (!texture || (loadmodel->engineflags & MDLF_NOTREPLACEMENTS))
|
||||
{
|
||||
//we're not using 24bits
|
||||
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);
|
||||
Mod_FloodFillSkin(saved, outskin->skinwidth, outskin->skinheight);
|
||||
|
||||
//the extra underscore is to stop
|
||||
snprintf(skinname, sizeof(skinname), "%s__%i", loadname, i);
|
||||
texture = R_LoadTexture8(skinname, outskin->skinwidth, outskin->skinheight, saved, true, alpha);
|
||||
if (r_fb_models.value)
|
||||
//the extra underscore is to stop
|
||||
if (!texture)
|
||||
{
|
||||
snprintf(skinname, sizeof(skinname), "%s__%i_luma", loadname, i);
|
||||
fbtexture = R_LoadTextureFB(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);
|
||||
snprintf(skinname, sizeof(skinname), "%s__%i", loadname, i);
|
||||
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);
|
||||
fbtexture = R_LoadTextureFB(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
|
||||
|
|
|
@ -1008,7 +1008,7 @@ static galiastexnum_t *GL_ChooseSkin(galiasinfo_t *inf, char *modelname, int sur
|
|||
int tc, bc;
|
||||
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;
|
||||
else
|
||||
forced = false;
|
||||
|
@ -1039,18 +1039,29 @@ static galiastexnum_t *GL_ChooseSkin(galiasinfo_t *inf, char *modelname, int sur
|
|||
char hashname[512];
|
||||
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);
|
||||
skinname = hashname;
|
||||
}
|
||||
else if (surfnum)
|
||||
{
|
||||
snprintf(hashname, sizeof(hashname), "%s$%i", modelname, surfnum);
|
||||
if (e->scoreboard && e->scoreboard->skin)
|
||||
snprintf(hashname, sizeof(hashname), "%s$%s$%i", modelname, e->scoreboard->skin->name, surfnum);
|
||||
else
|
||||
snprintf(hashname, sizeof(hashname), "%s$%i", modelname, surfnum);
|
||||
skinname = hashname;
|
||||
}
|
||||
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)
|
||||
Hash_InitTable(&skincolourmapped, 256, BZ_Malloc(Hash_BytesForBuckets(256)));
|
||||
|
|
Loading…
Reference in a new issue