tic_frequency

This commit is contained in:
Alug committed 2025-05-20 16:14:50 +02:00
1 parent 0b9ac05fbe
commit 3cd6fe4e34
4 files changed
+9 -5

No files matched your search

+2 -2
View File
@@ -6544,8 +6544,8 @@ boolean TryRunTics(tic_t realtics, tic_t entertic)
}
precise_t now = I_GetPreciseTime();
double frame = ((double)now / frame_frequency);
netUpdateFudge = (((double)now/ frame_frequency) - frame); // record the timefudge where the net update typically occurs
double frame = ((double)now / tic_frequency);
netUpdateFudge = (((double)now / tic_frequency) - frame); // record the timefudge where the net update typically occurs
NetUpdate();
+1 -1
View File
@@ -1213,7 +1213,7 @@ boolean HGetPacket(void)
extern double netUpdateFudge;
#define gettime ((double)I_GetPreciseTime() / frame_frequency)
#define gettime (I_GetPreciseTime() / tic_frequency)
void TimeFudge(void)
{
// you can use SDL_GetPerformanceFrequency() instead of tic_frequency to get more precise timings
+1 -1
View File
@@ -21,7 +21,7 @@
#pragma interface
#endif
extern double frame_frequency;
extern double tic_frequency;
extern double elapsed_frames;
/** \brief max quit functions
+5 -1
View File
@@ -1710,6 +1710,8 @@ double frame_frequency;
static UINT64 frame_epoch;
double elapsed_frames;
double tic_frequency;
static void I_InitFrameTime(const UINT64 now, const UINT32 cap)
{
frame_rate = cap;
@@ -1789,7 +1791,7 @@ void I_SetTime(tic_t tic, int fudge, boolean useAbsoluteFudge)
tic = max(tic, SDL_GetTicks());
if (useAbsoluteFudge)
elapsed_frames = elapsed_frames + ((double)fudge / 100) * frame_frequency;
elapsed_frames = elapsed_frames + ((double)fudge / 100) * tic_frequency;
}
//
@@ -1801,6 +1803,8 @@ void I_StartupTimer(void)
I_InitFrameTime(0, R_GetFramerateCap());
elapsed_frames = 0.0;
tic_frequency = timer_frequency / (double)NEWTICRATE;
}
void I_Sleep(UINT32 ms)