mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 14:41:55 +00:00
- Core: Remove legacy smoothratio calculator CalcSmoothRatio()
.
This commit is contained in:
parent
e0aaaf1f60
commit
ef728429e0
5 changed files with 0 additions and 60 deletions
|
@ -97,9 +97,6 @@ int myconnectindex, numplayers;
|
|||
int connecthead, connectpoint2[MAXMULTIPLAYERS];
|
||||
int32_t xres = -1, yres = -1, bpp = 0;
|
||||
auto vsnprintfptr = vsnprintf; // This is an inline in Visual Studio but we need an address for it to satisfy the MinGW compiled libraries.
|
||||
static int lastototalclk;
|
||||
static uint64_t elapsedTime;
|
||||
static uint64_t lastTime;
|
||||
int gameclock;
|
||||
int lastTic;
|
||||
|
||||
|
@ -1127,52 +1124,6 @@ void S_SetSoundPaused(int state)
|
|||
}
|
||||
}
|
||||
|
||||
double CalcSmoothRatio(int totalclk, int ototalclk, int realgameticspersec)
|
||||
{
|
||||
double ratio, result;
|
||||
|
||||
if (cl_debugintrpl)
|
||||
{
|
||||
Printf("ototalclk: %d\ntotalclk: %d\n", ototalclk, totalclk);
|
||||
}
|
||||
|
||||
if (!cl_legacyintrpl)
|
||||
{
|
||||
double const gametics = 1'000'000'000. / realgameticspersec;
|
||||
uint64_t currentTime = I_GetTimeNS();
|
||||
|
||||
if ((lastototalclk == ototalclk) && (lastTime != 0))
|
||||
{
|
||||
elapsedTime += currentTime - lastTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastototalclk = ototalclk;
|
||||
elapsedTime = lastTime != 0 ? (currentTime - lastTime) / 72 : 0;
|
||||
}
|
||||
lastTime = currentTime;
|
||||
ratio = elapsedTime / gametics;
|
||||
|
||||
if (cl_debugintrpl)
|
||||
{
|
||||
Printf("gametics: %.3f ms\nelapsedTime: %.3f ms\n", (gametics / 1'000'000.), (elapsedTime / 1'000'000.));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ratio = (0.5 + (totalclk - ototalclk)) / (120 / realgameticspersec);
|
||||
}
|
||||
|
||||
result = clamp2(ratio * MaxSmoothRatio, 0., MaxSmoothRatio);
|
||||
|
||||
if (cl_debugintrpl)
|
||||
{
|
||||
Printf("ratio: %f\nresult: %f\n", ratio, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
FString G_GetDemoPath()
|
||||
{
|
||||
FString path = M_GetDemoPath();
|
||||
|
|
|
@ -192,7 +192,6 @@ void S_ResumeSound(bool notsfx);
|
|||
void S_SetSoundPaused(int state);
|
||||
|
||||
void G_FatalEngineError(void);
|
||||
double CalcSmoothRatio(int totalclk, int ototalclk, int realgameticspersec);
|
||||
enum
|
||||
{
|
||||
MaxSmoothRatio = FRACUNIT
|
||||
|
|
|
@ -91,8 +91,6 @@ CVARD(Bool, cl_slopetilting, false, CVAR_ARCHIVE, "enable/disable slope tilting"
|
|||
CVARD(Int, cl_showweapon, 1, CVAR_ARCHIVE, "enable/disable show weapons") // only implemented in Blood
|
||||
CVARD(Bool, cl_sointerpolation, true, CVAR_ARCHIVE, "enable/disable sector object interpolation") // only implemented in SW
|
||||
CVARD(Bool, cl_syncinput, false, CVAR_ARCHIVE, "enable/disable synchronized input with game's ticrate") // only implemented in SW
|
||||
CVARD(Bool, cl_debugintrpl, false, CVAR_NOSAVE, "print information regarding calculated smoothratio for interpolation")
|
||||
CVARD(Bool, cl_legacyintrpl, false, CVAR_ARCHIVE, "perform legacy interpolation calculations")
|
||||
CUSTOM_CVARD(Int, cl_crosshairscale, 50, CVAR_ARCHIVE, "changes the size of the crosshair")
|
||||
{
|
||||
if (self < 1) self = 1;
|
||||
|
|
|
@ -25,8 +25,6 @@ EXTERN_CVAR(Int, cl_weaponswitch)
|
|||
EXTERN_CVAR(Int, cl_crosshairscale)
|
||||
EXTERN_CVAR(Bool, cl_sointerpolation)
|
||||
EXTERN_CVAR(Bool, cl_syncinput)
|
||||
EXTERN_CVAR(Bool, cl_debugintrpl)
|
||||
EXTERN_CVAR(Bool, cl_legacyintrpl)
|
||||
|
||||
EXTERN_CVAR(Bool, demorec_seeds_cvar)
|
||||
EXTERN_CVAR(Bool, demoplay_diffs)
|
||||
|
|
|
@ -169,12 +169,6 @@ inline bool playrunning()
|
|||
return (paused == 0 || (paused == 1 && (ud.recstat == 2 || ud.multimode > 1)));
|
||||
}
|
||||
|
||||
inline double calc_smoothratio(int totalclk, int ototalclk)
|
||||
{
|
||||
double smoothratio = CalcSmoothRatio(totalclk, ototalclk, REALGAMETICSPERSEC);
|
||||
return (playrunning() ? smoothratio : MaxSmoothRatio);
|
||||
}
|
||||
|
||||
inline void backupplayer(player_struct* p)
|
||||
{
|
||||
backuppos(p);
|
||||
|
|
Loading…
Reference in a new issue