File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4871,7 +4871,7 @@ void game_set_frametime(int state)
48714871 Last_frame_timestamp = timestamp ();
48724872
48734873 flFrametime = f2fl (Frametime);
4874- timestamp_inc (flFrametime );
4874+ timestamp_inc (Frametime );
48754875
48764876 // wrap overall frametime if needed
48774877 if ( FrametimeOverall > (INT_MAX - F1_0) )
Original file line number Diff line number Diff line change @@ -214,9 +214,10 @@ void timestamp_reset()
214214// something like 1 minute (6000).
215215#define MAX_TIME (INT_MAX/2 )
216216
217- void timestamp_inc (float frametime)
217+ void timestamp_inc (fix frametime)
218218{
219- timestamp_ticker += (int )(frametime*TIMESTAMP_FREQUENCY);
219+ auto frametime_ms = fixmul (frametime, F1_0 * TIMESTAMP_FREQUENCY);
220+ timestamp_ticker += f2i (frametime_ms);
220221
221222 if ( timestamp_ticker > MAX_TIME ) {
222223 timestamp_ticker = 2 ; // Roll!
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ extern int timestamp_ticker;
7373extern void timestamp_reset ();
7474
7575// Call this once every frame with the frametime.
76- extern void timestamp_inc (float frametime );
76+ extern void timestamp_inc (fix frametime );
7777
7878// To do timing, call this with the interval you
7979// want to check. Then, pass this to timestamp_elapsed
You can’t perform that action at this time.
0 commit comments