- Duke: Clean up a few missed things during f39939d114.

This commit is contained in:
Mitchell Richters 2020-10-07 18:34:52 +11:00
parent 0c55a533be
commit e2691d4184
4 changed files with 11 additions and 12 deletions

View file

@ -195,12 +195,9 @@ inline void backupplayer(player_struct* p)
}
// the weapon display code uses this.
inline double get16thOfHoriz(int snum, bool interpolate, double smoothratio)
inline double get16thOfHoriz(int const snum, bool const interpolate, double const smoothratio)
{
struct player_struct *p = &ps[snum];
fixed_t ohorz = p->horizon.ohoriz.asq16() - p->horizon.ohorizoff.asq16();
fixed_t horz = p->horizon.horiz.asq16() - p->horizon.horizoff.asq16();
return (!interpolate ? horz : ohorz + fmulscale16(horz - ohorz, smoothratio)) * (0.0625 / FRACUNIT);
return (!interpolate ? ps[snum].horizon.sum() : ps[snum].horizon.interpolatedsum(smoothratio)).asq16() * (0.0625 / FRACUNIT);
}

View file

@ -39,7 +39,8 @@ BEGIN_DUKE_NS
int myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
short globalskillsound;
fixed_t q16myang, oq16myang, q16myhoriz, oq16myhoriz, q16myhorizoff, oq16myhorizoff;
fixed_t q16myang, oq16myang;
fixedhoriz myhoriz, omyhoriz, myhorizoff, omyhorizoff;
short mycursectnum, myjumpingcounter;
char myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
int fakemovefifoplc;
@ -55,8 +56,8 @@ void resetmys()
myz = omyz = ps[myconnectindex].posz;
myxvel = myyvel = myzvel = 0;
q16myang = oq16myang = ps[myconnectindex].q16ang;
q16myhoriz = oq16myhoriz = ps[myconnectindex].horizon.horiz.asq16();
q16myhorizoff = oq16myhorizoff = ps[myconnectindex].horizon.horizoff.asq16();
myhoriz = omyhoriz = ps[myconnectindex].horizon.horiz;
myhorizoff = omyhorizoff = ps[myconnectindex].horizon.horizoff;
mycursectnum = ps[myconnectindex].cursectnum;
myjumpingcounter = ps[myconnectindex].jumping_counter;
myjumpingtoggle = ps[myconnectindex].jumping_toggle;

View file

@ -5,7 +5,8 @@ BEGIN_DUKE_NS
extern int myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
extern short globalskillsound;
extern short mycursectnum, myjumpingcounter;
extern fixed_t q16myang, oq16myang, q16myhoriz, oq16myhoriz, q16myhorizoff, oq16myhorizoff;
extern fixed_t q16myang, oq16myang;
extern fixedhoriz myhoriz, omyhoriz, myhorizoff, omyhorizoff;
extern char myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
extern int fakemovefifoplc;
extern int myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];

View file

@ -554,15 +554,15 @@ void displayrooms(int snum, double smoothratio)
cposz = omyz + xs_CRoundToInt(fmulscale16(myz - omyz, smoothratio));
if (cl_syncinput)
{
fixed_t ohorz = (oq16myhoriz + oq16myhorizoff);
fixed_t horz = (q16myhoriz + q16myhorizoff);
fixed_t ohorz = (omyhoriz.asq16() + omyhorizoff.asq16());
fixed_t horz = (myhoriz.asq16() + myhorizoff.asq16());
choriz = q16horiz(ohorz + xs_CRoundToInt(fmulscale16(horz - ohorz, smoothratio)));
cang = q16ang(oq16myang + xs_CRoundToInt(fmulscale16(((q16myang + dang - oq16myang) & 0x7FFFFFF) - dang, smoothratio)));
}
else
{
cang = q16ang(q16myang);
choriz = q16horiz(q16myhoriz + q16myhorizoff);
choriz = q16horiz(myhoriz.asq16() + myhorizoff.asq16());
}
sect = mycursectnum;
}