- Completely remove current scaled angle change setup.

* During this transition, temporarily enforce synchronised input at all times.
This commit is contained in:
Mitchell Richters 2022-12-07 10:31:17 +11:00 committed by Christoph Oelckers
parent 4078c6d6bd
commit 15b101870d
7 changed files with 6 additions and 55 deletions

View file

@ -73,30 +73,6 @@ struct PlayerAngles
void addRoll(const DAngle value) { updateAngle(ROLL, pActor->spr.Angles.Roll + value); } void addRoll(const DAngle value) { updateAngle(ROLL, pActor->spr.Angles.Roll + value); }
void setRoll(const DAngle value, const bool backup = false) { updateAngle(ROLL, value, backup); } void setRoll(const DAngle value, const bool backup = false) { updateAngle(ROLL, value, backup); }
// Applicator of pending angle changes.
void applyScaledAdjustments(const double scaleAdjust)
{
for (unsigned i = 0; i < MAXANGLES; i++)
{
if (Targets[i].Sgn())
{
// Calculate scaled amount of target and add to the accumlation buffer.
DAngle addition = Targets[i] * scaleAdjust;
AppliedAmounts[i] += addition;
// Test whether we're now reached/exceeded our target.
if (abs(AppliedAmounts[i]) >= abs(Targets[i]))
{
addition -= AppliedAmounts[i] - Targets[i];
Targets[i] = AppliedAmounts[i] = nullAngle;
}
// Apply the scaled addition to the angle.
pActor->spr.Angles[i] += addition;
}
}
}
private: private:
// DRotator indices. // DRotator indices.
enum : unsigned enum : unsigned
@ -108,22 +84,13 @@ private:
}; };
// Private data which should never be accessed publically. // Private data which should never be accessed publically.
DRotator Targets, AppliedAmounts;
DCoreActor* pActor; DCoreActor* pActor;
// Internal angle updater to reduce boilerplate from the public setters. // Internal angle updater to reduce boilerplate from the public setters.
void updateAngle(const unsigned angIndex, const DAngle value, const bool backup = false) void updateAngle(const unsigned angIndex, const DAngle value, const bool backup = false)
{ {
if (!SyncInput() && !backup) pActor->spr.Angles[angIndex] = value;
{ if (backup) pActor->PrevAngles[angIndex] = pActor->spr.Angles[angIndex];
Targets[angIndex] = deltaangle(pActor->spr.Angles[angIndex], value);
AppliedAmounts[angIndex] = nullAngle;
}
else
{
pActor->spr.Angles[angIndex] = value;
if (backup) pActor->PrevAngles[angIndex] = pActor->spr.Angles[angIndex];
}
} }
}; };

View file

@ -109,7 +109,7 @@ extern double inputScale;
inline bool SyncInput() inline bool SyncInput()
{ {
return gamesetinput || cl_syncinput || cl_capfps; return true; //gamesetinput || cl_syncinput || cl_capfps;
} }
inline float backendinputscale() inline float backendinputscale()

View file

@ -540,6 +540,9 @@ void TryRunTics (void)
realtics = entertic - oldentertics; realtics = entertic - oldentertics;
oldentertics = entertic; oldentertics = entertic;
// update the scale factor for unsynchronised input here.
inputScale = I_GetInputFrac(SyncInput());
// get available tics // get available tics
NetUpdate (); NetUpdate ();

View file

@ -598,10 +598,6 @@ void viewDrawScreen(bool sceneonly)
{ {
PLAYER* pPlayer = &gPlayer[gViewIndex]; PLAYER* pPlayer = &gPlayer[gViewIndex];
// process scaled actor adjustments prior to drawing.
if ((inputScale = I_GetInputFrac(SyncInput())) != 1.)
pPlayer->Angles.applyScaledAdjustments(inputScale);
if (testgotpic(2342, true)) if (testgotpic(2342, true))
{ {
FireProcess(); FireProcess();

View file

@ -221,10 +221,6 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
player_struct* p = &ps[snum]; player_struct* p = &ps[snum];
// process scaled actor adjustments prior to drawing.
if ((inputScale = I_GetInputFrac(SyncInput())) != 1.)
p->Angles.applyScaledAdjustments(inputScale);
if (automapMode == am_full || !p->insector()) if (automapMode == am_full || !p->insector())
return; return;

View file

@ -201,13 +201,6 @@ void DrawView(double interpfrac, bool sceneonly)
auto pDop = pPlayer->pDoppleSprite; auto pDop = pPlayer->pDoppleSprite;
auto nDoppleOldCstat = pDop->spr.cstat; auto nDoppleOldCstat = pDop->spr.cstat;
// process scaled actor adjustments prior to drawing.
if ((inputScale = I_GetInputFrac(SyncInput())) != 1.)
{
pPlayer->Angles.applyScaledAdjustments(inputScale);
UpdatePlayerSpriteAngle(pPlayer);
}
if (nSnakeCam >= 0 && !sceneonly) if (nSnakeCam >= 0 && !sceneonly)
{ {
DExhumedActor* pActor = SnakeList[nSnakeCam].pSprites[0]; DExhumedActor* pActor = SnakeList[nSnakeCam].pSprites[0];

View file

@ -1237,10 +1237,6 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
if (cl_sointerpolation) so_dointerpolations(interpfrac); if (cl_sointerpolation) so_dointerpolations(interpfrac);
} }
// process scaled actor adjustments prior to drawing.
if ((inputScale = I_GetInputFrac(SyncInput())) != 1.)
pp->Angles.applyScaledAdjustments(inputScale);
// Get initial player position, interpolating if required. // Get initial player position, interpolating if required.
DVector3 tpos = camerapp->actor->getRenderPos(interpfrac); DVector3 tpos = camerapp->actor->getRenderPos(interpfrac);
DRotator tangles = camerapp->Angles.getRenderAngles(interpfrac); DRotator tangles = camerapp->Angles.getRenderAngles(interpfrac);