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:
Spoike 2008-02-08 23:26:25 +00:00
parent 04bdd8d827
commit 406a7645a5
2 changed files with 35 additions and 21 deletions

View file

@ -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);
@ -1404,6 +1404,8 @@ static void *Q1_LoadSkins_GL (daliasskintype_t *pskintype, qboolean alpha)
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
if (!texture)
{
snprintf(skinname, sizeof(skinname), "%s__%i", loadname, i); snprintf(skinname, sizeof(skinname), "%s__%i", loadname, i);
texture = R_LoadTexture8(skinname, outskin->skinwidth, outskin->skinheight, saved, true, alpha); texture = R_LoadTexture8(skinname, outskin->skinwidth, outskin->skinheight, saved, true, alpha);
if (r_fb_models.value) if (r_fb_models.value)
@ -1417,6 +1419,7 @@ static void *Q1_LoadSkins_GL (daliasskintype_t *pskintype, qboolean alpha)
bumptexture = R_LoadTexture8Bump(skinname, outskin->skinwidth, outskin->skinheight, saved, true, true); bumptexture = R_LoadTexture8Bump(skinname, outskin->skinwidth, outskin->skinheight, saved, true, true);
} }
} }
}
else else
texnums = Hunk_Alloc(sizeof(*texnums)); texnums = Hunk_Alloc(sizeof(*texnums));
outskin->texnums=1; outskin->texnums=1;

View file

@ -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,6 +1039,16 @@ 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 (forced)
{
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
{
if (e->scoreboard && e->scoreboard->skin) if (e->scoreboard && e->scoreboard->skin)
{ {
snprintf(hashname, sizeof(hashname), "%s$%s$%i", modelname, e->scoreboard->skin->name, surfnum); snprintf(hashname, sizeof(hashname), "%s$%s$%i", modelname, e->scoreboard->skin->name, surfnum);
@ -1051,6 +1061,7 @@ static galiastexnum_t *GL_ChooseSkin(galiasinfo_t *inf, char *modelname, int sur
} }
else else
skinname = modelname; 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)));