mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-29 02:10:36 +00:00
- ensure player's angle input while playing with cl_syncinput 0
is scaled appropriately when sector's lotag is ST_2_UNDERWATER.
This commit is contained in:
parent
d1a68421bd
commit
ddd30e742c
6 changed files with 23 additions and 24 deletions
|
@ -789,6 +789,7 @@ void apply_seasick(player_struct* p, double factor)
|
||||||
void applylook(int snum, double factor, fixed_t adjustment)
|
void applylook(int snum, double factor, fixed_t adjustment)
|
||||||
{
|
{
|
||||||
auto p = &ps[snum];
|
auto p = &ps[snum];
|
||||||
|
fixed_t q16avel;
|
||||||
|
|
||||||
if (p->dead_flag == 0)
|
if (p->dead_flag == 0)
|
||||||
{
|
{
|
||||||
|
@ -831,7 +832,17 @@ void applylook(int snum, double factor, fixed_t adjustment)
|
||||||
p->q16ang += fix16_from_dbl(factor * p->angAdjust);
|
p->q16ang += fix16_from_dbl(factor * p->angAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
p->q16ang = (p->q16ang + adjustment) & 0x7FFFFFF;
|
// Taken from processinput() for use with applying look while cl_syncinput is 0.
|
||||||
|
if (p->psectlotag == ST_2_UNDERWATER)
|
||||||
|
{
|
||||||
|
q16avel = (adjustment - (adjustment >> 3)) * sgn(TICSPERFRAME);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
q16avel = adjustment * sgn(TICSPERFRAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
p->q16ang = (p->q16ang + q16avel) & 0x7FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
|
@ -2757,6 +2757,8 @@ void processinput_d(int snum)
|
||||||
movement(snum, sb_snum, psect, fz, cz, shrunk, truefdist);
|
movement(snum, sb_snum, psect, fz, cz, shrunk, truefdist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p->psectlotag = psectlotag;
|
||||||
|
|
||||||
//Do the quick lefts and rights
|
//Do the quick lefts and rights
|
||||||
|
|
||||||
if (movementBlocked(snum))
|
if (movementBlocked(snum))
|
||||||
|
@ -2771,16 +2773,7 @@ void processinput_d(int snum)
|
||||||
//ENGINE calculates angvel for you
|
//ENGINE calculates angvel for you
|
||||||
// may still be needed later for demo recording
|
// may still be needed later for demo recording
|
||||||
|
|
||||||
if (psectlotag == ST_2_UNDERWATER)
|
applylook(snum, 1, sb_avel);
|
||||||
{
|
|
||||||
p->q16angvel = (sb_avel - (sb_avel >> 3)) * sgn(doubvel);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p->q16angvel = sb_avel * sgn(doubvel);
|
|
||||||
}
|
|
||||||
|
|
||||||
applylook(snum, 1, p->q16angvel);
|
|
||||||
|
|
||||||
p->crack_time = 777;
|
p->crack_time = 777;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3680,6 +3680,8 @@ void processinput_r(int snum)
|
||||||
movement(snum, sb_snum, psect, fz, cz, shrunk, truefdist);
|
movement(snum, sb_snum, psect, fz, cz, shrunk, truefdist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p->psectlotag = psectlotag;
|
||||||
|
|
||||||
//Do the quick lefts and rights
|
//Do the quick lefts and rights
|
||||||
|
|
||||||
if (movementBlocked(snum))
|
if (movementBlocked(snum))
|
||||||
|
@ -3694,16 +3696,7 @@ void processinput_r(int snum)
|
||||||
//ENGINE calculates angvel for you
|
//ENGINE calculates angvel for you
|
||||||
// may still be needed later for demo recording
|
// may still be needed later for demo recording
|
||||||
|
|
||||||
if (psectlotag == ST_2_UNDERWATER)
|
applylook(snum, 1, sb_avel);
|
||||||
{
|
|
||||||
p->q16angvel = (sb_avel - (sb_avel >> 3)) * sgn(doubvel);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p->q16angvel = sb_avel * sgn(doubvel);
|
|
||||||
}
|
|
||||||
|
|
||||||
applylook(snum, 1, p->q16angvel);
|
|
||||||
|
|
||||||
p->crack_time = 777;
|
p->crack_time = 777;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ void resetplayerstats(int snum)
|
||||||
p->pyoff = 0;
|
p->pyoff = 0;
|
||||||
p->opyoff = 0;
|
p->opyoff = 0;
|
||||||
p->loogcnt = 0;
|
p->loogcnt = 0;
|
||||||
p->q16angvel = 0;
|
p->psectlotag = 0;
|
||||||
p->weapon_sway = 0;
|
p->weapon_sway = 0;
|
||||||
// p->select_dir = 0;
|
// p->select_dir = 0;
|
||||||
p->extra_extra8 = 0;
|
p->extra_extra8 = 0;
|
||||||
|
|
|
@ -149,7 +149,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
|
||||||
("crack_time", w.crack_time)
|
("crack_time", w.crack_time)
|
||||||
("aim.mode", w.aim_mode)
|
("aim.mode", w.aim_mode)
|
||||||
("auto_aim", w.auto_aim)
|
("auto_aim", w.auto_aim)
|
||||||
("q16angvel", w.q16angvel)
|
("psectlotag", w.psectlotag)
|
||||||
("cursectnum", w.cursectnum)
|
("cursectnum", w.cursectnum)
|
||||||
("last_extra", w.last_extra)
|
("last_extra", w.last_extra)
|
||||||
("subweapon", w.subweapon)
|
("subweapon", w.subweapon)
|
||||||
|
|
|
@ -102,7 +102,7 @@ struct player_struct
|
||||||
};
|
};
|
||||||
|
|
||||||
// input handles angle and horizon as fixed16 numbers. We need to account for that as well.
|
// input handles angle and horizon as fixed16 numbers. We need to account for that as well.
|
||||||
fixed_t q16ang, q16horiz, q16horizoff, q16rotscrnang, q16look_ang, q16angvel;
|
fixed_t q16ang, q16horiz, q16horizoff, q16rotscrnang, q16look_ang;
|
||||||
fixed_t oq16ang, oq16horiz, oq16horizoff, oq16rotscrnang, oq16look_ang; // These are only needed with synchronous mouse input.
|
fixed_t oq16ang, oq16horiz, oq16horizoff, oq16rotscrnang, oq16look_ang; // These are only needed with synchronous mouse input.
|
||||||
fixed_t one_eighty_count;
|
fixed_t one_eighty_count;
|
||||||
|
|
||||||
|
@ -124,6 +124,8 @@ struct player_struct
|
||||||
unsigned char hard_landing;
|
unsigned char hard_landing;
|
||||||
unsigned char ohard_landing;
|
unsigned char ohard_landing;
|
||||||
|
|
||||||
|
// Store current psectlotag as determined in processinput() for use with scaling angle aiming.
|
||||||
|
short psectlotag;
|
||||||
|
|
||||||
// From here on it is unaltered from JFDuke with the exception of a few fields that are no longer needed and were removed.
|
// From here on it is unaltered from JFDuke with the exception of a few fields that are no longer needed and were removed.
|
||||||
int zoom, exitx, exity, loogiex[64], loogiey[64], numloogs, loogcnt;
|
int zoom, exitx, exity, loogiex[64], loogiey[64], numloogs, loogcnt;
|
||||||
|
|
Loading…
Reference in a new issue