Merge branch 'gl-skin-silhouettes' into 'master'

Skin silhouette support for Legacy GL

Closes #1187

See merge request KartKrew/Kart!2165
This commit is contained in:
Oni 2024-03-26 05:21:35 +00:00
commit 4479f2ab1d
2 changed files with 35 additions and 45 deletions

View file

@ -5072,38 +5072,26 @@ static void HWR_ProjectSprite(mobj_t *thing)
vis->mobj = thing;
INT32 skinnum = TC_DEFAULT;
if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player!
{
skinnum = (skin_t*)vis->mobj->skin-skins;
}
// Hide not-yet-unlocked characters in replays from other people
if (skinnum >= 0 && !R_CanShowSkinInDemo(skinnum))
{
vis->colormap = R_GetTranslationColormap(TC_BLINK, thing->color, GTC_CACHE);
}
//Hurdler: 25/04/2000: now support colormap in hardware mode
if (R_ThingIsFlashing(vis->mobj))
else if (R_ThingIsFlashing(vis->mobj))
{
vis->colormap = R_GetTranslationColormap(TC_HITLAG, 0, GTC_CACHE);
}
/*
else if ((vis->mobj->flags & (MF_ENEMY|MF_BOSS)) && (vis->mobj->flags2 & MF2_FRET) && !(vis->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash"
{
if (vis->mobj->type == MT_CYBRAKDEMON || vis->mobj->colorized)
vis->colormap = R_GetTranslationColormap(TC_ALLWHITE, 0, GTC_CACHE);
else if (vis->mobj->type == MT_METALSONIC_BATTLE)
vis->colormap = R_GetTranslationColormap(TC_METALSONIC, 0, GTC_CACHE);
else
vis->colormap = R_GetTranslationColormap(TC_BOSS, 0, GTC_CACHE);
}
*/
else if (thing->color)
{
// New colormap stuff for skins Tails 06-07-2002
if (thing->colorized)
{
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
}
else if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
{
size_t skinnum = (skin_t*)thing->skin-skins;
vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE);
}
else
{
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color ? vis->mobj->color : SKINCOLOR_GREEN, GTC_CACHE);
}
vis->colormap = R_GetTranslationColormap(thing->colorized ? TC_RAINBOW : skinnum, thing->color, GTC_CACHE);
}
else
{

View file

@ -830,6 +830,9 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
if (translen > 0)
colorbrightnesses[translen] = colorbrightnesses[translen-1];
if (skinnum == TC_BLINK)
blendcolor = V_GetColor(skincolors[color].ramp[3]);
while (size--)
{
if (skinnum == TC_HITLAG)
@ -860,6 +863,11 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
cur->s.red = cur->s.green = cur->s.blue = 255;
cur->s.alpha = image->s.alpha;
}
else if (skinnum == TC_BLINK)
{
*cur = blendcolor;
cur->s.alpha = image->s.alpha;
}
else
{
// Everything below requires a blend image
@ -1514,29 +1522,23 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
{
INT32 skinnum = TC_DEFAULT;
if (R_ThingIsFlashing(spr->mobj))
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY) // This thing is a player!
{
skinnum = (skin_t*)spr->mobj->skin-skins;
}
// Hide not-yet-unlocked characters in replays from other people
if (skinnum >= 0 && !R_CanShowSkinInDemo(skinnum))
{
skinnum = TC_BLINK;
}
else if (R_ThingIsFlashing(spr->mobj))
{
skinnum = TC_HITLAG;
}
/*
else if ((spr->mobj->flags & (MF_ENEMY|MF_BOSS)) && (spr->mobj->flags2 & MF2_FRET) && !(spr->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash"
else if (spr->mobj->color && spr->mobj->colorized)
{
if (spr->mobj->type == MT_CYBRAKDEMON || spr->mobj->colorized)
skinnum = TC_ALLWHITE;
else if (spr->mobj->type == MT_METALSONIC_BATTLE)
skinnum = TC_METALSONIC;
else
skinnum = TC_BOSS;
}
*/
else if ((skincolornum_t)spr->mobj->color != SKINCOLOR_NONE)
{
if (spr->mobj->colorized)
skinnum = TC_RAINBOW;
else if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
skinnum = (INT32)((skin_t*)spr->mobj->skin-skins);
else
skinnum = TC_DEFAULT;
skinnum = TC_RAINBOW;
}
// Translation or skin number found