mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- Process scaled angle adjustments in each game's render function, not from the input function.
* Previous config had the potential to call `I_GetInputFrac()` nearly twice in a row, which would have resulted in some hitching. * Calling from each game's render function avoids the above and means we can start applying scaled angle changes one frame faster.
This commit is contained in:
parent
2a284c73c9
commit
5a8612110d
11 changed files with 26 additions and 11 deletions
|
@ -50,6 +50,7 @@ ESyncBits ActionsToSend = 0;
|
|||
static int dpad_lock = 0;
|
||||
bool sendPause;
|
||||
bool crouch_toggle;
|
||||
double inputScale;
|
||||
|
||||
// Mouse speeds
|
||||
CVAR(Float, m_pitch, 1.f, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
|
||||
|
|
|
@ -105,6 +105,7 @@ void SetupGameButtons();
|
|||
void ApplyGlobalInput(InputPacket& input, ControlInfo* const hidInput, bool const crouchable = true, bool const disableToggle = false);
|
||||
extern ESyncBits ActionsToSend;
|
||||
extern bool gamesetinput;
|
||||
extern double inputScale;
|
||||
|
||||
inline bool SyncInput()
|
||||
{
|
||||
|
|
|
@ -134,7 +134,7 @@ void G_BuildTiccmd(ticcmd_t* cmd)
|
|||
cmd->ucmd = {};
|
||||
I_GetEvent();
|
||||
auto input = CONTROL_GetInput();
|
||||
gi->GetInput(&input, I_GetInputFrac(SyncInput()), &cmd->ucmd);
|
||||
gi->GetInput(&input, inputScale, &cmd->ucmd);
|
||||
cmd->consistency = consistency[myconnectindex][(maketic / ticdup) % BACKUPTICS];
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,7 @@ void TryRunTics (void)
|
|||
{
|
||||
I_GetEvent();
|
||||
auto input = CONTROL_GetInput();
|
||||
gi->GetInput(&input, I_GetInputFrac(SyncInput()));
|
||||
gi->GetInput(&input, inputScale);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -62,8 +62,6 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
|||
pPlayer->Angles.applyYaw(input.avel, &pPlayer->input.actions, scaleAdjust);
|
||||
pPlayer->Angles.applyPitch(input.horz, &pPlayer->input.actions, scaleAdjust);
|
||||
}
|
||||
|
||||
pPlayer->Angles.applyScaledAdjustments(scaleAdjust);
|
||||
}
|
||||
|
||||
if (packet)
|
||||
|
|
|
@ -598,6 +598,10 @@ 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();
|
||||
|
|
|
@ -838,8 +838,6 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
|||
p->Angles.applyYaw(p->adjustavel(input.avel), &p->sync.actions, scaleAdjust);
|
||||
p->Angles.applyPitch(input.horz, &p->sync.actions, scaleAdjust);
|
||||
}
|
||||
|
||||
p->Angles.applyScaledAdjustments(scaleAdjust);
|
||||
}
|
||||
|
||||
if (packet)
|
||||
|
|
|
@ -221,6 +221,10 @@ 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;
|
||||
|
||||
|
|
|
@ -95,7 +95,6 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
|||
}
|
||||
}
|
||||
|
||||
pPlayer->Angles.applyScaledAdjustments(scaleAdjust);
|
||||
UpdatePlayerSpriteAngle(pPlayer);
|
||||
}
|
||||
|
||||
|
|
|
@ -195,11 +195,19 @@ void DrawView(double interpfrac, bool sceneonly)
|
|||
|
||||
DoInterpolations(interpfrac);
|
||||
|
||||
auto pPlayerActor = PlayerList[nLocalPlayer].pActor;
|
||||
auto pPlayer = &PlayerList[nLocalPlayer];
|
||||
auto pPlayerActor = pPlayer->pActor;
|
||||
auto nPlayerOldCstat = pPlayerActor->spr.cstat;
|
||||
auto pDop = PlayerList[nLocalPlayer].pDoppleSprite;
|
||||
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,6 +1237,10 @@ 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);
|
||||
|
|
|
@ -199,8 +199,6 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
|||
{
|
||||
DoPlayerTurnTurret(pp, input.avel);
|
||||
}
|
||||
|
||||
pp->Angles.applyScaledAdjustments(scaleAdjust);
|
||||
}
|
||||
|
||||
if (packet)
|
||||
|
|
Loading…
Reference in a new issue