mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'firstpersonhitlag' into 'master'
First-person view hitlag See merge request KartKrew/Kart!393
This commit is contained in:
commit
5d431dbb2c
1 changed files with 21 additions and 1 deletions
22
src/k_hud.c
22
src/k_hud.c
|
|
@ -3632,7 +3632,27 @@ static void K_drawKartFirstPerson(void)
|
|||
const angle_t ang = R_PointToAngle2(0, 0, stplyr->rmomx, stplyr->rmomy) - stplyr->drawangle;
|
||||
// yes, the following is correct. no, you do not need to swap the x and y.
|
||||
fixed_t xoffs = -P_ReturnThrustY(stplyr->mo, ang, (BASEVIDWIDTH<<(FRACBITS-2))/2);
|
||||
fixed_t yoffs = -(P_ReturnThrustX(stplyr->mo, ang, 4*FRACUNIT) - 4*FRACUNIT);
|
||||
fixed_t yoffs = -P_ReturnThrustX(stplyr->mo, ang, 4*FRACUNIT);
|
||||
|
||||
// hitlag vibrating
|
||||
if (stplyr->mo->hitlag > 0)
|
||||
{
|
||||
fixed_t mul = stplyr->mo->hitlag * (FRACUNIT / 10);
|
||||
if (r_splitscreen && mul > FRACUNIT)
|
||||
mul = FRACUNIT;
|
||||
|
||||
if (leveltime & 1)
|
||||
{
|
||||
mul = -mul;
|
||||
}
|
||||
|
||||
xoffs = FixedMul(xoffs, mul);
|
||||
yoffs = FixedMul(yoffs, mul);
|
||||
|
||||
}
|
||||
|
||||
if ((yoffs += 4*FRACUNIT) < 0)
|
||||
yoffs = 0;
|
||||
|
||||
if (r_splitscreen)
|
||||
xoffs = FixedMul(xoffs, scale);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue