mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- SW: Flatten smoothratio back to float and rename to interpfrac
.
This commit is contained in:
parent
1f7362c158
commit
f776489f06
6 changed files with 10 additions and 15 deletions
|
@ -1128,7 +1128,7 @@ void RestorePortalState()
|
|||
}
|
||||
}
|
||||
|
||||
void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
|
||||
void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
|
||||
{
|
||||
DAngle tang, trotscrnang;
|
||||
fixedhoriz thoriz;
|
||||
|
@ -1137,9 +1137,6 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
|
|||
// prediction player if prediction is on, else regular player
|
||||
PLAYER* camerapp = (PredictionOn && CommEnabled && pp == Player+myconnectindex) ? ppp : pp;
|
||||
|
||||
// temporary interpolation scaler.
|
||||
double interpfrac = smoothratio * (1. / MaxSmoothRatio);
|
||||
|
||||
DrawScreen = true;
|
||||
PreDraw();
|
||||
|
||||
|
@ -1149,7 +1146,7 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
|
|||
{
|
||||
// Stick at beginning of drawscreen
|
||||
DoInterpolations(interpfrac);
|
||||
if (cl_sointerpolation) so_dointerpolations((int)smoothratio);
|
||||
if (cl_sointerpolation) so_dointerpolations(interpfrac);
|
||||
}
|
||||
|
||||
// Get initial player position, interpolating if required.
|
||||
|
|
|
@ -709,7 +709,7 @@ void GameInterface::Render()
|
|||
{
|
||||
drawtime.Reset();
|
||||
drawtime.Clock();
|
||||
drawscreen(Player + screenpeek, (paused || !cl_interpolate || cl_capfps ? 1. : I_GetTimeFrac()) * MaxSmoothRatio, false);
|
||||
drawscreen(Player + screenpeek, paused || !cl_interpolate || cl_capfps ? 1. : I_GetTimeFrac(), false);
|
||||
drawtime.Unclock();
|
||||
}
|
||||
|
||||
|
|
|
@ -352,7 +352,7 @@ void so_updateinterpolations(void) // Stick at beginning of domovethings
|
|||
|
||||
// must call restore for every do interpolations
|
||||
// make sure you don't exit
|
||||
void so_dointerpolations(int32_t smoothratio) // Stick at beginning of drawscreen
|
||||
void so_dointerpolations(double interpfrac) // Stick at beginning of drawscreen
|
||||
{
|
||||
int32_t i;
|
||||
SECTOR_OBJECT* sop;
|
||||
|
@ -418,9 +418,9 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
|
|||
!Player[screenpeek].sop_remote)))
|
||||
continue;
|
||||
|
||||
int32_t ratio = smoothratio * synctics + MaxSmoothRatio * interp->tic;
|
||||
double ratio = interpfrac * synctics + interp->tic;
|
||||
ratio /= interp->lasttic;
|
||||
ratio = (interp->tic == interp->lasttic) ? MaxSmoothRatio : ratio;
|
||||
ratio = (interp->tic == interp->lasttic) ? 1. : ratio;
|
||||
|
||||
for (i = 0, data = interp->data; i < interp->numinterpolations; i++, data++)
|
||||
{
|
||||
|
@ -443,12 +443,12 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
|
|||
{
|
||||
DSWActor* actor = data->actorofang;
|
||||
if (!actor) continue;
|
||||
actor->set_int_ang(NORM_ANGLE(data->lastoldipos + MulScale(data->lastangdiff.Buildang(), ratio, 16)));
|
||||
actor->spr.angle = (DAngle::fromBuildf(data->lastoldipos) + data->lastangdiff * ratio).Normalized360();
|
||||
}
|
||||
else
|
||||
{
|
||||
double delta = data->lastipos - data->lastoldipos;
|
||||
setvalue(*data, data->lastoldipos + MulScaleF(delta, ratio, 16));
|
||||
setvalue(*data, data->lastoldipos + delta * ratio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ void so_stopspriteinterpolation(SECTOR_OBJECT* sop, DSWActor *sp);
|
|||
void so_setinterpolationangdiff(SECTOR_OBJECT* sop, int16_t angdiff);
|
||||
void so_setinterpolationtics(SECTOR_OBJECT* sop, int16_t locktics);
|
||||
void so_updateinterpolations(void);
|
||||
void so_dointerpolations(int32_t smoothratio);
|
||||
void so_dointerpolations(double interpfrac);
|
||||
void so_restoreinterpolations(void);
|
||||
void so_serializeinterpolations(FSerializer& arc);
|
||||
|
||||
|
|
|
@ -55,8 +55,6 @@ gNET gNet;
|
|||
bool CommEnabled = false;
|
||||
uint8_t CommPlayers = 0;
|
||||
|
||||
double smoothratio;
|
||||
|
||||
// must start out as 0
|
||||
|
||||
void InitNetPlayerOptions(void)
|
||||
|
|
|
@ -193,7 +193,7 @@ enum
|
|||
PANEL_SPRITE* pSpawnSprite(PLAYER* pp, PANEL_STATE* state, uint8_t priority, double x, double y);
|
||||
void pSetSuicide(PANEL_SPRITE* psp);
|
||||
bool pKillScreenSpiteIDs(PLAYER* pp, short id);
|
||||
void PreUpdatePanel(double smoothratio);
|
||||
void PreUpdatePanel(double interpfrac);
|
||||
void UpdatePanel(double interpfrac);
|
||||
void PlayerUpdateArmor(PLAYER* pp,short value);
|
||||
void pToggleCrosshair(void);
|
||||
|
|
Loading…
Reference in a new issue