mirror of
https://github.com/nzp-team/glquake.git
synced 2025-03-13 06:02:49 +00:00
Force use of external Zombie skins and override MDL loading
This commit is contained in:
parent
0a2aa8795a
commit
896ca8814e
2 changed files with 42 additions and 0 deletions
|
@ -1616,11 +1616,29 @@ void Mod_FloodFillSkin( byte *skin, int skinwidth, int skinheight )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qboolean model_is_zombie(char name[MAX_QPATH])
|
||||||
|
{
|
||||||
|
if (Q_strcmp(name, "models/ai/zbod.mdl") == 0 ||
|
||||||
|
Q_strcmp(name, "models/ai/zcbod.mdl") == 0 ||
|
||||||
|
Q_strcmp(name, "models/ai/zcfull.mdl") == 0 ||
|
||||||
|
Q_strcmp(name, "models/ai/zchead.mdl") == 0 ||
|
||||||
|
Q_strcmp(name, "models/ai/zclarm.mdl") == 0 ||
|
||||||
|
Q_strcmp(name, "models/ai/zcrarm.mdl") == 0 ||
|
||||||
|
Q_strcmp(name, "models/ai/zfull.mdl") == 0 ||
|
||||||
|
Q_strcmp(name, "models/ai/zhead.mdl") == 0 ||
|
||||||
|
Q_strcmp(name, "models/ai/zlarm.mdl") == 0 ||
|
||||||
|
Q_strcmp(name, "models/ai/zrarm.mdl") == 0)
|
||||||
|
return qtrue;
|
||||||
|
|
||||||
|
return qfalse;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
Mod_LoadAllSkins
|
Mod_LoadAllSkins
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
|
extern int zombie_skins[4];
|
||||||
void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
@ -1640,6 +1658,23 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
||||||
|
|
||||||
s = pheader->skinwidth * pheader->skinheight;
|
s = pheader->skinwidth * pheader->skinheight;
|
||||||
|
|
||||||
|
if (model_is_zombie(loadmodel->name) == qtrue) {
|
||||||
|
Mod_FloodFillSkin(skin, pheader->skinwidth, pheader->skinheight);
|
||||||
|
texels = Hunk_AllocName(s, loadname);
|
||||||
|
memcpy(texels, (byte *)(pskintype + 1), s);
|
||||||
|
|
||||||
|
// force-fill 4 skin slots
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
pheader->gl_texturenum[i][0] =
|
||||||
|
pheader->gl_texturenum[i][1] =
|
||||||
|
pheader->gl_texturenum[i][2] =
|
||||||
|
pheader->gl_texturenum[i][3] = zombie_skins[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
pskintype = (daliasskintype_t *)((byte *)(pskintype+1) + s);
|
||||||
|
return (void *)pskintype;
|
||||||
|
}
|
||||||
|
|
||||||
for (i=0 ; i<numskins ; i++)
|
for (i=0 ; i<numskins ; i++)
|
||||||
{
|
{
|
||||||
if (pskintype->type == ALIAS_SKIN_SINGLE) {
|
if (pskintype->type == ALIAS_SKIN_SINGLE) {
|
||||||
|
|
|
@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
extern cvar_t r_flatlightstyles;
|
extern cvar_t r_flatlightstyles;
|
||||||
|
|
||||||
int decal_blood1, decal_blood2, decal_blood3, decal_q3blood, decal_burn, decal_mark, decal_glow;
|
int decal_blood1, decal_blood2, decal_blood3, decal_q3blood, decal_burn, decal_mark, decal_glow;
|
||||||
|
int zombie_skins[4];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
|
@ -40,6 +41,12 @@ void R_InitOtherTextures (void)
|
||||||
decal_burn = loadtextureimage ("textures/decals/explo_burn01", 0, 0, qfalse, qtrue);
|
decal_burn = loadtextureimage ("textures/decals/explo_burn01", 0, 0, qfalse, qtrue);
|
||||||
decal_mark = loadtextureimage ("textures/decals/particle_burn01", 0, 0, qfalse, qtrue);
|
decal_mark = loadtextureimage ("textures/decals/particle_burn01", 0, 0, qfalse, qtrue);
|
||||||
decal_glow = loadtextureimage ("textures/decals/glow2", 0, 0, qfalse, qtrue);
|
decal_glow = loadtextureimage ("textures/decals/glow2", 0, 0, qfalse, qtrue);
|
||||||
|
|
||||||
|
// external zombie skins
|
||||||
|
zombie_skins[0] = loadtextureimage ("models/ai/zfull.mdl_0", 0, 0, qtrue, qtrue);
|
||||||
|
zombie_skins[1] = loadtextureimage ("models/ai/zfull.mdl_1", 0, 0, qtrue, qtrue);
|
||||||
|
zombie_skins[2] = loadtextureimage ("models/ai/zfull.mdl_2", 0, 0, qtrue, qtrue);
|
||||||
|
zombie_skins[3] = loadtextureimage ("models/ai/zfull.mdl_3", 0, 0, qtrue, qtrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue