mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
rename custom_width/height setting to inject_resolution
This commit is contained in:
parent
f83baafcf6
commit
e435bf65e1
@ -70,8 +70,7 @@ typedef struct CNCDDRAWCONFIG
|
|||||||
BOOL no_dinput_hook;
|
BOOL no_dinput_hook;
|
||||||
int refresh_rate;
|
int refresh_rate;
|
||||||
int anti_aliased_fonts_min_size;
|
int anti_aliased_fonts_min_size;
|
||||||
int custom_width;
|
char inject_resolution[128];
|
||||||
int custom_height;
|
|
||||||
int min_font_size;
|
int min_font_size;
|
||||||
BOOL direct3d_passthrough;
|
BOOL direct3d_passthrough;
|
||||||
BOOL center_cursor_fix;
|
BOOL center_cursor_fix;
|
||||||
|
15
src/config.c
15
src/config.c
@ -84,8 +84,7 @@ void cfg_load()
|
|||||||
GET_BOOL(g_config.no_dinput_hook, "no_dinput_hook", FALSE);
|
GET_BOOL(g_config.no_dinput_hook, "no_dinput_hook", FALSE);
|
||||||
GET_INT(g_config.refresh_rate, "refresh_rate", 0);
|
GET_INT(g_config.refresh_rate, "refresh_rate", 0);
|
||||||
GET_INT(g_config.anti_aliased_fonts_min_size, "anti_aliased_fonts_min_size", 13);
|
GET_INT(g_config.anti_aliased_fonts_min_size, "anti_aliased_fonts_min_size", 13);
|
||||||
GET_INT(g_config.custom_width, "custom_width", 0);
|
GET_STRING("inject_resolution", "", g_config.inject_resolution, sizeof(g_config.inject_resolution));
|
||||||
GET_INT(g_config.custom_height, "custom_height", 0);
|
|
||||||
GET_INT(g_config.min_font_size, "min_font_size", 0);
|
GET_INT(g_config.min_font_size, "min_font_size", 0);
|
||||||
GET_BOOL(g_config.direct3d_passthrough, "direct3d_passthrough", FALSE);
|
GET_BOOL(g_config.direct3d_passthrough, "direct3d_passthrough", FALSE);
|
||||||
GET_BOOL(g_config.center_cursor_fix, "center_cursor_fix", FALSE);
|
GET_BOOL(g_config.center_cursor_fix, "center_cursor_fix", FALSE);
|
||||||
@ -313,8 +312,7 @@ static void cfg_create_ini()
|
|||||||
"rgb555=false\n"
|
"rgb555=false\n"
|
||||||
"no_dinput_hook=false\n"
|
"no_dinput_hook=false\n"
|
||||||
"refresh_rate=0\n"
|
"refresh_rate=0\n"
|
||||||
"custom_width=0\n"
|
";inject_resolution=960x540\n"
|
||||||
"custom_height=0\n"
|
|
||||||
"direct3d_passthrough=false\n"
|
"direct3d_passthrough=false\n"
|
||||||
"center_cursor_fix=false\n"
|
"center_cursor_fix=false\n"
|
||||||
";fake_mode=640x480x32\n"
|
";fake_mode=640x480x32\n"
|
||||||
@ -920,14 +918,12 @@ static void cfg_create_ini()
|
|||||||
"; Jazz Jackrabbit 2 plus\n"
|
"; Jazz Jackrabbit 2 plus\n"
|
||||||
"[Jazz2]\n"
|
"[Jazz2]\n"
|
||||||
"keytogglefullscreen=0x08\n"
|
"keytogglefullscreen=0x08\n"
|
||||||
"custom_width=800\n"
|
"inject_resolution=800x450\n"
|
||||||
"custom_height=450\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
"; Jazz Jackrabbit 2\n"
|
"; Jazz Jackrabbit 2\n"
|
||||||
"[Jazz2_NonPlus]\n"
|
"[Jazz2_NonPlus]\n"
|
||||||
"keytogglefullscreen=0x08\n"
|
"keytogglefullscreen=0x08\n"
|
||||||
"custom_width=800\n"
|
"inject_resolution=800x450\n"
|
||||||
"custom_height=450\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
"; Jungle Storm\n"
|
"; Jungle Storm\n"
|
||||||
"[Jstorm]\n"
|
"[Jstorm]\n"
|
||||||
@ -974,8 +970,7 @@ static void cfg_create_ini()
|
|||||||
"; Note: 1070x602 is the lowest possible 16:9 resolution for the Widescreen patch (600/601 height will crash)\n"
|
"; Note: 1070x602 is the lowest possible 16:9 resolution for the Widescreen patch (600/601 height will crash)\n"
|
||||||
"[iwd2]\n"
|
"[iwd2]\n"
|
||||||
"resolutions=2\n"
|
"resolutions=2\n"
|
||||||
"custom_width=1070\n"
|
"inject_resolution=1070x602\n"
|
||||||
"custom_height=602\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
"; Invictus\n"
|
"; Invictus\n"
|
||||||
"[Invictus]\n"
|
"[Invictus]\n"
|
||||||
|
15
src/dd.c
15
src/dd.c
@ -113,6 +113,11 @@ HRESULT dd_EnumDisplayModes(
|
|||||||
while (--max_w % 8);
|
while (--max_w % 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* ires = &g_config.inject_resolution[0];
|
||||||
|
|
||||||
|
unsigned long custom_width = strtoul(ires, &ires, 0);
|
||||||
|
unsigned long custom_height = strtoul(ires + 1, &ires, 0);
|
||||||
|
|
||||||
BOOL rlf = g_config.resolutions == RESLIST_FULL;
|
BOOL rlf = g_config.resolutions == RESLIST_FULL;
|
||||||
BOOL rlm = g_config.resolutions == RESLIST_MINI;
|
BOOL rlm = g_config.resolutions == RESLIST_MINI;
|
||||||
|
|
||||||
@ -149,7 +154,7 @@ HRESULT dd_EnumDisplayModes(
|
|||||||
{ rlf ? 1720 : 0, rlf ? 720 : 0 },
|
{ rlf ? 1720 : 0, rlf ? 720 : 0 },
|
||||||
{ rlf ? 2560 : 0, rlf ? 1080 : 0 },
|
{ rlf ? 2560 : 0, rlf ? 1080 : 0 },
|
||||||
/* Inject custom resolution */
|
/* Inject custom resolution */
|
||||||
{ g_config.custom_width, g_config.custom_height },
|
{ custom_width, custom_height },
|
||||||
{ max_w, max_h },
|
{ max_w, max_h },
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -228,10 +233,10 @@ HRESULT dd_EnumDisplayModes(
|
|||||||
while (--m.dmPelsWidth % 8);
|
while (--m.dmPelsWidth % 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!custom_res_injected && g_config.custom_width && g_config.custom_height)
|
if (!custom_res_injected && custom_width && custom_height)
|
||||||
{
|
{
|
||||||
m.dmPelsWidth = g_config.custom_width;
|
m.dmPelsWidth = custom_width;
|
||||||
m.dmPelsHeight = g_config.custom_height;
|
m.dmPelsHeight = custom_height;
|
||||||
custom_res_injected = TRUE;
|
custom_res_injected = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +352,7 @@ HRESULT dd_EnumDisplayModes(
|
|||||||
if (!resolutions[i].cx || !resolutions[i].cy)
|
if (!resolutions[i].cx || !resolutions[i].cy)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(resolutions[i].cx == g_config.custom_width && resolutions[i].cy == g_config.custom_height) &&
|
if (!(resolutions[i].cx == custom_width && resolutions[i].cy == custom_height) &&
|
||||||
((max_w && resolutions[i].cx > max_w) || (max_h && resolutions[i].cy > max_h)))
|
((max_w && resolutions[i].cx > max_w) || (max_h && resolutions[i].cy > max_h)))
|
||||||
{
|
{
|
||||||
DEVMODE m;
|
DEVMODE m;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user