- 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
This commit is contained in:
Mitchell Richters 2020-04-15 15:13:24 +10:00 committed by Christoph Oelckers
parent 22a940c922
commit 1ce4081d37
4 changed files with 6 additions and 3 deletions

View file

@ -24,7 +24,8 @@ EXTERN_CVAR(Bool, r_usenewaspect)
extern int32_t newaspect_enable; extern int32_t newaspect_enable;
extern int32_t r_fpgrouscan; extern int32_t r_fpgrouscan;
extern int32_t setaspect_new_use_dimen; 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 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); int32_t videoSetMode(int32_t x, int32_t y, int32_t c, int32_t fs);

View file

@ -139,6 +139,8 @@ void I_DetectOS()
FArgs* Args; // command line arguments FArgs* Args; // command line arguments
double refreshfreq;
bool batchrun;
namespace namespace
{ {

View file

@ -111,7 +111,7 @@ CCMD(vid_list_sdl_render_drivers)
} }
} }
int refreshfreq; double refreshfreq;
// PRIVATE DATA DEFINITIONS ------------------------------------------------ // PRIVATE DATA DEFINITIONS ------------------------------------------------

View file

@ -136,7 +136,7 @@ extern bool AppActive;
int SessionState = 0; int SessionState = 0;
int BlockMouseMove; int BlockMouseMove;
int refreshfreq; double refreshfreq;
static bool EventHandlerResultForNativeMouse; static bool EventHandlerResultForNativeMouse;