- 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 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:
// DRotator indices.
enum : unsigned
@ -108,23 +84,14 @@ private:
};
// Private data which should never be accessed publically.
DRotator Targets, AppliedAmounts;
DCoreActor* pActor;
// Internal angle updater to reduce boilerplate from the public setters.
void updateAngle(const unsigned angIndex, const DAngle value, const bool backup = false)
{
if (!SyncInput() && !backup)
{
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];
}
}
};
class FSerializer;

View file

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

View file

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

View file

@ -598,10 +598,6 @@ void viewDrawScreen(bool sceneonly)
{
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))
{
FireProcess();

View file

@ -221,10 +221,6 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
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())
return;

View file

@ -201,13 +201,6 @@ void DrawView(double interpfrac, bool sceneonly)
auto pDop = pPlayer->pDoppleSprite;
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)
{
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);
}
// process scaled actor adjustments prior to drawing.
if ((inputScale = I_GetInputFrac(SyncInput())) != 1.)
pp->Angles.applyScaledAdjustments(inputScale);
// Get initial player position, interpolating if required.
DVector3 tpos = camerapp->actor->getRenderPos(interpfrac);
DRotator tangles = camerapp->Angles.getRenderAngles(interpfrac);