From c0dbc562bb186069558bc44dd619d85f41323c4c Mon Sep 17 00:00:00 2001
From: James R <justsomejames2@gmail.com>
Date: Sat, 7 Nov 2020 13:48:37 -0800
Subject: [PATCH] Fix floating point math

---
 src/sdl/i_system.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c
index d4ef86c5a4..d2c819c370 100644
--- a/src/sdl/i_system.c
+++ b/src/sdl/i_system.c
@@ -2067,7 +2067,7 @@ precise_t I_GetPreciseTime(void)
 
 int I_PreciseToMicros(precise_t d)
 {
-	return d / (timer_frequency / 1000000);
+	return (int)(d / (timer_frequency / 1000000.0));
 }
 
 //
@@ -2078,7 +2078,7 @@ void I_StartupTimer(void)
 	timer_frequency = SDL_GetPerformanceFrequency();
 	tic_epoch       = SDL_GetPerformanceCounter();
 
-	tic_frequency   = timer_frequency / NEWTICRATE;
+	tic_frequency   = timer_frequency / (double)NEWTICRATE;
 }
 
 void I_Sleep(void)
-- 
GitLab