- Duke: Clean up player/actor accesses in displaymasks_*().

This commit is contained in:
Mitchell Richters 2023-10-03 20:03:36 +11:00
parent d8b670276a
commit 27d859229f
5 changed files with 15 additions and 15 deletions

View file

@ -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();

View file

@ -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);

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -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);
}
}