diff --git a/source/games/duke/src/dispatch.cpp b/source/games/duke/src/dispatch.cpp index 8357f5e20..f5fcdecba 100644 --- a/source/games/duke/src/dispatch.cpp +++ b/source/games/duke/src/dispatch.cpp @@ -55,8 +55,8 @@ void processinput_d(int snum); void processinput_r(int snum); void displayweapon_d(int snum, double interpfrac); void displayweapon_r(int snum, double interpfrac); -void displaymasks_d(int snum, int p, double interpfrac); -void displaymasks_r(int snum, int p, double interpfrac); +void displaymasks_d(DDukePlayer* const p, int pal, double interpfrac); +void displaymasks_r(DDukePlayer* const p, int pal, double interpfrac); void think_d(); void think_r(); void movetransports_d(); diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index 6ae8a1a6c..909502f14 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -84,7 +84,7 @@ struct Dispatcher void (*checkweapons)(DDukePlayer* p); void (*processinput)(int snum); void (*displayweapon)(int snum, double interpfrac); - void (*displaymasks)(int snum, int p, double interpfrac); + void (*displaymasks)(DDukePlayer* const p, int pal, double interpfrac); void (*animatesprites)(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac); diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 921cde136..8541e1827 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -198,7 +198,7 @@ void V_AddBlend (float r, float g, float b, float a, float v_blend[4]) { fi.displayweapon(screenpeek, interpfrac); if (pp->over_shoulder_on == 0) - fi.displaymasks(screenpeek, pp->GetActor()->spr.pal == 1 || !pp->insector() ? 1 : pp->cursector->floorpal, interpfrac); + fi.displaymasks(pp, pp->GetActor()->spr.pal == 1 || !pp->insector() ? 1 : pp->cursector->floorpal, interpfrac); } } diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 1a0bf457b..2af5bc7ee 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -139,16 +139,16 @@ static bool animateknuckles(int gs, DDukePlayer* p, double xoffset, double yoffs // //--------------------------------------------------------------------------- -void displaymasks_d(int snum, int p, double interpfrac) +void displaymasks_d(DDukePlayer* const p, int pal, double interpfrac) { - if (getPlayer(snum)->scuba_on) + if (p->scuba_on) { auto scuba0 = TexMan.CheckForTexture("SCUBAMASK", ETextureType::Any); auto tex0 = TexMan.GetGameTexture(scuba0); double y = 200 - tex0->GetDisplayHeight(); - hud_drawsprite(44, y, 1., 0, scuba0, 0, p, 2 + 16); - hud_drawsprite((320 - 43), y, 1, 0, scuba0, 0, p, 2 + 4 + 16); + hud_drawsprite(44, y, 1., 0, scuba0, 0, pal, 2 + 16); + hud_drawsprite((320 - 43), y, 1, 0, scuba0, 0, pal, 2 + 4 + 16); } } diff --git a/source/games/duke/src/hudweapon_r.cpp b/source/games/duke/src/hudweapon_r.cpp index 27fa1108b..a0be8d775 100644 --- a/source/games/duke/src/hudweapon_r.cpp +++ b/source/games/duke/src/hudweapon_r.cpp @@ -50,9 +50,9 @@ inline static void hud_drawpal(double x, double y, const char* tilenum, int shad // //--------------------------------------------------------------------------- -void displaymasks_r(int snum, int p, double interpfrac) +void displaymasks_r(DDukePlayer* const p, int pal, double interpfrac) { - if (getPlayer(snum)->scuba_on) + if (p->scuba_on) { auto scuba0 = TexMan.CheckForTexture("SCUBAMASK0", ETextureType::Any); auto scuba3 = TexMan.CheckForTexture("SCUBAMASK3", ETextureType::Any); @@ -63,11 +63,11 @@ void displaymasks_r(int snum, int p, double interpfrac) // to get the proper clock value with regards to interpolation we have add a interpfrac based offset to the value. double interpclock = PlayClock + TICSPERFRAME * interpfrac; int pin = RS_STRETCH; - hud_drawsprite((320 - (tex0->GetDisplayWidth() * 0.5) - 15), (200 - (tex0->GetDisplayHeight() * 0.5) + BobVal(interpclock) * 16), 0.75, 0, scuba0, 0, p, 2 + 16 + pin); - hud_drawsprite((320 - tex4->GetDisplayWidth()), (200 - tex4->GetDisplayHeight()), 1., 0, scuba4, 0, p, 2 + 16 + pin); - hud_drawsprite(tex4->GetDisplayWidth(), (200 - tex4->GetDisplayHeight()), 1., 0, scuba4, 0, p, 2 + 4 + 16 + pin); - hud_drawsprite(35, (-1), 1., 0, scuba3, 0, p, 2 + 16 + pin); - hud_drawsprite(285, 200, 1., -180, scuba3, 0, p, 2 + 16 + pin); + hud_drawsprite((320 - (tex0->GetDisplayWidth() * 0.5) - 15), (200 - (tex0->GetDisplayHeight() * 0.5) + BobVal(interpclock) * 16), 0.75, 0, scuba0, 0, pal, 2 + 16 + pin); + hud_drawsprite((320 - tex4->GetDisplayWidth()), (200 - tex4->GetDisplayHeight()), 1., 0, scuba4, 0, pal, 2 + 16 + pin); + hud_drawsprite(tex4->GetDisplayWidth(), (200 - tex4->GetDisplayHeight()), 1., 0, scuba4, 0, pal, 2 + 4 + 16 + pin); + hud_drawsprite(35, (-1), 1., 0, scuba3, 0, pal, 2 + 16 + pin); + hud_drawsprite(285, 200, 1., -180, scuba3, 0, pal, 2 + 16 + pin); } }