From 1ce4081d37a627874e5c183844adc2dce5f7589e Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 15 Apr 2020 15:13:24 +1000 Subject: [PATCH] - change 'refreshfreq' from int to double. A double is already used in CalcSmoothRatio. Further to this, displays that use TV standard frequencies do not use perfect 60Hz frequencies, but frequencies such as 59.94Hz, 23.976Hz (precisely, 24*(1000/1001) = 23.9760239760239760...) etc. Reference: 'https://www.ghacks.net/2010/04/28/59-hertz-refresh-rate/', 'http://www.paradiso-design.net/videostandards_en.html'. # Conflicts: # source/build/include/baselayer.h # source/platform/posix/cocoa/i_main.mm --- source/build/include/baselayer.h | 3 ++- source/platform/posix/cocoa/i_main.mm | 2 ++ source/platform/posix/sdl/sdlglvideo.cpp | 2 +- source/platform/win32/i_input.cpp | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/build/include/baselayer.h b/source/build/include/baselayer.h index c4690d719..12fc727a6 100644 --- a/source/build/include/baselayer.h +++ b/source/build/include/baselayer.h @@ -24,7 +24,8 @@ EXTERN_CVAR(Bool, r_usenewaspect) extern int32_t newaspect_enable; extern int32_t r_fpgrouscan; extern int32_t setaspect_new_use_dimen; -extern int32_t xres, yres, bpp, refreshfreq; +extern int32_t xres, yres, bpp; +extern double refreshfreq; int32_t videoCheckMode(int32_t *x, int32_t *y, int32_t c, int32_t fs, int32_t forced); int32_t videoSetMode(int32_t x, int32_t y, int32_t c, int32_t fs); diff --git a/source/platform/posix/cocoa/i_main.mm b/source/platform/posix/cocoa/i_main.mm index a6d7c15d1..7114d34ce 100644 --- a/source/platform/posix/cocoa/i_main.mm +++ b/source/platform/posix/cocoa/i_main.mm @@ -139,6 +139,8 @@ void I_DetectOS() FArgs* Args; // command line arguments +double refreshfreq; +bool batchrun; namespace { diff --git a/source/platform/posix/sdl/sdlglvideo.cpp b/source/platform/posix/sdl/sdlglvideo.cpp index 48dd0da35..6be854c96 100644 --- a/source/platform/posix/sdl/sdlglvideo.cpp +++ b/source/platform/posix/sdl/sdlglvideo.cpp @@ -111,7 +111,7 @@ CCMD(vid_list_sdl_render_drivers) } } -int refreshfreq; +double refreshfreq; // PRIVATE DATA DEFINITIONS ------------------------------------------------ diff --git a/source/platform/win32/i_input.cpp b/source/platform/win32/i_input.cpp index c3e7d65d8..1711b58dc 100644 --- a/source/platform/win32/i_input.cpp +++ b/source/platform/win32/i_input.cpp @@ -136,7 +136,7 @@ extern bool AppActive; int SessionState = 0; int BlockMouseMove; -int refreshfreq; +double refreshfreq; static bool EventHandlerResultForNativeMouse;