mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- Completely remove current scaled angle change setup.
* During this transition, temporarily enforce synchronised input at all times.
This commit is contained in:
parent
4078c6d6bd
commit
15b101870d
7 changed files with 6 additions and 55 deletions
|
@ -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,22 +84,13 @@ 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];
|
||||
}
|
||||
pActor->spr.Angles[angIndex] = value;
|
||||
if (backup) pActor->PrevAngles[angIndex] = pActor->spr.Angles[angIndex];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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 ();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue