0
0
Fork 0
mirror of https://github.com/ZDoom/Raze.git synced 2025-03-31 21:20:59 +00:00

- Duke: Interpolate tipincs when drawing onscreen (tipping the dancers).

This commit is contained in:
Mitchell Richters 2022-06-06 09:40:47 +10:00
parent d6549d6335
commit 3b2ef4d18b
6 changed files with 18 additions and 9 deletions

View file

@ -536,7 +536,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;
case PLAYER_TIPINCS:
if (bSet) ps[iPlayer].tipincs = lValue;
if (bSet) ps[iPlayer].otipincs = ps[iPlayer].tipincs = lValue;
else SetGameVarID(lVar2, ps[iPlayer].tipincs, sActor, sPlayer);
break;

View file

@ -159,14 +159,15 @@ void displaymasks_d(int snum, int p, double)
//
//---------------------------------------------------------------------------
static int animatetip(int gs, player_struct* p, double look_anghalf, double looking_arc, double horiz16th, double plravel, int pal)
static int animatetip(int gs, player_struct* p, double look_anghalf, double looking_arc, double horiz16th, double plravel, int pal, double const smoothratio)
{
if (p->tipincs == 0) return 0;
static const int8_t tip_y[] = { 0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16 };
hud_drawpal(170 + plravel - look_anghalf,
(tip_y[p->tipincs] >> 1) + looking_arc + 240 - horiz16th, TIP + ((26 - p->tipincs) >> 4), gs, 0, pal);
const double tipi = interpolatedvaluef(tip_y[p->otipincs], tip_y[p->tipincs], smoothratio) * 0.5;
hud_drawpal(170 + plravel - look_anghalf, tipi + looking_arc + 240 - horiz16th, TIP + ((26 - p->tipincs) >> 4), gs, 0, pal);
return 1;
}
@ -259,7 +260,7 @@ void displayweapon_d(int snum, double smoothratio)
auto adjusted_arc = looking_arc - hard_landing;
bool playerVars = p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->spr.pal != 1 && p->GetActor()->spr.extra <= 0);
bool playerAnims = animatefist(shade, p, look_anghalf, looking_arc, plravel, pal, smoothratio) || animateknuckles(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal) ||
animatetip(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal) || animateaccess(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel);
animatetip(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal, smoothratio) || animateaccess(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel);
if(playerVars || playerAnims)
return;

View file

@ -1449,7 +1449,11 @@ int doincrements_d(struct player_struct* p)
if (p->invdisptime > 0)
p->invdisptime--;
if (p->tipincs > 0) p->tipincs--;
if (p->tipincs > 0)
{
p->otipincs = p->tipincs;
p->tipincs--;
}
if (p->last_pissed_time > 0)
{

View file

@ -1335,7 +1335,11 @@ int doincrements_r(struct player_struct* p)
if (p->invdisptime > 0)
p->invdisptime--;
if (p->tipincs > 0) p->tipincs--;
if (p->tipincs > 0)
{
p->otipincs = p->tipincs;
p->tipincs--;
}
if (p->last_pissed_time > 0)
{

View file

@ -89,7 +89,7 @@ void resetplayerstats(int snum)
p->subweapon = 0;
p->last_full_weapon = 0;
p->ftq = 0;
p->tipincs = 0;
p->otipincs = p->tipincs = 0;
p->buttonpalette = 0;
p->actorsqu =nullptr;
p->invdisptime = 0;

View file

@ -243,7 +243,7 @@ struct player_struct
short last_extra, subweapon;
short ammo_amount[MAX_WEAPONS], frag, fraggedself;
short curr_weapon, last_weapon, tipincs, wantweaponfire;
short curr_weapon, last_weapon, otipincs, tipincs, wantweaponfire;
short holoduke_amount, hurt_delay, hbomb_hold_delay;
short jumping_counter, airleft, oknee_incs, knee_incs, access_incs;
short ftq;