From 3766c5aed08d84e2595e9e33b29731ffebb624e7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 23 Apr 2021 19:36:55 +0200 Subject: [PATCH] - restored original palette handling for access cards that got broken in 242f958c41f0b14eccb74dfeabbab6cd86a7dd70 Unlike all the other HUD sprites this one works differently. --- source/games/duke/src/hudweapon_d.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 0d88667a5..8f7058736 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -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; @@ -197,6 +197,11 @@ int animateaccess(int gs, player_struct* p, double look_anghalf, double looking_ 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) 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 @@ -266,7 +271,7 @@ void displayweapon_d(int snum, double smoothratio) 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 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) return;