- Duke: Apply same fistsign fix from 4ee64df844 to RR code.

This commit is contained in:
Mitchell Richters 2022-06-06 11:04:51 +10:00
parent b0f517736c
commit ee6abac699
4 changed files with 16 additions and 17 deletions

View file

@ -300,10 +300,7 @@ void displayweapon_d(int snum, double smoothratio)
if (p->GetActor()->spr.xrepeat < 40)
{
//shrunken..
const double fistsign = bsinf(interpolatedvalue(p->ofistsign, p->fistsign, smoothratio), -10);
if (p->jetpack_on == 0) looking_arc += 32 - (p->GetActor()->spr.xvel >> 1);
hud_draw(weapon_xoffset + fistsign + 250 - look_anghalf, looking_arc + 258 - fabs(fistsign * 4), FIST, shade, o);
hud_draw(weapon_xoffset - fistsign + 40 - look_anghalf, looking_arc + 200 + fabs(fistsign * 4), FIST, shade, o | 4);
animateshrunken(p, weapon_xoffset, looking_arc, look_anghalf, FIST, shade, o, smoothratio);
}
else
{

View file

@ -291,19 +291,7 @@ void displayweapon_r(int snum, double smoothratio)
if (p->GetActor()->spr.xrepeat < 8)
{
static int fistsign;
if (p->jetpack_on == 0)
{
i = p->GetActor()->spr.xvel;
looking_arc += 32 - (i >> 1);
fistsign += i >> 1;
}
double owo = weapon_xoffset;
weapon_xoffset += bsinf(fistsign, -10);
hud_draw(weapon_xoffset + 250 - look_anghalf, looking_arc + 258 - abs(bsinf(fistsign, -8)), FIST, shade, o);
weapon_xoffset = owo;
weapon_xoffset -= bsinf(fistsign, -10);
hud_draw(weapon_xoffset + 40 - look_anghalf, looking_arc + 200 + abs(bsinf(fistsign, -8)), FIST, shade, o | 4);
animateshrunken(p, weapon_xoffset, looking_arc, look_anghalf, FIST, shade, o, smoothratio);
}
else
{

View file

@ -223,6 +223,14 @@ inline void hud_draw(double x, double y, int tilenum, int shade, int orientation
hud_drawsprite(x, y, 65536, 0, tilenum, shade, p, 2 | orientation);
}
inline void animateshrunken(player_struct* p, double weapon_xoffset, double looking_arc, double look_anghalf, int tilenum, int8_t shade, int o, double smoothratio)
{
const double fistsign = bsinf(interpolatedvalue(p->ofistsign, p->fistsign, smoothratio), -10);
if (p->jetpack_on == 0) looking_arc += 32 - (p->GetActor()->spr.xvel >> 1);
hud_draw(weapon_xoffset + fistsign + 250 - look_anghalf, looking_arc + 258 - fabs(fistsign * 4), tilenum, shade, o);
hud_draw(weapon_xoffset - fistsign + 40 - look_anghalf, looking_arc + 200 + fabs(fistsign * 4), tilenum, shade, o | 4);
}
inline ESpriteFlags randomFlip()
{
int r = krand() & 12;

View file

@ -3540,6 +3540,12 @@ void processinput_r(int snum)
return;
}
if (p->GetActor()->spr.xrepeat < 8 && p->jetpack_on == 0)
{
p->ofistsign = p->fistsign;
p->fistsign += p->GetActor()->spr.xvel;
}
if (p->transporter_hold > 0)
{
p->transporter_hold--;