Linux / Windows hz bug fix and Linux low res modeline generator fix

when merging Linux CRT refresh rate hz was dealt with in floats for Linux but ints for windows.
This commit is contained in:
alphanu1 2018-04-30 16:49:22 +01:00 committed by GitHub
parent 3edd7a6ac8
commit f672c7dc5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 27 deletions

View File

@ -102,11 +102,11 @@ static void* win32_display_server_init(void)
static void win32_display_server_destroy(void *data)
{
dispserv_win32_t *dispserv = (dispserv_win32_t*)data;
if (win32_orig_width > 0 && win32_orig_height > 0)
if (win32_orig_width > 0 && win32_orig_height > 0 )
video_display_server_switch_resolution(win32_orig_width, win32_orig_height,
0, 60);
60, 60);
dispserv_win32_t *dispserv = (dispserv_win32_t*)data;
#ifdef HAS_TASKBAR_EXT
if (g_taskbarList && win32_taskbar_is_created())
@ -200,14 +200,14 @@ static bool win32_set_window_decorations(void *data, bool on)
}
static bool win32_display_server_set_resolution(void *data,
unsigned width, unsigned height, int f_restore, float hz)
unsigned width, unsigned height, int win_hz, float hz)
{
LONG res;
DEVMODE curDevmode;
DEVMODE devmode;
int iModeNum;
int freq = 0;
int freq = win_hz;
DWORD flags = 0;
int depth = 0;
dispserv_win32_t *serv = (dispserv_win32_t*)data;
@ -215,24 +215,10 @@ static bool win32_display_server_set_resolution(void *data,
if (!serv)
return false;
if (win32_orig_width == 0)
win32_orig_width = GetSystemMetrics(SM_CXSCREEN);
if (win32_orig_height == 0)
win32_orig_height = GetSystemMetrics(SM_CYSCREEN);
/* set hz float to an int for windows switching */
if (hz < 53)
hz = 50;
if (hz >= 53 && hz < 57)
hz = 55;
if (hz >= 57)
hz = 60;
video_monitor_set_refresh_rate(hz);
if (f_restore == 0)
freq = hz;
if (orig_width == 0)
orig_width = GetSystemMetrics(SM_CXSCREEN);
if (orig_height == 0)
orig_height = GetSystemMetrics(SM_CYSCREEN);
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &curDevmode);

View File

@ -82,7 +82,7 @@ static bool x11_set_window_decorations(void *data, bool on)
}
static bool x11_set_resolution(void *data,
unsigned width, unsigned height, int f_restore, float hz)
unsigned width, unsigned height, int win_hz, float hz)
{
int i = 0;
int hfp = 0;
@ -113,13 +113,13 @@ static bool x11_set_resolution(void *data,
if (width > 599 && width < 1919)
{
hfp = width+16;
hbp = width*1.10-8;
hbp = width*1.18;
}
if (width > 1919 && width < 2559)
{
hfp = width+32;
hbp = width*1.10;
hbp = width*1.20;
}
if (width > 2559)