From 30b3199e28d3636908ffaff19933f9396607bcaf Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 25 Mar 2024 04:03:27 -0700 Subject: [PATCH 1/3] Legacy GL: models support TC_BLINK --- src/hardware/hw_md2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index ec58fd8aa..a64cbc734 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -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 From 1be8e6a7628a4c0c42a5c0904fb8636926c80f28 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 25 Mar 2024 03:49:52 -0700 Subject: [PATCH 2/3] Legacy GL: models support demo skin silhouettes Code more closely matches R_GetSpriteTranslation --- src/hardware/hw_md2.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index a64cbc734..6171f268f 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1522,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 From c0c1400f98e9fb2eb3f5135216dc492cf3f5f9e5 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 25 Mar 2024 04:01:23 -0700 Subject: [PATCH 3/3] Legacy GL: sprites support demo skin silhouettes Code more closely matches R_GetSpriteTranslation --- src/hardware/hw_main.c | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index f81a4e2f4..279bc45e0 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -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 {