- restored original palette handling for access cards that got broken in 242f958c41

Unlike all the other HUD sprites this one works differently.
This commit is contained in:
Christoph Oelckers 2021-04-23 19:36:55 +02:00
parent 53e698e707
commit 3766c5aed0

View file

@ -189,7 +189,7 @@ static int animatetip(int gs, player_struct* p, double look_anghalf, double look
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int animateaccess(int gs, player_struct* p, double look_anghalf, double looking_arc, double horiz16th, double plravel, int pal) int animateaccess(int gs, player_struct* p, double look_anghalf, double looking_arc, double horiz16th, double plravel)
{ {
if(p->access_incs == 0 || p->GetActor()->s->extra <= 0) return 0; if(p->access_incs == 0 || p->GetActor()->s->extra <= 0) return 0;
@ -197,6 +197,11 @@ int animateaccess(int gs, player_struct* p, double look_anghalf, double looking_
looking_arc += access_y[p->access_incs]; looking_arc += access_y[p->access_incs];
int pal;
if (p->access_spritenum != nullptr)
pal = p->access_spritenum->s->pal;
else pal = 0;
if((p->access_incs-3) > 0 && (p->access_incs-3)>>3) if((p->access_incs-3) > 0 && (p->access_incs-3)>>3)
hud_drawpal(170 + plravel - look_anghalf + (access_y[p->access_incs] >> 2), looking_arc + 266 - horiz16th, HANDHOLDINGLASER + (p->access_incs >> 3), gs, 0, pal); hud_drawpal(170 + plravel - look_anghalf + (access_y[p->access_incs] >> 2), looking_arc + 266 - horiz16th, HANDHOLDINGLASER + (p->access_incs >> 3), gs, 0, pal);
else else
@ -266,7 +271,7 @@ void displayweapon_d(int snum, double smoothratio)
auto adjusted_arc = looking_arc - hard_landing; auto adjusted_arc = looking_arc - hard_landing;
bool playerVars = p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->s->pal != 1 && p->GetActor()->s->extra <= 0); bool playerVars = p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->s->pal != 1 && p->GetActor()->s->extra <= 0);
bool playerAnims = animatefist(shade, p, look_anghalf, looking_arc, plravel, pal) || animateknuckles(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal) || bool playerAnims = animatefist(shade, p, look_anghalf, looking_arc, plravel, pal) || animateknuckles(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal) ||
animatetip(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal) || animateaccess(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal); animatetip(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal) || animateaccess(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel);
if(playerVars || playerAnims) if(playerVars || playerAnims)
return; return;