Skip to content

Commit

Permalink
- Duke: Fix fistsign smoothness.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr4077au committed Jun 6, 2022
1 parent 600776d commit b0f5177
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
16 changes: 4 additions & 12 deletions source/games/duke/src/hudweapon_d.cpp
Expand Up @@ -300,18 +300,10 @@ void displayweapon_d(int snum, double smoothratio)
if (p->GetActor()->spr.xrepeat < 40)
{
//shrunken..
int fistsign = interpolatedvalue(p->ofistsign, p->fistsign, (int)smoothratio);
if (p->jetpack_on == 0)
{
i = p->GetActor()->spr.xvel;
looking_arc += 32 - (i >> 1);
}
double owo = weapon_xoffset;
weapon_xoffset += bsinf(fistsign, -10);
hud_draw(weapon_xoffset + 250 - look_anghalf, looking_arc + 258 - fabs(bsinf(fistsign, -8)), FIST, shade, o);
weapon_xoffset = owo;
weapon_xoffset -= bsinf(fistsign, -10);
hud_draw(weapon_xoffset + 40 - look_anghalf, looking_arc + 200 + fabs(bsinf(fistsign, -8)), FIST, shade, o | 4);
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);
}
else
{
Expand Down
1 change: 1 addition & 0 deletions source/games/duke/src/player_d.cpp
Expand Up @@ -2824,6 +2824,7 @@ void processinput_d(int snum)

if (p->GetActor()->spr.xrepeat < 40 && p->jetpack_on == 0)
{
p->ofistsign = p->fistsign;
p->fistsign += p->GetActor()->spr.xvel;
}

Expand Down
1 change: 1 addition & 0 deletions source/games/duke/src/savegame.cpp
Expand Up @@ -276,6 +276,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
("actions", w.sync.actions)
.Array("frags", w.frags, MAXPLAYERS)
("uservars", w.uservars)
("ofistsign", w.ofistsign)
("fistsign", w.fistsign)
.EndObject();

Expand Down

0 comments on commit b0f5177

Please sign in to comment.