- Duke: Move displayflamethrower() lambda to new weapon offsets.

This commit is contained in:
Mitchell Richters 2022-10-14 00:34:34 +11:00 committed by Christoph Oelckers
parent 14ecd639dc
commit 81c3afcda0

View file

@ -1030,22 +1030,28 @@ void displayweapon_d(int snum, double interpfrac)
auto displayflamethrower = [&]()
{
offsets.X += weapon_xoffset;
offsets.Y -= gun_pos;
if (*kb < 1 || p->cursector->lotag == 2)
{
hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, FLAMETHROWER, shade, o, pal);
hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, FLAMETHROWERPILOT, shade, o, pal);
hud_drawpal(210 + offsets.X, 261 + offsets.Y, FLAMETHROWER, shade, o, pal, angle);
hud_drawpal(210 + offsets.X, 261 + offsets.Y, FLAMETHROWERPILOT, shade, o, pal, angle);
}
else
{
static const uint8_t cat_frames[] = { 0, 0, 1, 1, 2, 2 };
static constexpr uint8_t cat_frames[] = { 0, 0, 1, 1, 2, 2 };
if (p->GetActor()->spr.pal != 1)
{
weapon_xoffset += krand() & 1;
looking_arc += krand() & 1;
offsets.X += krand() & 1;
offsets.Y += krand() & 1;
}
gun_pos -= 16;
hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, FLAMETHROWER + 1, -32, o, pal);
hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 235 - gun_pos, FLAMETHROWER + 2 + cat_frames[*kb % 6], -32, o, pal);
offsets.Y += 16;
hud_drawpal(210 + offsets.X, 261 + offsets.Y, FLAMETHROWER + 1, -32, o, pal, angle);
hud_drawpal(210 + offsets.X, 235 + offsets.Y, FLAMETHROWER + 2 + cat_frames[*kb % 6], -32, o, pal, angle);
}
};