mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- Duke: Interpolate access_incs
when drawing onscreen (security card usage).
This commit is contained in:
parent
3b2ef4d18b
commit
f4b78dc3c7
6 changed files with 14 additions and 13 deletions
|
@ -581,7 +581,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
|||
break;
|
||||
|
||||
case PLAYER_ACCESS_INCS:
|
||||
if (bSet) ps[iPlayer].access_incs = lValue;
|
||||
if (bSet) ps[iPlayer].oaccess_incs = ps[iPlayer].access_incs = lValue;
|
||||
else SetGameVarID(lVar2, ps[iPlayer].access_incs, sActor, sPlayer);
|
||||
break;
|
||||
|
||||
|
|
|
@ -178,23 +178,21 @@ static int animatetip(int gs, player_struct* p, double look_anghalf, double look
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int animateaccess(int gs, player_struct* p, double look_anghalf, double looking_arc, double horiz16th, double plravel)
|
||||
int animateaccess(int gs, player_struct* p, double look_anghalf, double looking_arc, double horiz16th, double plravel, double const smoothratio)
|
||||
{
|
||||
if(p->access_incs == 0 || p->GetActor()->spr.extra <= 0) return 0;
|
||||
|
||||
static const int8_t access_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16};
|
||||
|
||||
looking_arc += access_y[p->access_incs];
|
||||
const double accessi = interpolatedvaluef(access_y[p->oaccess_incs], access_y[p->access_incs], smoothratio);
|
||||
looking_arc += accessi;
|
||||
|
||||
int pal;
|
||||
if (p->access_spritenum != nullptr)
|
||||
pal = p->access_spritenum->spr.pal;
|
||||
else pal = 0;
|
||||
const int pal = p->access_spritenum != nullptr ? p->access_spritenum->spr.pal : 0;
|
||||
|
||||
if((p->access_incs-3) > 0 && (p->access_incs-3)>>3)
|
||||
hud_drawpal(170 + plravel - look_anghalf + (access_y[p->access_incs] >> 2), looking_arc + 266 - horiz16th, HANDHOLDINGLASER + (p->access_incs >> 3), gs, 0, pal);
|
||||
hud_drawpal(170 + plravel - look_anghalf + (accessi * 0.25), looking_arc + 266 - horiz16th, HANDHOLDINGLASER + (p->access_incs >> 3), gs, 0, pal);
|
||||
else
|
||||
hud_drawpal(170 + plravel - look_anghalf + (access_y[p->access_incs] >> 2), looking_arc + 266 - horiz16th, HANDHOLDINGACCESS, gs, 4, pal);
|
||||
hud_drawpal(170 + plravel - look_anghalf + (accessi * 0.25), looking_arc + 266 - horiz16th, HANDHOLDINGACCESS, gs, 4, pal);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -260,7 +258,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, smoothratio) || 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, smoothratio);
|
||||
|
||||
if(playerVars || playerAnims)
|
||||
return;
|
||||
|
|
|
@ -1540,6 +1540,7 @@ int doincrements_d(struct player_struct* p)
|
|||
|
||||
if (p->access_incs && p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
p->oaccess_incs = p->access_incs;
|
||||
p->access_incs++;
|
||||
if (p->GetActor()->spr.extra <= 0)
|
||||
p->access_incs = 12;
|
||||
|
@ -1570,7 +1571,7 @@ int doincrements_d(struct player_struct* p)
|
|||
|
||||
if (p->access_incs > 20)
|
||||
{
|
||||
p->access_incs = 0;
|
||||
p->oaccess_incs = p->access_incs = 0;
|
||||
p->oweapon_pos = p->weapon_pos = 10;
|
||||
p->okickback_pic = p->kickback_pic = 0;
|
||||
}
|
||||
|
|
|
@ -1396,6 +1396,7 @@ int doincrements_r(struct player_struct* p)
|
|||
|
||||
if (p->access_incs && p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
p->oaccess_incs = p->access_incs;
|
||||
p->access_incs++;
|
||||
if (p->GetActor()->spr.extra <= 0)
|
||||
p->access_incs = 12;
|
||||
|
@ -1426,7 +1427,7 @@ int doincrements_r(struct player_struct* p)
|
|||
|
||||
if (p->access_incs > 20)
|
||||
{
|
||||
p->access_incs = 0;
|
||||
p->oaccess_incs = p->access_incs = 0;
|
||||
p->oweapon_pos = p->weapon_pos = 10;
|
||||
p->okickback_pic = p->kickback_pic = 0;
|
||||
}
|
||||
|
|
|
@ -157,6 +157,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
|
|||
("airleft", w.airleft)
|
||||
("oknee_incs", w.oknee_incs)
|
||||
("knee_incs", w.knee_incs)
|
||||
("oaccess_incs", w.oaccess_incs)
|
||||
("access_incs", w.access_incs)
|
||||
("ftq", w.ftq)
|
||||
("access_wallnum", w.access_wall)
|
||||
|
|
|
@ -245,7 +245,7 @@ struct player_struct
|
|||
|
||||
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 jumping_counter, airleft, oknee_incs, knee_incs, oaccess_incs, access_incs;
|
||||
short ftq;
|
||||
short got_access, weapon_ang, firstaid_amount;
|
||||
short over_shoulder_on, ofist_incs, fist_incs;
|
||||
|
|
Loading…
Reference in a new issue