From 2d41949f29117cc4a70c5e5a57cd5eabd91551c8 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sat, 19 Aug 2023 18:19:30 +0200 Subject: [PATCH] add custom resolution 1070x602 for Icewind Dale 2 widescreen patch --- inc/dd.h | 2 ++ src/config.c | 5 +++++ src/dd.c | 2 ++ 3 files changed, 9 insertions(+) diff --git a/inc/dd.h b/inc/dd.h index fe0038f..ec198ea 100644 --- a/inc/dd.h +++ b/inc/dd.h @@ -158,6 +158,8 @@ typedef struct CNCDDRAW int resolutions; int max_resolutions; int refresh_rate; + int custom_width; + int custom_height; BOOL limit_bltfast; BOOL armadahack; BOOL tshack; diff --git a/src/config.c b/src/config.c index dc3ae64..a6f30a5 100644 --- a/src/config.c +++ b/src/config.c @@ -46,6 +46,8 @@ void cfg_load() g_ddraw->guard_lines = cfg_get_int("guard_lines", 200); g_ddraw->max_resolutions = cfg_get_int("max_resolutions", 0); g_ddraw->refresh_rate = cfg_get_int("refresh_rate", 0); + g_ddraw->custom_width = cfg_get_int("custom_width", 0); + g_ddraw->custom_height = cfg_get_int("custom_height", 0); g_ddraw->limit_bltfast = cfg_get_bool("limit_bltfast", FALSE); g_ddraw->rgb555 = cfg_get_bool("rgb555", FALSE); g_ddraw->hook_peekmessage = cfg_get_bool("hook_peekmessage", FALSE); @@ -791,8 +793,11 @@ static void cfg_create_ini() "\n" "; Icewind Dale 2\n" "; Note: 'Full Screen' must be enabled in Config.exe\n" + "; Note: Custom width/height is the lowest possible 16:9 res for the WS patch (600/601 height will crash)\n" "[iwd2]\n" "resolutions=2\n" + "custom_width=1070\n" + "custom_height=602\n" "\n" "; Invictus\n" "[Invictus]\n" diff --git a/src/dd.c b/src/dd.c index 64e4c5d..797c48b 100644 --- a/src/dd.c +++ b/src/dd.c @@ -106,6 +106,8 @@ HRESULT dd_EnumDisplayModes( { rlf ? 1280 : 0, rlf ? 540 : 0 }, { rlf ? 1720 : 0, rlf ? 720 : 0 }, { rlf ? 2560 : 0, rlf ? 1080 : 0 }, + /* Inject custom resolution */ + { g_ddraw->custom_width, g_ddraw->custom_height }, { max_w, max_h }, };