From ffd284d233f658193c328ca8fcdf86844cd78390 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 24 Oct 2022 20:14:31 +0200 Subject: [PATCH] - Duke: use player palette only on the foot weapon. This is the only one showing Duke's clothes - the translation may cause discoloration on the others. --- source/games/duke/src/hudweapon_d.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 986f892f8..c709847a3 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -202,7 +202,7 @@ void displayweapon_d(int snum, double interpfrac) { int cw; int i, j; - int o, pal; + int o, pal, pal2; double weapon_sway, weapon_xoffset, gun_pos, looking_arc, kickback_pic, random_club_frame, hard_landing, look_anghalf, horiz16th, plravel; int8_t shade; player_struct* p; @@ -246,9 +246,9 @@ void displayweapon_d(int snum, double interpfrac) shade = p->GetActor()->spr.shade; if(shade > 24) shade = 24; - pal = !p->insector() ? 0 : p->GetActor()->spr.pal == 1 ? 1 : p->cursector->floorpal; - if (pal == 0) - pal = p->palookup; + pal2 = pal = !p->insector() ? 0 : p->GetActor()->spr.pal == 1 ? 1 : p->cursector->floorpal; + if (pal2 == 0) + pal2 = p->palookup; auto adjusted_arc = looking_arc - hard_landing; bool playerVars = p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->spr.pal != 1 && p->GetActor()->spr.extra <= 0); @@ -258,7 +258,7 @@ void displayweapon_d(int snum, double interpfrac) if(playerVars || playerAnims) return; - animateknee(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal, interpfrac); + animateknee(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal2, interpfrac); if (isWW2GI()) { @@ -287,11 +287,11 @@ void displayweapon_d(int snum, double interpfrac) { if (j < 5 || j > 9) { - hud_drawpal(weapon_xoffset + 80 - look_anghalf, looking_arc + 250 - gun_pos, KNEE, shade, o | 4, pal); + hud_drawpal(weapon_xoffset + 80 - look_anghalf, looking_arc + 250 - gun_pos, KNEE, shade, o | 4, pal2); } else { - hud_drawpal(weapon_xoffset + 160 - 16 - look_anghalf, looking_arc + 214 - gun_pos, KNEE + 1, shade, o | 4, pal); + hud_drawpal(weapon_xoffset + 160 - 16 - look_anghalf, looking_arc + 214 - gun_pos, KNEE + 1, shade, o | 4, pal2); } } @@ -316,12 +316,12 @@ void displayweapon_d(int snum, double interpfrac) if (*kb < 5 || *kb > 9) { hud_drawpal(weapon_xoffset + 220 - look_anghalf, - looking_arc + 250 - gun_pos, KNEE, shade, o, pal); + looking_arc + 250 - gun_pos, KNEE, shade, o, pal2); } else { hud_drawpal(weapon_xoffset + 160 - look_anghalf, - looking_arc + 214 - gun_pos, KNEE + 1, shade, o, pal); + looking_arc + 214 - gun_pos, KNEE + 1, shade, o, pal2); } } };