From 8b43ed577744a3dca5775eb5252abcb516b7e480 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 19 Oct 2019 23:43:35 +0000 Subject: [PATCH] Rename timerUpdate() and timerGetRate() to timerUpdateClock() and timerGetClockRate(), because they both only apply to totalclock git-svn-id: https://svn.eduke32.com/eduke32@8169 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/build/src/timer.cpp # source/build/src/winlayer.cpp --- source/build/include/timer.h | 4 ++-- source/build/src/mdsprite.cpp | 4 ++-- source/build/src/sdlayer.cpp | 2 +- source/build/src/timer.cpp | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/source/build/include/timer.h b/source/build/include/timer.h index a2f6c781f..942e06d30 100644 --- a/source/build/include/timer.h +++ b/source/build/include/timer.h @@ -9,8 +9,8 @@ #define timerUninit() int timerInit(int const tickspersecond); -void timerUpdate(void); -int timerGetRate(void); +void timerUpdateClock(void); +int timerGetClockRate(void); uint64_t timerGetTicksU64(void); uint64_t timerGetFreqU64(void); double timerGetHiTicks(void); diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index 1e906c523..0ae9b30b4 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -614,7 +614,7 @@ void updateanimation(md2model_t *m, tspriteptr_t tspr, uint8_t lpal) fps = smooth->mdsmooth ? Blrintf((1.0f / ((float)tile2model[tile].smoothduration * (1.f / (float)UINT16_MAX))) * 66.f) : anim ? anim->fpssc : 1; - i = (mdtims - sprext->mdanimtims) * ((fps * timerGetRate()) / 120); + i = (mdtims - sprext->mdanimtims) * ((fps * timerGetClockRate()) / 120); j = (smooth->mdsmooth || !anim) ? 65536 : ((anim->endframe + 1 - anim->startframe) << 16); @@ -622,7 +622,7 @@ void updateanimation(md2model_t *m, tspriteptr_t tspr, uint8_t lpal) if (i < 0) { i = 0; sprext->mdanimtims = mdtims; } //compare with j*2 instead of j to ensure i stays > j-65536 for MDANIM_ONESHOT if (anim && (i >= j+j) && (fps) && !mdpause) //Keep mdanimtims close to mdtims to avoid the use of MOD - sprext->mdanimtims += j/((fps*timerGetRate())/120); + sprext->mdanimtims += j/((fps*timerGetClockRate())/120); k = i; diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index e6fee3046..fda5427ff 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -2212,7 +2212,7 @@ int32_t handleevents(void) rv = handleevents_pollsdl(); inputchecked = 0; - timerUpdate(); + timerUpdateClock(); #ifndef _WIN32 startwin_idle(NULL); diff --git a/source/build/src/timer.cpp b/source/build/src/timer.cpp index 2507c7e6f..9f1d5e584 100644 --- a/source/build/src/timer.cpp +++ b/source/build/src/timer.cpp @@ -1,3 +1,4 @@ +// Build engine timer stuff #include "timer.h" @@ -15,7 +16,7 @@ static time_point timerlastsample; static int timerticspersec; static void(*usertimercallback)(void) = NULL; -int timerGetRate(void) { return timerticspersec; } +int timerGetClockRate(void) { return timerticspersec; } uint32_t timerGetTicks(void) { return duration_cast(steady_clock::now().time_since_epoch()).count(); } uint64_t timerGetTicksU64(void) { return steady_clock::now().time_since_epoch().count() * steady_clock::period::num; } uint64_t timerGetFreqU64(void) { return steady_clock::period::den; } @@ -34,7 +35,7 @@ int timerInit(int const tickspersecond) return 0; } -ATTRIBUTE((flatten)) void timerUpdate(void) +ATTRIBUTE((flatten)) void timerUpdateClock(void) { auto time = steady_clock::now(); auto elapsedTime = time - timerlastsample;