From 214a31b24deba1c2c6dd9936e6cf09220192c9ca Mon Sep 17 00:00:00 2001 From: Will Xyen Date: Fri, 10 Jan 2020 17:36:34 -0500 Subject: [PATCH] iidxhook/d3d9exhook: Use -1 to specify default adapter instead of 0 because the indexing starts at 0 Originally thought the default monitor showed up again later, it does not --- dist/iidx/iidxhook-09.conf | 4 ++-- dist/iidx/iidxhook-10.conf | 4 ++-- dist/iidx/iidxhook-11.conf | 4 ++-- dist/iidx/iidxhook-12.conf | 4 ++-- dist/iidx/iidxhook-13.conf | 4 ++-- dist/iidx/iidxhook-14.conf | 4 ++-- dist/iidx/iidxhook-15.conf | 4 ++-- dist/iidx/iidxhook-16.conf | 4 ++-- dist/iidx/iidxhook-17.conf | 4 ++-- dist/iidx/iidxhook-18.conf | 4 ++-- dist/iidx/iidxhook-19.conf | 4 ++-- dist/iidx/iidxhook-20.conf | 4 ++-- dist/iidx/iidxhook-21.conf | 4 ++-- dist/iidx/iidxhook-22.conf | 4 ++-- dist/iidx/iidxhook-23.conf | 4 ++-- dist/iidx/iidxhook-24.conf | 4 ++-- dist/iidx/iidxhook-25.conf | 4 ++-- dist/iidx/iidxhook-26.conf | 4 ++-- src/main/d3d9exhook/config-gfx.c | 24 +++++++----------------- src/main/d3d9exhook/d3d9ex.c | 4 ++-- src/main/iidxhook-util/config-gfx.c | 24 +++++++----------------- src/main/iidxhook-util/d3d9.c | 4 ++-- src/main/iidxhook-util/d3d9.h | 4 ++-- 23 files changed, 56 insertions(+), 76 deletions(-) diff --git a/dist/iidx/iidxhook-09.conf b/dist/iidx/iidxhook-09.conf index 7631ee7..d673be7 100755 --- a/dist/iidx/iidxhook-09.conf +++ b/dist/iidx/iidxhook-09.conf @@ -43,8 +43,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false diff --git a/dist/iidx/iidxhook-10.conf b/dist/iidx/iidxhook-10.conf index 3badd4e..c24ddbf 100755 --- a/dist/iidx/iidxhook-10.conf +++ b/dist/iidx/iidxhook-10.conf @@ -43,8 +43,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false diff --git a/dist/iidx/iidxhook-11.conf b/dist/iidx/iidxhook-11.conf index d776ca8..89d32e8 100755 --- a/dist/iidx/iidxhook-11.conf +++ b/dist/iidx/iidxhook-11.conf @@ -43,8 +43,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false diff --git a/dist/iidx/iidxhook-12.conf b/dist/iidx/iidxhook-12.conf index 0f0e91c..77d01fa 100755 --- a/dist/iidx/iidxhook-12.conf +++ b/dist/iidx/iidxhook-12.conf @@ -43,8 +43,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Fix broken 3D background on Happy Sky's music select (if appearing completely white) misc.happy_sky_ms_bg_fix=false diff --git a/dist/iidx/iidxhook-13.conf b/dist/iidx/iidxhook-13.conf index 736f78f..ae27d21 100755 --- a/dist/iidx/iidxhook-13.conf +++ b/dist/iidx/iidxhook-13.conf @@ -43,8 +43,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Fix broken 3D background on DistorteD's music select (if appearing completely black) misc.distorted_ms_bg_fix=false diff --git a/dist/iidx/iidxhook-14.conf b/dist/iidx/iidxhook-14.conf index fc0c919..274da2c 100755 --- a/dist/iidx/iidxhook-14.conf +++ b/dist/iidx/iidxhook-14.conf @@ -40,8 +40,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false diff --git a/dist/iidx/iidxhook-15.conf b/dist/iidx/iidxhook-15.conf index 3a03b89..730b2e0 100755 --- a/dist/iidx/iidxhook-15.conf +++ b/dist/iidx/iidxhook-15.conf @@ -40,8 +40,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false diff --git a/dist/iidx/iidxhook-16.conf b/dist/iidx/iidxhook-16.conf index bf3fd93..c24bd14 100755 --- a/dist/iidx/iidxhook-16.conf +++ b/dist/iidx/iidxhook-16.conf @@ -43,8 +43,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false diff --git a/dist/iidx/iidxhook-17.conf b/dist/iidx/iidxhook-17.conf index a723edd..f0aa3c0 100755 --- a/dist/iidx/iidxhook-17.conf +++ b/dist/iidx/iidxhook-17.conf @@ -43,8 +43,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Disable operator clock setting system clock time misc.disable_clock_set=false diff --git a/dist/iidx/iidxhook-18.conf b/dist/iidx/iidxhook-18.conf index 73ef533..babe750 100755 --- a/dist/iidx/iidxhook-18.conf +++ b/dist/iidx/iidxhook-18.conf @@ -34,5 +34,5 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 diff --git a/dist/iidx/iidxhook-19.conf b/dist/iidx/iidxhook-19.conf index 7ce8afc..10145fd 100755 --- a/dist/iidx/iidxhook-19.conf +++ b/dist/iidx/iidxhook-19.conf @@ -31,5 +31,5 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 diff --git a/dist/iidx/iidxhook-20.conf b/dist/iidx/iidxhook-20.conf index 7ce8afc..10145fd 100755 --- a/dist/iidx/iidxhook-20.conf +++ b/dist/iidx/iidxhook-20.conf @@ -31,5 +31,5 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 diff --git a/dist/iidx/iidxhook-21.conf b/dist/iidx/iidxhook-21.conf index 7ce8afc..10145fd 100755 --- a/dist/iidx/iidxhook-21.conf +++ b/dist/iidx/iidxhook-21.conf @@ -31,5 +31,5 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 diff --git a/dist/iidx/iidxhook-22.conf b/dist/iidx/iidxhook-22.conf index 7ce8afc..10145fd 100755 --- a/dist/iidx/iidxhook-22.conf +++ b/dist/iidx/iidxhook-22.conf @@ -31,5 +31,5 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 diff --git a/dist/iidx/iidxhook-23.conf b/dist/iidx/iidxhook-23.conf index 7ce8afc..10145fd 100755 --- a/dist/iidx/iidxhook-23.conf +++ b/dist/iidx/iidxhook-23.conf @@ -31,5 +31,5 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 diff --git a/dist/iidx/iidxhook-24.conf b/dist/iidx/iidxhook-24.conf index 7ce8afc..10145fd 100755 --- a/dist/iidx/iidxhook-24.conf +++ b/dist/iidx/iidxhook-24.conf @@ -31,5 +31,5 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 diff --git a/dist/iidx/iidxhook-25.conf b/dist/iidx/iidxhook-25.conf index ac88dee..b7243e0 100644 --- a/dist/iidx/iidxhook-25.conf +++ b/dist/iidx/iidxhook-25.conf @@ -31,8 +31,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Disables the camera emulation cam.disable_emu=false diff --git a/dist/iidx/iidxhook-26.conf b/dist/iidx/iidxhook-26.conf index ac88dee..b7243e0 100644 --- a/dist/iidx/iidxhook-26.conf +++ b/dist/iidx/iidxhook-26.conf @@ -31,8 +31,8 @@ gfx.scale_back_buffer_filter=none # Forced refresh rate, -1 to not force any (try 59 or 60 if monitor check fails to lock on high refresh rate monitors) gfx.forced_refresh_rate=-1 -# D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, 1, 2 etc. to use specified adapter -gfx.device_adapter=0 +# D3D9 device adapter (monitor), -1 to use default, 0, 1, 2 etc. to use specified adapter +gfx.device_adapter=-1 # Disables the camera emulation cam.disable_emu=false diff --git a/src/main/d3d9exhook/config-gfx.c b/src/main/d3d9exhook/config-gfx.c index 940c107..d1cf7c9 100644 --- a/src/main/d3d9exhook/config-gfx.c +++ b/src/main/d3d9exhook/config-gfx.c @@ -12,7 +12,7 @@ #define D3D9EXHOOK_CONFIG_GFX_WINDOWED_KEY "gfx.windowed" #define D3D9EXHOOK_CONFIG_GFX_WINDOW_WIDTH_KEY "gfx.window_width" #define D3D9EXHOOK_CONFIG_GFX_WINDOW_HEIGHT_KEY "gfx.window_height" -#define D3D9EXHOOK_CONFIG_GFX_FORCED_RR_KEY "gfx.forced_refresh_rate" +#define D3D9EXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY "gfx.forced_refresh_rate" #define D3D9EXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY "gfx.device_adapter" #define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FRAMED_VALUE false @@ -20,7 +20,7 @@ #define D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_WIDTH_VALUE -1 #define D3D9EXHOOK_CONFIG_GFX_DEFAULT_WINDOW_HEIGHT_VALUE -1 #define D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE -1 -#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE D3DADAPTER_DEFAULT +#define D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE -1 void d3d9exhook_config_gfx_init(struct cconfig *config) { @@ -50,7 +50,7 @@ void d3d9exhook_config_gfx_init(struct cconfig *config) cconfig_util_set_int( config, - D3D9EXHOOK_CONFIG_GFX_FORCED_RR_KEY, + D3D9EXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY, D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE, "Forced refresh rate, -1 to not force any (try 59 or 60 if monitor " "check fails to lock on high refresh rate monitors)"); @@ -59,8 +59,8 @@ void d3d9exhook_config_gfx_init(struct cconfig *config) config, D3D9EXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY, D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE, - "D3D9ex device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use " - "default, 1, 2 etc. to use specified adapter"); + "D3D9ex device adapter (monitor), -1 to use default," + "0, 1, 2 etc. to use specified adapter"); } void d3d9exhook_config_gfx_get( @@ -116,13 +116,13 @@ void d3d9exhook_config_gfx_get( if (!cconfig_util_get_int( config, - D3D9EXHOOK_CONFIG_GFX_FORCED_RR_KEY, + D3D9EXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY, &config_gfx->forced_refresh_rate, D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE)) { log_warning( "Invalid value for key '%s' specified, fallback " "to default '%d'", - D3D9EXHOOK_CONFIG_GFX_FORCED_RR_KEY, + D3D9EXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY, D3D9EXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE); } @@ -137,14 +137,4 @@ void d3d9exhook_config_gfx_get( D3D9EXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY, D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE); } - - if (config_gfx->device_adapter < 0) { - log_warning( - "Invalid value for key '%s' specified, fallback " - "to default '%d'", - D3D9EXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY, - D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE); - config_gfx->device_adapter = - D3D9EXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE; - } } diff --git a/src/main/d3d9exhook/d3d9ex.c b/src/main/d3d9exhook/d3d9ex.c index 058afe1..5de9503 100644 --- a/src/main/d3d9exhook/d3d9ex.c +++ b/src/main/d3d9exhook/d3d9ex.c @@ -86,7 +86,7 @@ static int32_t d3d9ex_force_refresh_rate = -1; static int32_t d3d9ex_window_width = -1; static int32_t d3d9ex_window_height = -1; static bool d3d9ex_window_framed; -static int32_t d3d9ex_device_adapter = D3DADAPTER_DEFAULT; +static int32_t d3d9ex_device_adapter = -1; /* ------------------------------------------------------------------------- */ @@ -212,7 +212,7 @@ static HRESULT STDCALL my_CreateDeviceEx( } } - if (d3d9ex_device_adapter != D3DADAPTER_DEFAULT) { + if (d3d9ex_device_adapter >= 0) { log_info("Forcing adapter %d -> %d", adapter, d3d9ex_device_adapter); adapter = d3d9ex_device_adapter; } diff --git a/src/main/iidxhook-util/config-gfx.c b/src/main/iidxhook-util/config-gfx.c index 6d7560d..cf77cec 100644 --- a/src/main/iidxhook-util/config-gfx.c +++ b/src/main/iidxhook-util/config-gfx.c @@ -20,7 +20,7 @@ "gfx.scale_back_buffer_height" #define IIDXHOOK_CONFIG_GFX_SCALE_BACK_BUFFER_FILTER_KEY \ "gfx.scale_back_buffer_filter" -#define IIDXHOOK_CONFIG_GFX_FORCED_RR_KEY "gfx.forced_refresh_rate" +#define IIDXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY "gfx.forced_refresh_rate" #define IIDXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY "gfx.device_adapter" #define IIDXHOOK_CONFIG_GFX_DEFAULT_BGVIDEO_UV_FIX_VALUE false @@ -35,7 +35,7 @@ #define IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_HEIGHT_VALUE 0 #define IIDXHOOK_CONFIG_GFX_DEFAULT_SCALE_BACK_BUFFER_FILTER_VALUE "none" #define IIDXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE -1 -#define IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE D3DADAPTER_DEFAULT +#define IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE -1 void iidxhook_config_gfx_init(struct cconfig *config) { @@ -148,7 +148,7 @@ void iidxhook_config_gfx_init(struct cconfig *config) cconfig_util_set_int( config, - IIDXHOOK_CONFIG_GFX_FORCED_RR_KEY, + IIDXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY, IIDXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE, "Forced refresh rate, -1 to not force any (try 59 or 60 if monitor " "check fails to lock on high refresh rate monitors)"); @@ -157,8 +157,8 @@ void iidxhook_config_gfx_init(struct cconfig *config) config, IIDXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY, IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE, - "D3D9 device adapter (monitor), 0 (D3DADAPTER_DEFAULT) to use default, " - "1, 2 etc. to use specified adapter"); + "D3D9 device adapter (monitor), -1 to use default, " + "0, 1, 2 etc. to use specified adapter"); } void iidxhook_config_gfx_get( @@ -346,13 +346,13 @@ void iidxhook_config_gfx_get( if (!cconfig_util_get_int( config, - IIDXHOOK_CONFIG_GFX_FORCED_RR_KEY, + IIDXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY, &config_gfx->forced_refresh_rate, IIDXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE)) { log_warning( "Invalid value for key '%s' specified, fallback " "to default '%d'", - IIDXHOOK_CONFIG_GFX_FORCED_RR_KEY, + IIDXHOOK_CONFIG_GFX_FORCED_REFRESHRATE_KEY, IIDXHOOK_CONFIG_GFX_DEFAULT_FORCED_RR_VALUE); } @@ -367,14 +367,4 @@ void iidxhook_config_gfx_get( IIDXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY, IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE); } - - if (config_gfx->device_adapter < 0) { - log_warning( - "Invalid value for key '%s' specified, fallback " - "to default '%d'", - IIDXHOOK_CONFIG_GFX_DEVICE_ADAPTER_KEY, - IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE); - config_gfx->device_adapter = - IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE; - } } diff --git a/src/main/iidxhook-util/d3d9.c b/src/main/iidxhook-util/d3d9.c index 969cd08..b81f65c 100644 --- a/src/main/iidxhook-util/d3d9.c +++ b/src/main/iidxhook-util/d3d9.c @@ -278,7 +278,7 @@ static void iidxhook_util_d3d9_fix_create_device_apply_window_mode( } } - if (iidxhook_util_d3d9_config.device_adapter != D3DADAPTER_DEFAULT) { + if (iidxhook_util_d3d9_config.device_adapter >= 0) { log_info( "Forcing adapter %d -> %d", irp->args.ctx_create_device.adapter, @@ -1007,7 +1007,7 @@ void iidxhook_util_d3d9_init_config(struct iidxhook_util_d3d9_config *config) config->scale_back_buffer_filter = IIDXHOOK_UTIL_D3D9_BACK_BUFFER_SCALE_FILTER_NONE; config->forced_refresh_rate = -1; - config->device_adapter = D3DADAPTER_DEFAULT; + config->device_adapter = -1; } void iidxhook_util_d3d9_configure( diff --git a/src/main/iidxhook-util/d3d9.h b/src/main/iidxhook-util/d3d9.h index 6d9e6de..9f2a0dd 100644 --- a/src/main/iidxhook-util/d3d9.h +++ b/src/main/iidxhook-util/d3d9.h @@ -169,8 +169,8 @@ struct iidxhook_util_d3d9_config { /** * override device adapter (monitor) - * 0 (D3DADAPTER_DEFAULT) to use default (whatever the game sends), 1, 2 - * etc. to use specified adapter + * -1 to use default (whatever the game sends) + * 0, 1, 2 etc. to use specified adapter */ int32_t device_adapter; };