mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- wrap all checks of cl_syncinput in an inline function.
This commit is contained in:
parent
f429871cc6
commit
ae36ea88c3
20 changed files with 57 additions and 52 deletions
|
@ -49,7 +49,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
||||||
ApplyGlobalInput(gInput, hidInput);
|
ApplyGlobalInput(gInput, hidInput);
|
||||||
processMovement(&input, &gInput, hidInput, scaleAdjust);
|
processMovement(&input, &gInput, hidInput, scaleAdjust);
|
||||||
|
|
||||||
if (!cl_syncinput && gamestate == GS_LEVEL)
|
if (!SyncInput() && gamestate == GS_LEVEL)
|
||||||
{
|
{
|
||||||
// Perform unsynchronised angle/horizon if not dead.
|
// Perform unsynchronised angle/horizon if not dead.
|
||||||
if (gView->pXSprite->health != 0)
|
if (gView->pXSprite->health != 0)
|
||||||
|
|
|
@ -1433,7 +1433,7 @@ void ProcessInput(PLAYER *pPlayer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
applylook(&pPlayer->angle, pInput->avel, &pInput->actions);
|
applylook(&pPlayer->angle, pInput->avel, &pInput->actions);
|
||||||
}
|
}
|
||||||
|
@ -1560,7 +1560,7 @@ void ProcessInput(PLAYER *pPlayer)
|
||||||
pInput->actions &= ~SB_OPEN;
|
pInput->actions &= ~SB_OPEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
sethorizon(&pPlayer->horizon.horiz, pInput->horz, &pInput->actions);
|
sethorizon(&pPlayer->horizon.horiz, pInput->horz, &pInput->actions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -568,7 +568,7 @@ void viewDrawScreen(bool sceneonly)
|
||||||
v4c = finterpolate(predictOld.at1c, predict.at1c, gInterpolate);
|
v4c = finterpolate(predictOld.at1c, predict.at1c, gInterpolate);
|
||||||
v48 = finterpolate(predictOld.at18, predict.at18, gInterpolate);
|
v48 = finterpolate(predictOld.at18, predict.at18, gInterpolate);
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
cA = bamang(predict.at30.asbam() + predict.look_ang.asbam());
|
cA = bamang(predict.at30.asbam() + predict.look_ang.asbam());
|
||||||
cH = predict.at24;
|
cH = predict.at24;
|
||||||
|
@ -596,7 +596,7 @@ void viewDrawScreen(bool sceneonly)
|
||||||
v4c = finterpolate(pView->at1c, gView->swayWidth, gInterpolate);
|
v4c = finterpolate(pView->at1c, gView->swayWidth, gInterpolate);
|
||||||
v48 = finterpolate(pView->at18, gView->swayHeight, gInterpolate);
|
v48 = finterpolate(pView->at18, gView->swayHeight, gInterpolate);
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
cA = gView->angle.sum();
|
cA = gView->angle.sum();
|
||||||
cH = gView->horizon.horiz;
|
cH = gView->horizon.horiz;
|
||||||
|
|
|
@ -29,7 +29,7 @@ struct PlayerHorizon
|
||||||
|
|
||||||
void addadjustment(double value)
|
void addadjustment(double value)
|
||||||
{
|
{
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
adjustment += value * FRACUNIT;
|
adjustment += value * FRACUNIT;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ struct PlayerHorizon
|
||||||
|
|
||||||
void settarget(double value, bool backup = false)
|
void settarget(double value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!cl_syncinput && !backup)
|
if (!SyncInput() && !backup)
|
||||||
{
|
{
|
||||||
target = value * FRACUNIT;
|
target = value * FRACUNIT;
|
||||||
if (target == 0) target += 1;
|
if (target == 0) target += 1;
|
||||||
|
@ -117,7 +117,7 @@ struct PlayerAngle
|
||||||
|
|
||||||
void addadjustment(int value)
|
void addadjustment(int value)
|
||||||
{
|
{
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
adjustment += BAngToBAM(value);
|
adjustment += BAngToBAM(value);
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ struct PlayerAngle
|
||||||
|
|
||||||
void addadjustment(double value)
|
void addadjustment(double value)
|
||||||
{
|
{
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
adjustment += value * BAMUNIT;
|
adjustment += value * BAMUNIT;
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ struct PlayerAngle
|
||||||
|
|
||||||
void addadjustment(lookangle value)
|
void addadjustment(lookangle value)
|
||||||
{
|
{
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
adjustment += value.asbam();
|
adjustment += value.asbam();
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ struct PlayerAngle
|
||||||
|
|
||||||
void addadjustment(binangle value)
|
void addadjustment(binangle value)
|
||||||
{
|
{
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
adjustment += value.asbam();
|
adjustment += value.asbam();
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ struct PlayerAngle
|
||||||
|
|
||||||
void settarget(int value, bool backup = false)
|
void settarget(int value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!cl_syncinput && !backup)
|
if (!SyncInput() && !backup)
|
||||||
{
|
{
|
||||||
target = (ang + getincanglebam(ang, buildang(value))).asbam();
|
target = (ang + getincanglebam(ang, buildang(value))).asbam();
|
||||||
if (target == 0) target += 1;
|
if (target == 0) target += 1;
|
||||||
|
@ -184,7 +184,7 @@ struct PlayerAngle
|
||||||
|
|
||||||
void settarget(double value, bool backup = false)
|
void settarget(double value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!cl_syncinput && !backup)
|
if (!SyncInput() && !backup)
|
||||||
{
|
{
|
||||||
target = (ang + getincanglebam(ang, buildfang(value))).asbam();
|
target = (ang + getincanglebam(ang, buildfang(value))).asbam();
|
||||||
if (target == 0) target += 1;
|
if (target == 0) target += 1;
|
||||||
|
@ -198,7 +198,7 @@ struct PlayerAngle
|
||||||
|
|
||||||
void settarget(binangle value, bool backup = false)
|
void settarget(binangle value, bool backup = false)
|
||||||
{
|
{
|
||||||
if (!cl_syncinput && !backup)
|
if (!SyncInput() && !backup)
|
||||||
{
|
{
|
||||||
target = (ang + getincanglebam(ang, value)).asbam();
|
target = (ang + getincanglebam(ang, value)).asbam();
|
||||||
if (target == 0) target += 1;
|
if (target == 0) target += 1;
|
||||||
|
@ -261,7 +261,7 @@ struct PlayerAngle
|
||||||
|
|
||||||
double look_anghalf(double const smoothratio)
|
double look_anghalf(double const smoothratio)
|
||||||
{
|
{
|
||||||
return (!cl_syncinput ? look_ang : interpolatedlookang(smoothratio)).asbam() * (0.5 / BAMUNIT); // Used within draw code for weapon and crosshair when looking left/right.
|
return (!SyncInput() ? look_ang : interpolatedlookang(smoothratio)).asbam() * (0.5 / BAMUNIT); // Used within draw code for weapon and crosshair when looking left/right.
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -460,7 +460,7 @@ void ApplyGlobalInput(InputPacket& input, ControlInfo* hidInput, bool const crou
|
||||||
|
|
||||||
double InputScale()
|
double InputScale()
|
||||||
{
|
{
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
double now = I_msTimeF();
|
double now = I_msTimeF();
|
||||||
double elapsedInputTicks = lastCheck > 0 ? min(now - lastCheck, 1000.0 / GameTicRate) : 1;
|
double elapsedInputTicks = lastCheck > 0 ? min(now - lastCheck, 1000.0 / GameTicRate) : 1;
|
||||||
|
|
|
@ -105,3 +105,8 @@ void SetupGameButtons();
|
||||||
void ApplyGlobalInput(InputPacket& input, ControlInfo* const hidInput, bool const crouchable = true, bool const disableToggle = false);
|
void ApplyGlobalInput(InputPacket& input, ControlInfo* const hidInput, bool const crouchable = true, bool const disableToggle = false);
|
||||||
extern ESyncBits ActionsToSend;
|
extern ESyncBits ActionsToSend;
|
||||||
double InputScale();
|
double InputScale();
|
||||||
|
|
||||||
|
inline bool SyncInput()
|
||||||
|
{
|
||||||
|
return cl_syncinput;
|
||||||
|
}
|
|
@ -519,7 +519,7 @@ void TryRunTics (void)
|
||||||
gi->Predict(myconnectindex);
|
gi->Predict(myconnectindex);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
I_GetEvent();
|
I_GetEvent();
|
||||||
auto input = CONTROL_GetInput();
|
auto input = CONTROL_GetInput();
|
||||||
|
|
|
@ -120,7 +120,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
||||||
processMovement(&input, &localInput, hidInput, scaleAdjust);
|
processMovement(&input, &localInput, hidInput, scaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
if (!nFreeze)
|
if (!nFreeze)
|
||||||
{
|
{
|
||||||
|
|
|
@ -918,7 +918,7 @@ void FuncPlayer(int a, int nDamage, int nRun)
|
||||||
}
|
}
|
||||||
|
|
||||||
// loc_1A494:
|
// loc_1A494:
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
Player* pPlayer = &PlayerList[nPlayer];
|
Player* pPlayer = &PlayerList[nPlayer];
|
||||||
applylook(&pPlayer->angle, sPlayerInput[nPlayer].nAngle, &sPlayerInput[nLocalPlayer].actions);
|
applylook(&pPlayer->angle, sPlayerInput[nPlayer].nAngle, &sPlayerInput[nLocalPlayer].actions);
|
||||||
|
@ -2637,7 +2637,7 @@ loc_1BD2E:
|
||||||
PlayerList[nPlayer].field_2 = 0;
|
PlayerList[nPlayer].field_2 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
Player* pPlayer = &PlayerList[nPlayer];
|
Player* pPlayer = &PlayerList[nPlayer];
|
||||||
sethorizon(&pPlayer->horizon.horiz, sPlayerInput[nPlayer].pan, &sPlayerInput[nLocalPlayer].actions);
|
sethorizon(&pPlayer->horizon.horiz, sPlayerInput[nPlayer].pan, &sPlayerInput[nLocalPlayer].actions);
|
||||||
|
|
|
@ -239,7 +239,7 @@ void DrawView(double smoothRatio, bool sceneonly)
|
||||||
nSector = nPlayerViewSect[nLocalPlayer];
|
nSector = nPlayerViewSect[nLocalPlayer];
|
||||||
updatesector(playerX, playerY, &nSector);
|
updatesector(playerX, playerY, &nSector);
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
nAngle = PlayerList[nLocalPlayer].angle.sum();
|
nAngle = PlayerList[nLocalPlayer].angle.sum();
|
||||||
rotscrnang = PlayerList[nLocalPlayer].angle.rotscrnang;
|
rotscrnang = PlayerList[nLocalPlayer].angle.rotscrnang;
|
||||||
|
@ -273,7 +273,7 @@ void DrawView(double smoothRatio, bool sceneonly)
|
||||||
viewz = playerZ + nQuake[nLocalPlayer];
|
viewz = playerZ + nQuake[nLocalPlayer];
|
||||||
int floorZ = sector[sprite[nPlayerSprite].sectnum].floorz;
|
int floorZ = sector[sprite[nPlayerSprite].sectnum].floorz;
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
pan = PlayerList[nLocalPlayer].horizon.sum();
|
pan = PlayerList[nLocalPlayer].horizon.sum();
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,7 +281,7 @@ void displayweapon_d(int snum, double smoothratio)
|
||||||
|
|
||||||
o = 0;
|
o = 0;
|
||||||
|
|
||||||
horiz16th = get16thOfHoriz(snum, cl_syncinput, smoothratio);
|
horiz16th = get16thOfHoriz(snum, SyncInput(), smoothratio);
|
||||||
look_anghalf = p->angle.look_anghalf(smoothratio);
|
look_anghalf = p->angle.look_anghalf(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);
|
||||||
|
|
|
@ -128,7 +128,7 @@ void displayweapon_r(int snum, double smoothratio)
|
||||||
look_anghalf = p->angle.look_anghalf(smoothratio);
|
look_anghalf = p->angle.look_anghalf(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);
|
TiltStatus = !SyncInput() ? p->TiltStatus : p->oTiltStatus + fmulscale16((p->TiltStatus - p->oTiltStatus), smoothratio);
|
||||||
|
|
||||||
if (shadedsector[p->cursectnum] == 1)
|
if (shadedsector[p->cursectnum] == 1)
|
||||||
shade = 16;
|
shade = 16;
|
||||||
|
|
|
@ -815,7 +815,7 @@ static void FinalizeInput(int playerNum, InputPacket& input, bool vehicle)
|
||||||
{
|
{
|
||||||
// input.avel already added to loc in processMovement()
|
// input.avel already added to loc in processMovement()
|
||||||
loc.avel = clamp(loc.avel, -MAXANGVEL, MAXANGVEL);
|
loc.avel = clamp(loc.avel, -MAXANGVEL, MAXANGVEL);
|
||||||
if (!cl_syncinput && input.avel)
|
if (!SyncInput() && input.avel)
|
||||||
{
|
{
|
||||||
p->angle.spin = bamlook(0);
|
p->angle.spin = bamlook(0);
|
||||||
}
|
}
|
||||||
|
@ -863,7 +863,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
||||||
processVehicleInput(p, hidInput, input, scaleAdjust);
|
processVehicleInput(p, hidInput, input, scaleAdjust);
|
||||||
FinalizeInput(myconnectindex, input, true);
|
FinalizeInput(myconnectindex, input, true);
|
||||||
|
|
||||||
if (!cl_syncinput && p->GetActor()->s.extra > 0)
|
if (!SyncInput() && p->GetActor()->s.extra > 0)
|
||||||
{
|
{
|
||||||
p->apply_seasick(scaleAdjust);
|
p->apply_seasick(scaleAdjust);
|
||||||
}
|
}
|
||||||
|
@ -875,7 +875,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
||||||
FinalizeInput(myconnectindex, input, false);
|
FinalizeInput(myconnectindex, input, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
if (p->GetActor()->s.extra > 0)
|
if (p->GetActor()->s.extra > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2760,7 +2760,7 @@ void processinput_d(int snum)
|
||||||
pact->floorz = fz;
|
pact->floorz = fz;
|
||||||
pact->ceilingz = cz;
|
pact->ceilingz = cz;
|
||||||
|
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
p->horizon.backup();
|
p->horizon.backup();
|
||||||
calcviewpitch(p, 1);
|
calcviewpitch(p, 1);
|
||||||
|
@ -2883,7 +2883,7 @@ void processinput_d(int snum)
|
||||||
p->posxv = 0;
|
p->posxv = 0;
|
||||||
p->posyv = 0;
|
p->posyv = 0;
|
||||||
}
|
}
|
||||||
else if (cl_syncinput)
|
else if (SyncInput())
|
||||||
{
|
{
|
||||||
//p->ang += syncangvel * constant
|
//p->ang += syncangvel * constant
|
||||||
//ENGINE calculates angvel for you
|
//ENGINE calculates angvel for you
|
||||||
|
@ -3121,7 +3121,7 @@ HORIZONLY:
|
||||||
playerAimDown(snum, actions);
|
playerAimDown(snum, actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
sethorizon(&p->horizon.horiz, PlayerHorizon(snum), &p->sync.actions);
|
sethorizon(&p->horizon.horiz, PlayerHorizon(snum), &p->sync.actions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3429,7 +3429,7 @@ void processinput_r(int snum)
|
||||||
pact->floorz = fz;
|
pact->floorz = fz;
|
||||||
pact->ceilingz = cz;
|
pact->ceilingz = cz;
|
||||||
|
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
p->horizon.backup();
|
p->horizon.backup();
|
||||||
calcviewpitch(p, 1);
|
calcviewpitch(p, 1);
|
||||||
|
@ -3623,7 +3623,7 @@ void processinput_r(int snum)
|
||||||
p->posxv = 0;
|
p->posxv = 0;
|
||||||
p->posyv = 0;
|
p->posyv = 0;
|
||||||
}
|
}
|
||||||
else if (cl_syncinput)
|
else if (SyncInput())
|
||||||
{
|
{
|
||||||
//p->ang += syncangvel * constant
|
//p->ang += syncangvel * constant
|
||||||
//ENGINE calculates angvel for you
|
//ENGINE calculates angvel for you
|
||||||
|
@ -3991,7 +3991,7 @@ HORIZONLY:
|
||||||
p->horizon.addadjustment(-d);
|
p->horizon.addadjustment(-d);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
sethorizon(&p->horizon.horiz, PlayerHorizon(snum), &p->sync.actions);
|
sethorizon(&p->horizon.horiz, PlayerHorizon(snum), &p->sync.actions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -538,14 +538,14 @@ void displayrooms(int snum, double smoothratio)
|
||||||
setgamepalette(setpal(p));
|
setgamepalette(setpal(p));
|
||||||
|
|
||||||
// set screen rotation.
|
// set screen rotation.
|
||||||
rotscrnang = !cl_syncinput ? p->angle.rotscrnang : p->angle.interpolatedrotscrn(smoothratio);
|
rotscrnang = !SyncInput() ? p->angle.rotscrnang : p->angle.interpolatedrotscrn(smoothratio);
|
||||||
|
|
||||||
if ((snum == myconnectindex) && (numplayers > 1))
|
if ((snum == myconnectindex) && (numplayers > 1))
|
||||||
{
|
{
|
||||||
cposx = omyx + xs_CRoundToInt(fmulscale16(myx - omyx, smoothratio));
|
cposx = omyx + xs_CRoundToInt(fmulscale16(myx - omyx, smoothratio));
|
||||||
cposy = omyy + xs_CRoundToInt(fmulscale16(myy - omyy, smoothratio));
|
cposy = omyy + xs_CRoundToInt(fmulscale16(myy - omyy, smoothratio));
|
||||||
cposz = omyz + xs_CRoundToInt(fmulscale16(myz - omyz, smoothratio));
|
cposz = omyz + xs_CRoundToInt(fmulscale16(myz - omyz, smoothratio));
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
fixed_t ohorz = (omyhoriz + omyhorizoff).asq16();
|
fixed_t ohorz = (omyhoriz + omyhorizoff).asq16();
|
||||||
fixed_t horz = (myhoriz + myhorizoff).asq16();
|
fixed_t horz = (myhoriz + myhorizoff).asq16();
|
||||||
|
@ -564,7 +564,7 @@ void displayrooms(int snum, double smoothratio)
|
||||||
cposx = p->oposx + xs_CRoundToInt(fmulscale16(p->posx - p->oposx, smoothratio));
|
cposx = p->oposx + xs_CRoundToInt(fmulscale16(p->posx - p->oposx, smoothratio));
|
||||||
cposy = p->oposy + xs_CRoundToInt(fmulscale16(p->posy - p->oposy, smoothratio));
|
cposy = p->oposy + xs_CRoundToInt(fmulscale16(p->posy - p->oposy, smoothratio));
|
||||||
cposz = p->oposz + xs_CRoundToInt(fmulscale16(p->posz - p->oposz, smoothratio));
|
cposz = p->oposz + xs_CRoundToInt(fmulscale16(p->posz - p->oposz, smoothratio));
|
||||||
if (cl_syncinput)
|
if (SyncInput())
|
||||||
{
|
{
|
||||||
// Original code for when the values are passed through the sync struct
|
// Original code for when the values are passed through the sync struct
|
||||||
choriz = p->horizon.interpolatedsum(smoothratio);
|
choriz = p->horizon.interpolatedsum(smoothratio);
|
||||||
|
|
|
@ -1652,7 +1652,7 @@ drawscreen(PLAYERp pp, double smoothratio)
|
||||||
|
|
||||||
// Interpolate the player's angle while on a sector object, just like VoidSW.
|
// Interpolate the player's angle while on a sector object, just like VoidSW.
|
||||||
// This isn't needed for the turret as it was fixable, but moving sector objects are problematic.
|
// This isn't needed for the turret as it was fixable, but moving sector objects are problematic.
|
||||||
if (cl_syncinput || pp != Player+myconnectindex)
|
if (SyncInput() || pp != Player+myconnectindex)
|
||||||
{
|
{
|
||||||
tang = camerapp->angle.interpolatedsum(smoothratio);
|
tang = camerapp->angle.interpolatedsum(smoothratio);
|
||||||
thoriz = camerapp->horizon.interpolatedsum(smoothratio);
|
thoriz = camerapp->horizon.interpolatedsum(smoothratio);
|
||||||
|
|
|
@ -203,7 +203,7 @@ void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput)
|
||||||
processMovement(&input, &loc, hidInput, scaleAdjust, 0, !pp->sop, pp->sop_control ? 3. / 1.40625 : 1.);
|
processMovement(&input, &loc, hidInput, scaleAdjust, 0, !pp->sop, pp->sop_control ? 3. / 1.40625 : 1.);
|
||||||
processWeapon(pp);
|
processWeapon(pp);
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
if (TEST(pp->Flags2, PF2_INPUT_CAN_AIM))
|
if (TEST(pp->Flags2, PF2_INPUT_CAN_AIM))
|
||||||
{
|
{
|
||||||
|
|
|
@ -252,7 +252,7 @@ void so_updateinterpolations(void) // Stick at beginning of domovethings
|
||||||
for (sop = SectorObject, interp = so_interpdata;
|
for (sop = SectorObject, interp = so_interpdata;
|
||||||
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
||||||
{
|
{
|
||||||
bool skip = !cl_syncinput && (sop->track == SO_TURRET);
|
bool skip = !SyncInput() && (sop->track == SO_TURRET);
|
||||||
if (SO_EMPTY(sop) || skip)
|
if (SO_EMPTY(sop) || skip)
|
||||||
continue;
|
continue;
|
||||||
if (interp->tic < interp->lasttic)
|
if (interp->tic < interp->lasttic)
|
||||||
|
@ -291,7 +291,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
|
||||||
for (sop = SectorObject, interp = so_interpdata;
|
for (sop = SectorObject, interp = so_interpdata;
|
||||||
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
||||||
{
|
{
|
||||||
bool skip = !cl_syncinput && (sop->track == SO_TURRET);
|
bool skip = !SyncInput() && (sop->track == SO_TURRET);
|
||||||
if (SO_EMPTY(sop) || skip)
|
if (SO_EMPTY(sop) || skip)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
|
||||||
for (sop = SectorObject, interp = so_interpdata;
|
for (sop = SectorObject, interp = so_interpdata;
|
||||||
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
||||||
{
|
{
|
||||||
bool skip = !cl_syncinput && (sop->track == SO_TURRET);
|
bool skip = !SyncInput() && (sop->track == SO_TURRET);
|
||||||
if (SO_EMPTY(sop) || skip)
|
if (SO_EMPTY(sop) || skip)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ void so_restoreinterpolations(void) // Stick at end of drawscree
|
||||||
for (sop = SectorObject, interp = so_interpdata;
|
for (sop = SectorObject, interp = so_interpdata;
|
||||||
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
||||||
{
|
{
|
||||||
bool skip = !cl_syncinput && (sop->track == SO_TURRET);
|
bool skip = !SyncInput() && (sop->track == SO_TURRET);
|
||||||
if (SO_EMPTY(sop) || skip)
|
if (SO_EMPTY(sop) || skip)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -2142,7 +2142,7 @@ DoPlayerMove(PLAYERp pp)
|
||||||
|
|
||||||
SlipSlope(pp);
|
SlipSlope(pp);
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_TURN_GENERAL);
|
SET(pp->Flags2, PF2_INPUT_CAN_TURN_GENERAL);
|
||||||
}
|
}
|
||||||
|
@ -2270,7 +2270,7 @@ DoPlayerMove(PLAYERp pp)
|
||||||
|
|
||||||
DoPlayerSetWadeDepth(pp);
|
DoPlayerSetWadeDepth(pp);
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
||||||
}
|
}
|
||||||
|
@ -2433,7 +2433,7 @@ DoPlayerMoveBoat(PLAYERp pp)
|
||||||
PlaySOsound(pp->sop->mid_sector,SO_IDLE_SOUND);
|
PlaySOsound(pp->sop->mid_sector,SO_IDLE_SOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_TURN_BOAT);
|
SET(pp->Flags2, PF2_INPUT_CAN_TURN_BOAT);
|
||||||
}
|
}
|
||||||
|
@ -2488,7 +2488,7 @@ DoPlayerMoveBoat(PLAYERp pp)
|
||||||
OperateSectorObject(pp->sop, pp->angle.ang.asbuild(), pp->posx, pp->posy);
|
OperateSectorObject(pp->sop, pp->angle.ang.asbuild(), pp->posx, pp->posy);
|
||||||
pp->cursectnum = save_sectnum; // for speed
|
pp->cursectnum = save_sectnum; // for speed
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
||||||
}
|
}
|
||||||
|
@ -2939,7 +2939,7 @@ DoPlayerMoveVehicle(PLAYERp pp)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_TURN_VEHICLE);
|
SET(pp->Flags2, PF2_INPUT_CAN_TURN_VEHICLE);
|
||||||
}
|
}
|
||||||
|
@ -2984,7 +2984,7 @@ DoPlayerMoveVehicle(PLAYERp pp)
|
||||||
OperateSectorObject(pp->sop, pp->angle.ang.asbuild(), pp->posx, pp->posy);
|
OperateSectorObject(pp->sop, pp->angle.ang.asbuild(), pp->posx, pp->posy);
|
||||||
pp->cursectnum = save_sectnum; // for speed
|
pp->cursectnum = save_sectnum; // for speed
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
||||||
}
|
}
|
||||||
|
@ -3007,7 +3007,7 @@ DoPlayerMoveTurret(PLAYERp pp)
|
||||||
PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND);
|
PlaySOsound(pp->sop->mid_sector, SO_IDLE_SOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_TURN_TURRET);
|
SET(pp->Flags2, PF2_INPUT_CAN_TURN_TURRET);
|
||||||
}
|
}
|
||||||
|
@ -3021,7 +3021,7 @@ DoPlayerMoveTurret(PLAYERp pp)
|
||||||
else
|
else
|
||||||
SET(pp->Flags, PF_PLAYER_MOVED);
|
SET(pp->Flags, PF_PLAYER_MOVED);
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
||||||
}
|
}
|
||||||
|
@ -3600,7 +3600,7 @@ DoPlayerClimb(PLAYERp pp)
|
||||||
sp->z = pp->posz + PLAYER_HEIGHT;
|
sp->z = pp->posz + PLAYER_HEIGHT;
|
||||||
changespritesect(pp->PlayerSprite, pp->cursectnum);
|
changespritesect(pp->PlayerSprite, pp->cursectnum);
|
||||||
|
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
SET(pp->Flags2, PF2_INPUT_CAN_AIM);
|
||||||
}
|
}
|
||||||
|
@ -6169,7 +6169,7 @@ void DoPlayerDeathFollowKiller(PLAYERp pp)
|
||||||
// allow turning
|
// allow turning
|
||||||
if (TEST(pp->Flags, PF_DEAD_HEAD|PF_HEAD_CONTROL))
|
if (TEST(pp->Flags, PF_DEAD_HEAD|PF_HEAD_CONTROL))
|
||||||
{
|
{
|
||||||
if (!cl_syncinput)
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
SET(pp->Flags2, PF2_INPUT_CAN_TURN_GENERAL);
|
SET(pp->Flags2, PF2_INPUT_CAN_TURN_GENERAL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue