- change Duke's synchronized_input to CVAR cl_syncinput.

This commit is contained in:
Mitchell Richters 2020-07-28 21:38:20 +10:00
parent 4a3366d798
commit 158fd46581
9 changed files with 20 additions and 20 deletions

View file

@ -89,6 +89,7 @@ CVARD(Bool, cl_interpolate, true, CVAR_ARCHIVE, "enable/disable view interpolati
CVARD(Bool, cl_slopetilting, false, CVAR_ARCHIVE, "enable/disable slope tilting") // only implemented in Blood CVARD(Bool, cl_slopetilting, false, CVAR_ARCHIVE, "enable/disable slope tilting") // only implemented in Blood
CVARD(Int, cl_showweapon, 1, CVAR_ARCHIVE, "enable/disable show weapons") // only implemented in Blood CVARD(Int, cl_showweapon, 1, CVAR_ARCHIVE, "enable/disable show weapons") // only implemented in Blood
CVARD(Bool, cl_sointerpolation, true, CVAR_ARCHIVE, "enable/disable sector object interpolation") // only implemented in SW CVARD(Bool, cl_sointerpolation, true, CVAR_ARCHIVE, "enable/disable sector object interpolation") // only implemented in SW
CVARD(Bool, cl_syncinput, false, CVAR_ARCHIVE, "enable/disable synchronized input with game's ticrate") // only implemented in SW
CUSTOM_CVARD(Int, cl_crosshairscale, 50, CVAR_ARCHIVE, "changes the size of the crosshair") CUSTOM_CVARD(Int, cl_crosshairscale, 50, CVAR_ARCHIVE, "changes the size of the crosshair")
{ {
if (self < 1) self = 1; if (self < 1) self = 1;

View file

@ -24,6 +24,7 @@ EXTERN_CVAR(Int, cl_showweapon)
EXTERN_CVAR(Int, cl_weaponswitch) EXTERN_CVAR(Int, cl_weaponswitch)
EXTERN_CVAR(Int, cl_crosshairscale) EXTERN_CVAR(Int, cl_crosshairscale)
EXTERN_CVAR(Bool, cl_sointerpolation) EXTERN_CVAR(Bool, cl_sointerpolation)
EXTERN_CVAR(Bool, cl_syncinput)
EXTERN_CVAR(Bool, demorec_seeds_cvar) EXTERN_CVAR(Bool, demorec_seeds_cvar)
EXTERN_CVAR(Bool, demoplay_diffs) EXTERN_CVAR(Bool, demoplay_diffs)

View file

@ -64,7 +64,6 @@ int16_t weaponsandammosprites[15];
int PHEIGHT = PHEIGHT_DUKE; int PHEIGHT = PHEIGHT_DUKE;
int duke3d_globalflags; int duke3d_globalflags;
input_t loc; input_t loc;
bool synchronized_input;
uint8_t ready2send; uint8_t ready2send;
int gamequit; int gamequit;
int playerswhenstarted; int playerswhenstarted;

View file

@ -50,7 +50,6 @@ extern int16_t max_ammo_amount[MAX_WEAPONS];
extern int16_t weaponsandammosprites[15]; extern int16_t weaponsandammosprites[15];
extern int32_t PHEIGHT; extern int32_t PHEIGHT;
extern int duke3d_globalflags; extern int duke3d_globalflags;
extern bool synchronized_input;
extern uint8_t ready2send; extern uint8_t ready2send;
extern input_t loc; extern input_t loc;
extern int gamequit; extern int gamequit;

View file

@ -1181,7 +1181,7 @@ static void FinalizeInput(int playerNum, input_t& input, bool vehicle)
if (p->on_crane < 0 && p->newowner == -1) if (p->on_crane < 0 && p->newowner == -1)
{ {
loc.q16avel += input.q16avel; loc.q16avel += input.q16avel;
if (!synchronized_input) if (!cl_syncinput)
{ {
p->q16ang = (p->q16ang + input.q16avel) & 0x7FFFFFF; p->q16ang = (p->q16ang + input.q16avel) & 0x7FFFFFF;
@ -1193,7 +1193,7 @@ static void FinalizeInput(int playerNum, input_t& input, bool vehicle)
if (p->newowner == -1 && p->return_to_center <= 0) if (p->newowner == -1 && p->return_to_center <= 0)
{ {
loc.q16horz = fix16_clamp(loc.q16horz + input.q16horz, F16(-MAXHORIZVEL), F16(MAXHORIZVEL)); loc.q16horz = fix16_clamp(loc.q16horz + input.q16horz, F16(-MAXHORIZVEL), F16(MAXHORIZVEL));
if (!synchronized_input) if (!cl_syncinput)
p->q16horiz += input.q16horz; // will be clamped by the caller because further operations on q16horiz can follow. p->q16horiz += input.q16horz; // will be clamped by the caller because further operations on q16horiz can follow.
} }
} }
@ -1241,7 +1241,7 @@ void GetInput()
processVehicleInput(p, info, input, scaleAdjust); processVehicleInput(p, info, input, scaleAdjust);
FinalizeInput(myconnectindex, input, true); FinalizeInput(myconnectindex, input, true);
if (!synchronized_input) if (!cl_syncinput)
{ {
p->q16horiz = clamp(p->q16horiz, F16(HORIZ_MIN), F16(HORIZ_MAX)); p->q16horiz = clamp(p->q16horiz, F16(HORIZ_MIN), F16(HORIZ_MAX));
if (sprite[p->i].extra > 0) if (sprite[p->i].extra > 0)
@ -1257,7 +1257,7 @@ void GetInput()
processInputBits(p, info); processInputBits(p, info);
FinalizeInput(myconnectindex, input, false); FinalizeInput(myconnectindex, input, false);
if (!synchronized_input) if (!cl_syncinput)
{ {
// Do these in the same order as the old code. // Do these in the same order as the old code.
applylook(myconnectindex, scaleAdjust); applylook(myconnectindex, scaleAdjust);

View file

@ -405,7 +405,7 @@ void dokneeattack(int snum, int pi, const std::initializer_list<int> & respawnli
if (p->knee_incs > 0) if (p->knee_incs > 0)
{ {
p->knee_incs++; p->knee_incs++;
if (synchronized_input) if (cl_syncinput)
p->addhoriz(-48); p->addhoriz(-48);
else else
{ {
@ -881,7 +881,7 @@ void checklook(int snum, int sb_snum)
} }
p->oq16ang = p->q16ang; p->oq16ang = p->q16ang;
if (synchronized_input) if (cl_syncinput)
applylook(snum, 1); applylook(snum, 1);
} }

View file

@ -2596,7 +2596,7 @@ void processinput_d(int snum)
pi = p->i; pi = p->i;
s = &sprite[pi]; s = &sprite[pi];
if (!synchronized_input) if (!cl_syncinput)
{ {
p->horizAngleAdjust = 0; p->horizAngleAdjust = 0;
p->horizSkew = 0; p->horizSkew = 0;
@ -2637,7 +2637,7 @@ void processinput_d(int snum)
hittype[pi].floorz = fz; hittype[pi].floorz = fz;
hittype[pi].ceilingz = cz; hittype[pi].ceilingz = cz;
if (synchronized_input) if (cl_syncinput)
{ {
p->oq16horiz = p->q16horiz; p->oq16horiz = p->q16horiz;
p->oq16horizoff = p->q16horizoff; p->oq16horizoff = p->q16horizoff;
@ -2796,7 +2796,7 @@ void processinput_d(int snum)
} }
else if (sb_avel) //p->ang += syncangvel * constant else if (sb_avel) //p->ang += syncangvel * constant
{ //ENGINE calculates angvel for you { //ENGINE calculates angvel for you
if (synchronized_input) if (cl_syncinput)
{ {
// may still be needed later for demo recording // may still be needed later for demo recording
int tempang; int tempang;
@ -3017,7 +3017,7 @@ HORIZONLY:
fi.activatebysector(psect, pi); fi.activatebysector(psect, pi);
} }
if (!synchronized_input) if (!cl_syncinput)
{ {
if (p->return_to_center > 0) if (p->return_to_center > 0)
p->return_to_center--; p->return_to_center--;
@ -3051,7 +3051,7 @@ HORIZONLY:
p->hard_landing--; p->hard_landing--;
} }
if (synchronized_input) if (cl_syncinput)
{ {
p->q16horiz += (sync[snum].q16horz >> 1); p->q16horiz += (sync[snum].q16horz >> 1);
sethorizon(snum, sb_snum, 1); sethorizon(snum, sb_snum, 1);

View file

@ -3472,7 +3472,7 @@ void processinput_r(int snum)
hittype[pi].floorz = fz; hittype[pi].floorz = fz;
hittype[pi].ceilingz = cz; hittype[pi].ceilingz = cz;
if (synchronized_input) if (cl_syncinput)
{ {
p->oq16horiz = p->q16horiz; p->oq16horiz = p->q16horiz;
p->oq16horizoff = p->q16horizoff; p->oq16horizoff = p->q16horizoff;
@ -3704,7 +3704,7 @@ void processinput_r(int snum)
} }
else if (sb_avel) //p->ang += syncangvel * constant else if (sb_avel) //p->ang += syncangvel * constant
{ //ENGINE calculates angvel for you { //ENGINE calculates angvel for you
if (synchronized_input) if (cl_syncinput)
{ {
// may still be needed later for demo recording // may still be needed later for demo recording
int tempang; int tempang;
@ -4041,7 +4041,7 @@ HORIZONLY:
return; return;
} }
if (!synchronized_input && p->return_to_center > 0) if (!cl_syncinput && p->return_to_center > 0)
p->return_to_center--; p->return_to_center--;
if (sb_snum & SKB_CENTER_VIEW || p->hard_landing) if (sb_snum & SKB_CENTER_VIEW || p->hard_landing)
@ -4078,7 +4078,7 @@ HORIZONLY:
p->hard_landing--; p->hard_landing--;
} }
if (synchronized_input) if (cl_syncinput)
{ {
p->q16horiz += (sync[snum].q16horz >> 1); p->q16horiz += (sync[snum].q16horz >> 1);
sethorizon(snum, sb_snum, 1); sethorizon(snum, sb_snum, 1);

View file

@ -536,7 +536,7 @@ void displayrooms(int snum, int smoothratio)
setdrugmode(p, i); setdrugmode(p, i);
} }
if (!synchronized_input) if (!cl_syncinput)
renderSetRollAngle(p->q16rotscrnang / (float)(FRACUNIT)); renderSetRollAngle(p->q16rotscrnang / (float)(FRACUNIT));
else else
{ {
@ -549,7 +549,7 @@ void displayrooms(int snum, int smoothratio)
cposx = omyx + mulscale16((int)(myx - omyx), smoothratio); cposx = omyx + mulscale16((int)(myx - omyx), smoothratio);
cposy = omyy + mulscale16((int)(myy - omyy), smoothratio); cposy = omyy + mulscale16((int)(myy - omyy), smoothratio);
cposz = omyz + mulscale16((int)(myz - omyz), smoothratio); cposz = omyz + mulscale16((int)(myz - omyz), smoothratio);
if (synchronized_input) if (cl_syncinput)
{ {
cang.interpolate(q16ang(oq16myang), q16ang(q16myang), smoothratio); cang.interpolate(q16ang(oq16myang), q16ang(q16myang), smoothratio);
fix16_t osum = (oq16myhoriz + oq16myhorizoff); fix16_t osum = (oq16myhoriz + oq16myhorizoff);
@ -568,7 +568,7 @@ void displayrooms(int snum, int smoothratio)
cposx = p->oposx + mulscale16((int)(p->posx - p->oposx), smoothratio); cposx = p->oposx + mulscale16((int)(p->posx - p->oposx), smoothratio);
cposy = p->oposy + mulscale16((int)(p->posy - p->oposy), smoothratio); cposy = p->oposy + mulscale16((int)(p->posy - p->oposy), smoothratio);
cposz = p->oposz + mulscale16((int)(p->posz - p->oposz), smoothratio); cposz = p->oposz + mulscale16((int)(p->posz - p->oposz), smoothratio);
if (synchronized_input /*|| smoothcamera*/) if (cl_syncinput /*|| smoothcamera*/)
{ {
// Original code for when the values are passed through the sync struct // Original code for when the values are passed through the sync struct
cang.interpolate(q16ang(p->oq16ang), q16ang(p->q16ang), smoothratio); cang.interpolate(q16ang(p->oq16ang), q16ang(p->q16ang), smoothratio);