Fix vwep player skins.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3681 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
876ef6f2dd
commit
176985e6ca
1 changed files with 7 additions and 6 deletions
|
@ -184,12 +184,13 @@ void GL_GAliasFlushSkinCache(void)
|
||||||
skincolourmapped.numbuckets = 0;
|
skincolourmapped.numbuckets = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static texnums_t *GL_ChooseSkin(galiasinfo_t *inf, char *modelname, int surfnum, entity_t *e)
|
static texnums_t *GL_ChooseSkin(galiasinfo_t *inf, model_t *model, int surfnum, entity_t *e)
|
||||||
{
|
{
|
||||||
galiasskin_t *skins;
|
galiasskin_t *skins;
|
||||||
texnums_t *texnums;
|
texnums_t *texnums;
|
||||||
int frame;
|
int frame;
|
||||||
unsigned int subframe;
|
unsigned int subframe;
|
||||||
|
extern int cl_playerindex; //so I don't have to strcmp
|
||||||
|
|
||||||
unsigned int tc, bc, pc;
|
unsigned int tc, bc, pc;
|
||||||
qboolean forced;
|
qboolean forced;
|
||||||
|
@ -250,16 +251,16 @@ static texnums_t *GL_ChooseSkin(galiasinfo_t *inf, char *modelname, int surfnum,
|
||||||
{
|
{
|
||||||
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", model->name, e->scoreboard->skin->name, surfnum);
|
||||||
skinname = hashname;
|
skinname = hashname;
|
||||||
}
|
}
|
||||||
else if (surfnum)
|
else if (surfnum)
|
||||||
{
|
{
|
||||||
snprintf(hashname, sizeof(hashname), "%s$%i", modelname, surfnum);
|
snprintf(hashname, sizeof(hashname), "%s$%i", model->name, surfnum);
|
||||||
skinname = hashname;
|
skinname = hashname;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
skinname = modelname;
|
skinname = model->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!skincolourmapped.numbuckets)
|
if (!skincolourmapped.numbuckets)
|
||||||
|
@ -362,7 +363,7 @@ static texnums_t *GL_ChooseSkin(galiasinfo_t *inf, char *modelname, int surfnum,
|
||||||
}
|
}
|
||||||
|
|
||||||
cm->texnum.bump = texnums[cm->skinnum].bump; //can't colour bumpmapping
|
cm->texnum.bump = texnums[cm->skinnum].bump; //can't colour bumpmapping
|
||||||
if (cls.protocol != CP_QUAKE2 && ((!texnums || !strcmp(modelname, "progs/player.mdl")) && e->scoreboard && e->scoreboard->skin))
|
if (cls.protocol != CP_QUAKE2 && ((!texnums || (model==cl.model_precache[cl_playerindex] || model==cl.model_precache_vwep[0])) && e->scoreboard && e->scoreboard->skin))
|
||||||
{
|
{
|
||||||
original = Skin_Cache8(e->scoreboard->skin);
|
original = Skin_Cache8(e->scoreboard->skin);
|
||||||
inwidth = e->scoreboard->skin->width;
|
inwidth = e->scoreboard->skin->width;
|
||||||
|
@ -980,7 +981,7 @@ void R_GAlias_GenerateBatches(entity_t *e, batch_t **batches)
|
||||||
|
|
||||||
for(surfnum=0; inf; ((inf->nextsurf)?(inf = (galiasinfo_t*)((char *)inf + inf->nextsurf)):(inf=NULL)), surfnum++)
|
for(surfnum=0; inf; ((inf->nextsurf)?(inf = (galiasinfo_t*)((char *)inf + inf->nextsurf)):(inf=NULL)), surfnum++)
|
||||||
{
|
{
|
||||||
skin = GL_ChooseSkin(inf, clmodel->name, surfnum, e);
|
skin = GL_ChooseSkin(inf, clmodel, surfnum, e);
|
||||||
if (!skin)
|
if (!skin)
|
||||||
continue;
|
continue;
|
||||||
shader = e->forcedshader?e->forcedshader:skin->shader;
|
shader = e->forcedshader?e->forcedshader:skin->shader;
|
||||||
|
|
Loading…
Reference in a new issue