diff --git a/polymer/eduke32/build/include/baselayer.h b/polymer/eduke32/build/include/baselayer.h index 8c565ab8d..da2ad7630 100644 --- a/polymer/eduke32/build/include/baselayer.h +++ b/polymer/eduke32/build/include/baselayer.h @@ -148,8 +148,8 @@ void uninittimer(void); void sampletimer(void); uint32_t getticks(void); int32_t gettimerfreq(void); -uint64_t gethiticks(void); -uint64_t gethitickspersec(void); +uint64_t getu64ticks(void); +uint64_t getu64tickspersec(void); double gethitickms(void); // TODO: Windows void (*installusertimercallback(void (*callback)(void)))(void); diff --git a/polymer/eduke32/build/include/winbits.h b/polymer/eduke32/build/include/winbits.h index 1039fbe7d..ab606d621 100644 --- a/polymer/eduke32/build/include/winbits.h +++ b/polymer/eduke32/build/include/winbits.h @@ -15,7 +15,7 @@ extern void win_allowtaskswitching(int32_t onf); extern int32_t win_checkinstance(void); extern int32_t win_inittimer(void); -extern uint64_t win_gethiticks(void); +extern uint64_t win_getu64ticks(void); extern void win_open(void); extern void win_init(void); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index d35d49228..76d904954 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -258,7 +258,8 @@ int32_t autogray = 0, showinnergray = 1; //#define YAX_DEBUG_YMOSTS #ifdef YAX_DEBUG -double hitickspersec; +// XXX: This could be replaced with the use of gethitickms(). +double u64tickspersec; #endif #ifdef ENGINE_SCREENSHOT_DEBUG int32_t engine_screenshot = 0; @@ -1019,7 +1020,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), j = bunches[cf][bnchcnt]; // the actual bunchnum... yax_globalbunch = j; #ifdef YAX_DEBUG - t=gethiticks(); + t=getu64ticks(); #endif k = bunchsec[j]; @@ -1043,7 +1044,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), yaxdebug("l%d: faked (bn %2d) sec %4d,%3d dspr, ob=[%2d,%2d], sn=%4d, %.3f ms", yax_globallev-YAX_MAXDRAWS, j, k, yax_spritesortcnt[yax_globallev]-odsprcnt, ourbunch[0],ourbunch[1],sectnum, - (double)(1000*(gethiticks()-t))/hitickspersec); + (double)(1000*(getu64ticks()-t))/u64tickspersec); } if (ourbunch[cf]==j) @@ -1103,7 +1104,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), k = bunchsec[j]; // best start-drawing sector yax_globalbunch = j; #ifdef YAX_DEBUG - t=gethiticks(); + t=getu64ticks(); #endif yax_tweakpicnums(j, cf, 0); if (k < 0) @@ -1119,7 +1120,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), { yaxdebug("nm1 l%d: DRAWN (bn %2d) sec %4d, %.3f ms", yax_globallev-YAX_MAXDRAWS, j, k, - (double)(1000*(gethiticks()-t))/hitickspersec); + (double)(1000*(getu64ticks()-t))/u64tickspersec); if (!yax_nomaskdidit) { @@ -1135,7 +1136,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), yax_copytsprites(); yaxdebug("nm0 l%d: DRAWN (bn %2d) sec %4d,%3d tspr, %.3f ms", yax_globallev-YAX_MAXDRAWS, j, k, spritesortcnt, - (double)(1000*(gethiticks()-t))/hitickspersec); + (double)(1000*(getu64ticks()-t))/u64tickspersec); SpriteAnimFunc(globalposx, globalposy, globalang, smoothr); drawmasks(); @@ -1148,7 +1149,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), } #ifdef YAX_DEBUG - t=gethiticks(); + t=getu64ticks(); #endif yax_globalcf = -1; yax_globalbunch = -1; @@ -1162,7 +1163,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), // spritesortcnt = 0; yax_copytsprites(); yaxdebug("DRAWN base level sec %d,%3d tspr, %.3f ms", osectnum, - spritesortcnt, (double)(1000*(gethiticks()-t))/hitickspersec); + spritesortcnt, (double)(1000*(getu64ticks()-t))/u64tickspersec); scansector_collectsprites = 1; for (cf=0; cf<2; cf++) @@ -8635,9 +8636,9 @@ int32_t initengine(void) } #ifdef YAX_DEBUG - hitickspersec = (double)gethitickspersec(); - if (hitickspersec==0.0) - hitickspersec = 1.0; + u64tickspersec = (double)getu64tickspersec(); + if (u64tickspersec==0.0) + u64tickspersec = 1.0; #endif if (loadtables()) diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 745966367..ee895d8bb 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -795,7 +795,7 @@ void releaseallbuttons(void) static Uint32 timerfreq=0; static Uint32 timerlastsample=0; int32_t timerticspersec=0; -static double msperhitick = 0; +static double msperu64tick = 0; static void(*usertimercallback)(void) = NULL; @@ -822,7 +822,7 @@ int32_t inittimer(int32_t tickspersecond) usertimercallback = NULL; - msperhitick = 1000.0 / (double)gethitickspersec(); + msperu64tick = 1000.0 / (double)getu64tickspersec(); return 0; } @@ -840,7 +840,7 @@ void uninittimer(void) win_timerfreq=0; #endif - msperhitick = 0; + msperu64tick = 0; } // @@ -872,11 +872,11 @@ uint32_t getticks(void) } // high-resolution timers for profiling -uint64_t gethiticks(void) +uint64_t getu64ticks(void) { #if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) // SDL 1.2 # if defined _WIN32 - return win_gethiticks(); + return win_getu64ticks(); # elif defined __APPLE__ return mach_absolute_time(); # elif _POSIX_TIMERS>0 && defined _POSIX_MONOTONIC_CLOCK @@ -895,7 +895,7 @@ uint64_t gethiticks(void) # else // Blar. This pragma is unsupported on earlier GCC versions. // At least we'll get a warning and a reference to this line... -# pragma message "Using low-resolution (1ms) timer for gethiticks. Profiling will work badly." +# pragma message "Using low-resolution (1ms) timer for getu64ticks. Profiling will work badly." return SDL_GetTicks(); # endif #else @@ -903,7 +903,7 @@ uint64_t gethiticks(void) #endif } -uint64_t gethitickspersec(void) +uint64_t getu64tickspersec(void) { #if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) // SDL 1.2 # if defined _WIN32 @@ -930,7 +930,7 @@ uint64_t gethitickspersec(void) ATTRIBUTE((flatten)) double gethitickms(void) { - return (double)gethiticks() * msperhitick; + return (double)getu64ticks() * msperu64tick; } // diff --git a/polymer/eduke32/build/src/winbits.c b/polymer/eduke32/build/src/winbits.c index b4a3ea15b..73cf91145 100644 --- a/polymer/eduke32/build/src/winbits.c +++ b/polymer/eduke32/build/src/winbits.c @@ -153,7 +153,7 @@ int32_t win_inittimer(void) return 0; } -uint64_t win_gethiticks(void) +uint64_t win_getu64ticks(void) { uint64_t i; if (win_timerfreq == 0) return 0; diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 472ac3864..6fd40ec45 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -1429,7 +1429,7 @@ static const char *GetDInputError(HRESULT code) static int32_t timerlastsample=0; int32_t timerticspersec=0; -static double msperhitick = 0; +static double msperu64tick = 0; static void (*usertimercallback)(void) = NULL; // This timer stuff is all Ken's idea. @@ -1469,7 +1469,7 @@ int32_t inittimer(int32_t tickspersecond) usertimercallback = NULL; - msperhitick = 1000.0 / (double)gethitickspersec(); + msperu64tick = 1000.0 / (double)getu64tickspersec(); return 0; } @@ -1484,7 +1484,7 @@ void uninittimer(void) win_timerfreq=0; timerticspersec = 0; - msperhitick = 0; + msperu64tick = 0; } // @@ -1521,12 +1521,12 @@ uint32_t getticks(void) } // high-resolution timers for profiling -uint64_t gethiticks(void) +uint64_t getu64ticks(void) { - return win_gethiticks(); + return win_getu64ticks(); } -uint64_t gethitickspersec(void) +uint64_t getu64tickspersec(void) { return win_timerfreq; } @@ -1535,7 +1535,7 @@ uint64_t gethitickspersec(void) ATTRIBUTE((flatten)) double gethitickms(void) { - return (double)gethiticks() * msperhitick; + return (double)getu64ticks() * msperu64tick; } //