- interpolate p->TiltStatus for RR(RA).

This commit is contained in:
Mitchell Richters 2020-08-04 17:10:44 +10:00
parent cdb8e5b94e
commit 293c1af4c2
3 changed files with 12 additions and 10 deletions

View file

@ -113,7 +113,7 @@ void displayweapon_r(int snum, double smoothratio)
{ {
int cw; int cw;
int i, j; int i, j;
double weapon_sway, weapon_xoffset, gun_pos, looking_arc, look_anghalf; double weapon_sway, weapon_xoffset, gun_pos, looking_arc, look_anghalf, TiltStatus;
char o,pal; char o,pal;
signed char gs; signed char gs;
@ -125,6 +125,7 @@ void displayweapon_r(int snum, double smoothratio)
look_anghalf = getHalfLookAng(snum, cl_syncinput, smoothratio); look_anghalf = getHalfLookAng(snum, cl_syncinput, smoothratio);
looking_arc = fabs(look_anghalf) / 4.5; looking_arc = fabs(look_anghalf) / 4.5;
weapon_sway = p->oweapon_sway + fmulscale16((p->weapon_sway - p->oweapon_sway), smoothratio); weapon_sway = p->oweapon_sway + fmulscale16((p->weapon_sway - p->oweapon_sway), smoothratio);
TiltStatus = !cl_syncinput ? p->TiltStatus : p->oTiltStatus + fmulscale16((p->TiltStatus - p->oTiltStatus), smoothratio);
if (shadedsector[p->cursectnum] == 1) if (shadedsector[p->cursectnum] == 1)
gs = 16; gs = 16;
@ -215,17 +216,17 @@ void displayweapon_r(int snum, double smoothratio)
else else
pal = sector[p->cursectnum].floorpal; pal = sector[p->cursectnum].floorpal;
if (p->TiltStatus >= 0) if (TiltStatus >= 0)
ShowMotorcycle(160-look_anghalf, 174, temp_kb, gs, 0, pal, p->TiltStatus*5); ShowMotorcycle(160-look_anghalf, 174, temp_kb, gs, 0, pal, TiltStatus*5);
else if (p->TiltStatus < 0) else if (p->TiltStatus < 0)
ShowMotorcycle(160-look_anghalf, 174, temp_kb, gs, 0, pal, p->TiltStatus*5+2047); ShowMotorcycle(160-look_anghalf, 174, temp_kb, gs, 0, pal, TiltStatus*5+2047);
return; return;
} }
if (p->OnBoat) if (p->OnBoat)
{ {
int temp2, temp_kb, temp3; int temp2, temp_kb, temp3;
temp2 = 0; temp2 = 0;
if (p->TiltStatus > 0) if (TiltStatus > 0)
{ {
if (*kb == 0) if (*kb == 0)
temp_kb = BOATHIT+1; temp_kb = BOATHIT+1;
@ -242,7 +243,7 @@ void displayweapon_r(int snum, double smoothratio)
else else
temp_kb = BOATHIT+1; temp_kb = BOATHIT+1;
} }
else if (p->TiltStatus < 0) else if (TiltStatus < 0)
{ {
if (*kb == 0) if (*kb == 0)
temp_kb = BOATHIT+2; temp_kb = BOATHIT+2;
@ -290,10 +291,10 @@ void displayweapon_r(int snum, double smoothratio)
if (temp2) if (temp2)
gs = -96; gs = -96;
if (p->TiltStatus >= 0) if (TiltStatus >= 0)
ShowBoat(160-look_anghalf, temp3, temp_kb, gs, 0, pal, p->TiltStatus); ShowBoat(160-look_anghalf, temp3, temp_kb, gs, 0, pal, TiltStatus);
else if (p->TiltStatus < 0) else if (p->TiltStatus < 0)
ShowBoat(160-look_anghalf, temp3, temp_kb, gs, 0, pal, p->TiltStatus+2047); ShowBoat(160-look_anghalf, temp3, temp_kb, gs, 0, pal, TiltStatus+2047);
return; return;
} }

View file

@ -927,6 +927,7 @@ static void processMovement(player_struct *p, input_t &input, ControlInfo &info,
static double motoApplyTurn(player_struct* p, int turnl, int turnr, int bike_turn, bool goback, double factor) static double motoApplyTurn(player_struct* p, int turnl, int turnr, int bike_turn, bool goback, double factor)
{ {
int turnvel = 0; int turnvel = 0;
p->oTiltStatus = p->TiltStatus;
if (p->MotoSpeed == 0 || !p->on_ground) if (p->MotoSpeed == 0 || !p->on_ground)
{ {

View file

@ -202,7 +202,7 @@ struct player_struct
int SeaSick; int SeaSick;
short MamaEnd; // raat609 short MamaEnd; // raat609
short MotoSpeed, moto_drink; short MotoSpeed, moto_drink;
float TiltStatus; float TiltStatus, oTiltStatus;
short VBumpNow, VBumpTarget, TurbCount; short VBumpNow, VBumpTarget, TurbCount;
short drug_stat[3]; // raat5f1..5 short drug_stat[3]; // raat5f1..5
uint8_t DrugMode, lotag800kill; uint8_t DrugMode, lotag800kill;