Commit fb9ec43f authored by Evan Ramos's avatar Evan Ramos
Browse files

Move calc_smoothratio to baselayer.h, fixing USE_OPENGL=0 build

Followup to 0f928a1f.
parent d01cd25d
...@@ -311,6 +311,18 @@ extern int engineFPSLimit(void); ...@@ -311,6 +311,18 @@ extern int engineFPSLimit(void);
} }
#endif #endif
static inline int32_t calc_smoothratio(ClockTicks const totalclk, ClockTicks const ototalclk, int gameTicRate)
{
int const tfreq = (int)refreshfreq;
int const clk = (totalclk - ototalclk).toScale16();
int const ratio = tabledivide32_noinline(clk * tfreq, tabledivide32_noinline(timerGetClockRate() * tfreq, gameTicRate));
#if 0 //ndef NDEBUG
if ((unsigned)ratio > 66048)
OSD_Printf("calc_smoothratio: ratio: %d\n", ratio);
#endif
return clamp(ratio, 0, 65536);
}
#include "print.h" #include "print.h"
#endif // baselayer_h_ #endif // baselayer_h_
......
...@@ -1817,16 +1817,4 @@ static inline float tspriteGetZOfSlopeFloat(tspriteptr_t const tspr, float dax, ...@@ -1817,16 +1817,4 @@ static inline float tspriteGetZOfSlopeFloat(tspriteptr_t const tspr, float dax,
} }
#endif #endif
static inline int32_t calc_smoothratio(ClockTicks const totalclk, ClockTicks const ototalclk, int gameTicRate)
{
int const tfreq = (int)refreshfreq;
int const clk = (totalclk - ototalclk).toScale16();
int const ratio = tabledivide32_noinline(clk * tfreq, tabledivide32_noinline(timerGetClockRate() * tfreq, gameTicRate));
#if 0 //ndef NDEBUG
if ((unsigned)ratio > 66048)
OSD_Printf("calc_smoothratio: ratio: %d\n", ratio);
#endif
return clamp(ratio, 0, 65536);
}
#endif // build_h_ #endif // build_h_
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment