mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'first-person-improvements' into 'master'
First person fixes and tweaks Closes #180 and #179 See merge request KartKrew/RingRacers!71
This commit is contained in:
commit
c192f13d5d
3 changed files with 40 additions and 19 deletions
|
|
@ -5234,7 +5234,7 @@ static void K_drawKartFirstPerson(void)
|
||||||
fixed_t scale;
|
fixed_t scale;
|
||||||
UINT8 *colmap = NULL;
|
UINT8 *colmap = NULL;
|
||||||
|
|
||||||
if (stplyr->spectator || !stplyr->mo || (stplyr->mo->renderflags & RF_DONTDRAW))
|
if (stplyr->spectator || !stplyr->mo || (stplyr->mo->renderflags & RF_DONTDRAW || stplyr->mo->state == &states[S_KART_DEAD]))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
13
src/p_user.c
13
src/p_user.c
|
|
@ -4092,6 +4092,9 @@ Quaketilt (player_t *player)
|
||||||
static void
|
static void
|
||||||
DoABarrelRoll (player_t *player)
|
DoABarrelRoll (player_t *player)
|
||||||
{
|
{
|
||||||
|
UINT8 viewnum = R_GetViewNumber();
|
||||||
|
camera_t *cam = &camera[viewnum];
|
||||||
|
|
||||||
angle_t slope;
|
angle_t slope;
|
||||||
angle_t delta;
|
angle_t delta;
|
||||||
|
|
||||||
|
|
@ -4120,17 +4123,25 @@ DoABarrelRoll (player_t *player)
|
||||||
slope = 0;
|
slope = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cam->chase)
|
||||||
|
{
|
||||||
if (AbsAngle(slope) > ANGLE_45)
|
if (AbsAngle(slope) > ANGLE_45)
|
||||||
{
|
{
|
||||||
slope = slope & ANGLE_180 ? InvAngle(ANGLE_45) : ANGLE_45;
|
slope = slope & ANGLE_180 ? InvAngle(ANGLE_45) : ANGLE_45;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (AbsAngle(slope) > ANGLE_90)
|
||||||
|
{
|
||||||
|
slope = slope & ANGLE_180 ? InvAngle(ANGLE_90) : ANGLE_90;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
slope -= Quaketilt(player);
|
slope -= Quaketilt(player);
|
||||||
|
|
||||||
delta = slope - player->tilt;
|
delta = slope - player->tilt;
|
||||||
smoothing = FixedDiv(AbsAngle(slope), ANGLE_45);
|
smoothing = FixedDiv(AbsAngle(slope), ANGLE_45);
|
||||||
|
|
||||||
delta = FixedDiv(delta, 33 *
|
delta = FixedDiv(delta, (cam->chase ? 33 : 11) *
|
||||||
FixedDiv(FRACUNIT, FRACUNIT + smoothing));
|
FixedDiv(FRACUNIT, FRACUNIT + smoothing));
|
||||||
|
|
||||||
if (delta)
|
if (delta)
|
||||||
|
|
|
||||||
|
|
@ -307,8 +307,18 @@ angle_t R_PointToAnglePlayer(player_t *player, fixed_t x, fixed_t y)
|
||||||
{
|
{
|
||||||
refx = cam->x;
|
refx = cam->x;
|
||||||
refy = cam->y;
|
refy = cam->y;
|
||||||
}
|
|
||||||
|
|
||||||
|
// Bandaid for two very specific bugs that arise with chasecam off.
|
||||||
|
// 1: Camera tilt from slopes wouldn't apply correctly in first person.
|
||||||
|
// 2: Trick pies would appear strangely in first person.
|
||||||
|
if (player->mo)
|
||||||
|
{
|
||||||
|
if ((!cam->chase) && player->mo->x == x && player->mo->y == y)
|
||||||
|
{
|
||||||
|
return player->mo->angle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return R_PointToAngle2(refx, refy, x, y);
|
return R_PointToAngle2(refx, refy, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue