mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-29 04:50:42 +00:00
- All Games: Remove use of timerGetHiTicks()
.
This commit is contained in:
parent
b883204f6a
commit
aba5c4c134
9 changed files with 9 additions and 14 deletions
|
@ -783,7 +783,7 @@ static void gameInit()
|
||||||
static void gameTicker()
|
static void gameTicker()
|
||||||
{
|
{
|
||||||
bool gameUpdate = false;
|
bool gameUpdate = false;
|
||||||
double const gameUpdateStartTime = timerGetHiTicks();
|
double const gameUpdateStartTime = I_msTimeF();
|
||||||
while (gPredictTail < gNetFifoHead[myconnectindex] && !paused)
|
while (gPredictTail < gNetFifoHead[myconnectindex] && !paused)
|
||||||
{
|
{
|
||||||
viewUpdatePrediction(&gFifoInput[gPredictTail & 255][myconnectindex]);
|
viewUpdatePrediction(&gFifoInput[gPredictTail & 255][myconnectindex]);
|
||||||
|
@ -815,7 +815,7 @@ static void gameTicker()
|
||||||
}
|
}
|
||||||
if (gameUpdate)
|
if (gameUpdate)
|
||||||
{
|
{
|
||||||
g_gameUpdateTime = timerGetHiTicks() - gameUpdateStartTime;
|
g_gameUpdateTime = I_msTimeF() - gameUpdateStartTime;
|
||||||
if (g_gameUpdateAvgTime < 0.f)
|
if (g_gameUpdateAvgTime < 0.f)
|
||||||
g_gameUpdateAvgTime = g_gameUpdateTime;
|
g_gameUpdateAvgTime = g_gameUpdateTime;
|
||||||
g_gameUpdateAvgTime = ((GAMEUPDATEAVGTIMENUMSAMPLES - 1.f) * g_gameUpdateAvgTime + g_gameUpdateTime) / ((float)GAMEUPDATEAVGTIMENUMSAMPLES);
|
g_gameUpdateAvgTime = ((GAMEUPDATEAVGTIMENUMSAMPLES - 1.f) * g_gameUpdateAvgTime + g_gameUpdateTime) / ((float)GAMEUPDATEAVGTIMENUMSAMPLES);
|
||||||
|
@ -826,7 +826,7 @@ static void gameTicker()
|
||||||
{
|
{
|
||||||
netCheckSync();
|
netCheckSync();
|
||||||
viewDrawScreen();
|
viewDrawScreen();
|
||||||
g_gameUpdateAndDrawTime = g_beforeSwapTime/* timerGetHiTicks()*/ - gameUpdateStartTime;
|
g_gameUpdateAndDrawTime = g_beforeSwapTime/* I_msTimeF()*/ - gameUpdateStartTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ void ctrlGetInput(void)
|
||||||
ControlInfo info;
|
ControlInfo info;
|
||||||
|
|
||||||
static double lastInputTicks;
|
static double lastInputTicks;
|
||||||
auto const currentHiTicks = timerGetHiTicks();
|
auto const currentHiTicks = I_msTimeF();
|
||||||
double const elapsedInputTicks = currentHiTicks - lastInputTicks;
|
double const elapsedInputTicks = currentHiTicks - lastInputTicks;
|
||||||
|
|
||||||
lastInputTicks = currentHiTicks;
|
lastInputTicks = currentHiTicks;
|
||||||
|
|
|
@ -1105,7 +1105,7 @@ FString GameInterface::statFPS(void)
|
||||||
static float lastFPS, minFPS = FLT_MAX, maxFPS;
|
static float lastFPS, minFPS = FLT_MAX, maxFPS;
|
||||||
static double minGameUpdate = DBL_MAX, maxGameUpdate;
|
static double minGameUpdate = DBL_MAX, maxGameUpdate;
|
||||||
|
|
||||||
double frameTime = timerGetHiTicks();
|
double frameTime = I_msTimeF();
|
||||||
double frameDelay = frameTime - lastFrameTime;
|
double frameDelay = frameTime - lastFrameTime;
|
||||||
cumulativeFrameDelay += frameDelay;
|
cumulativeFrameDelay += frameDelay;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// for compatibility
|
// for compatibility
|
||||||
#define timerUninit()
|
#define timerUninit()
|
||||||
|
|
||||||
double timerGetHiTicks(void);
|
|
||||||
uint32_t timerGetTicks(void);
|
uint32_t timerGetTicks(void);
|
||||||
|
|
||||||
#endif // timer_h__
|
#endif // timer_h__
|
||||||
|
|
|
@ -2722,7 +2722,7 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups
|
||||||
//
|
//
|
||||||
void videoNextPage(void)
|
void videoNextPage(void)
|
||||||
{
|
{
|
||||||
g_beforeSwapTime = timerGetHiTicks();
|
g_beforeSwapTime = I_msTimeF();
|
||||||
videoShowFrame(0);
|
videoShowFrame(0);
|
||||||
|
|
||||||
omdtims = mdtims;
|
omdtims = mdtims;
|
||||||
|
|
|
@ -16,7 +16,3 @@ static time_point<steady_clock> timerlastsample;
|
||||||
static int timerticspersec;
|
static int timerticspersec;
|
||||||
|
|
||||||
uint32_t timerGetTicks(void) { return duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count(); }
|
uint32_t timerGetTicks(void) { return duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count(); }
|
||||||
|
|
||||||
// Returns the time since an unspecified starting time in milliseconds.
|
|
||||||
// (May be not monotonic for certain configurations.)
|
|
||||||
double timerGetHiTicks(void) { return duration<double, nano>(steady_clock::now().time_since_epoch()).count() / 1000000.0; }
|
|
||||||
|
|
|
@ -401,7 +401,7 @@ FString GameInterface::statFPS()
|
||||||
static float lastFPS; // , minFPS = std::numeric_limits<float>::max(), maxFPS;
|
static float lastFPS; // , minFPS = std::numeric_limits<float>::max(), maxFPS;
|
||||||
//static double minGameUpdate = std::numeric_limits<double>::max(), maxGameUpdate;
|
//static double minGameUpdate = std::numeric_limits<double>::max(), maxGameUpdate;
|
||||||
|
|
||||||
double frameTime = timerGetHiTicks();
|
double frameTime = I_msTimeF();
|
||||||
double frameDelay = frameTime - lastFrameTime;
|
double frameDelay = frameTime - lastFrameTime;
|
||||||
cumulativeFrameDelay += frameDelay;
|
cumulativeFrameDelay += frameDelay;
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ void PlayerInterruptKeys()
|
||||||
CONTROL_GetInput(&info);
|
CONTROL_GetInput(&info);
|
||||||
|
|
||||||
static double lastInputTicks;
|
static double lastInputTicks;
|
||||||
auto const currentHiTicks = timerGetHiTicks();
|
auto const currentHiTicks = I_msTimeF();
|
||||||
double const elapsedInputTicks = currentHiTicks - lastInputTicks;
|
double const elapsedInputTicks = currentHiTicks - lastInputTicks;
|
||||||
|
|
||||||
lastInputTicks = currentHiTicks;
|
lastInputTicks = currentHiTicks;
|
||||||
|
|
|
@ -115,7 +115,7 @@ getinput(SW_PACKET *loc, SWBOOL tied)
|
||||||
|
|
||||||
static double lastInputTicks;
|
static double lastInputTicks;
|
||||||
|
|
||||||
auto const currentHiTicks = timerGetHiTicks();
|
auto const currentHiTicks = I_msTimeF();
|
||||||
elapsedInputTicks = currentHiTicks - lastInputTicks;
|
elapsedInputTicks = currentHiTicks - lastInputTicks;
|
||||||
|
|
||||||
lastInputTicks = currentHiTicks;
|
lastInputTicks = currentHiTicks;
|
||||||
|
|
Loading…
Reference in a new issue