cleanup settings names/order
This commit is contained in:
parent
43eadc53b0
commit
f690749ca9
5 changed files with 47 additions and 48 deletions
16
inc/config.h
16
inc/config.h
|
@ -61,26 +61,25 @@ typedef struct CNCDDRAWCONFIG
|
||||||
|
|
||||||
/* Undocumented settings */
|
/* Undocumented settings */
|
||||||
|
|
||||||
BOOL releasealt;
|
BOOL fix_alt_key_stuck;
|
||||||
BOOL fixnotresponding;
|
BOOL fix_not_responding;
|
||||||
int hook;
|
BOOL no_compat_warning;
|
||||||
|
BOOL wine_allow_resize;
|
||||||
int guard_lines;
|
int guard_lines;
|
||||||
int max_resolutions;
|
int max_resolutions;
|
||||||
BOOL lock_surfaces;
|
BOOL lock_surfaces;
|
||||||
BOOL flipclear;
|
BOOL flipclear;
|
||||||
BOOL fixmousehook;
|
|
||||||
BOOL rgb555;
|
BOOL rgb555;
|
||||||
BOOL no_dinput_hook;
|
BOOL no_dinput_hook;
|
||||||
int refresh_rate;
|
|
||||||
char inject_resolution[128];
|
char inject_resolution[128];
|
||||||
BOOL direct3d_passthrough;
|
BOOL direct3d_passthrough;
|
||||||
BOOL center_cursor_fix;
|
BOOL center_cursor_fix;
|
||||||
char fake_mode[128];
|
char fake_mode[128];
|
||||||
BOOL wine_allow_resize;
|
|
||||||
BOOL lock_mouse_top_left;
|
BOOL lock_mouse_top_left;
|
||||||
BOOL no_compat_warning;
|
|
||||||
BOOL remove_menu;
|
|
||||||
char win_version[32];
|
char win_version[32];
|
||||||
|
int hook;
|
||||||
|
BOOL remove_menu;
|
||||||
|
int refresh_rate;
|
||||||
|
|
||||||
/* Hotkeys */
|
/* Hotkeys */
|
||||||
|
|
||||||
|
@ -103,6 +102,7 @@ typedef struct CNCDDRAWCONFIG
|
||||||
BOOL tlc_hack;
|
BOOL tlc_hack;
|
||||||
BOOL homm_hack;
|
BOOL homm_hack;
|
||||||
BOOL carma95_hack;
|
BOOL carma95_hack;
|
||||||
|
BOOL sirtech_hack;
|
||||||
|
|
||||||
} CNCDDRAWCONFIG;
|
} CNCDDRAWCONFIG;
|
||||||
|
|
||||||
|
|
71
src/config.c
71
src/config.c
|
@ -70,30 +70,29 @@ void cfg_load()
|
||||||
GET_INT(g_config.resolutions, "resolutions", RESLIST_NORMAL);
|
GET_INT(g_config.resolutions, "resolutions", RESLIST_NORMAL);
|
||||||
GET_INT(g_config.fixchilds, "fixchilds", FIX_CHILDS_DETECT_PAINT);
|
GET_INT(g_config.fixchilds, "fixchilds", FIX_CHILDS_DETECT_PAINT);
|
||||||
GET_BOOL(g_config.hook_peekmessage, "hook_peekmessage", FALSE);
|
GET_BOOL(g_config.hook_peekmessage, "hook_peekmessage", FALSE);
|
||||||
GET_STRING("win_version", "", g_config.win_version, sizeof(g_config.win_version));
|
|
||||||
|
|
||||||
/* Undocumented settings */
|
/* Undocumented settings */
|
||||||
|
|
||||||
GET_BOOL(g_config.releasealt, "releasealt", FALSE);
|
GET_BOOL(g_config.fix_alt_key_stuck, "fix_alt_key_stuck", FALSE);
|
||||||
GET_BOOL(GameHandlesClose, "game_handles_close", FALSE);
|
GET_BOOL(GameHandlesClose, "game_handles_close", FALSE);
|
||||||
GET_BOOL(g_config.fixnotresponding, "fixnotresponding", FALSE);
|
GET_BOOL(g_config.fix_not_responding, "fix_not_responding", FALSE);
|
||||||
GET_INT(g_config.hook, "hook", 4);
|
GET_BOOL(g_config.no_compat_warning, "no_compat_warning", FALSE);
|
||||||
|
GET_BOOL(g_config.wine_allow_resize, "wine_allow_resize", FALSE);
|
||||||
GET_INT(g_config.guard_lines, "guard_lines", 200);
|
GET_INT(g_config.guard_lines, "guard_lines", 200);
|
||||||
GET_INT(g_config.max_resolutions, "max_resolutions", 0);
|
GET_INT(g_config.max_resolutions, "max_resolutions", 0);
|
||||||
GET_BOOL(g_config.lock_surfaces, "lock_surfaces", FALSE);
|
GET_BOOL(g_config.lock_surfaces, "lock_surfaces", FALSE);
|
||||||
GET_BOOL(g_config.flipclear, "flipclear", FALSE);
|
GET_BOOL(g_config.flipclear, "flipclear", FALSE);
|
||||||
GET_BOOL(g_config.fixmousehook, "fixmousehook", FALSE);
|
|
||||||
GET_BOOL(g_config.rgb555, "rgb555", FALSE);
|
GET_BOOL(g_config.rgb555, "rgb555", FALSE);
|
||||||
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_STRING("inject_resolution", "", g_config.inject_resolution, sizeof(g_config.inject_resolution));
|
GET_STRING("inject_resolution", "", g_config.inject_resolution, sizeof(g_config.inject_resolution));
|
||||||
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);
|
||||||
GET_STRING("fake_mode", "", g_config.fake_mode, sizeof(g_config.fake_mode));
|
GET_STRING("fake_mode", "", g_config.fake_mode, sizeof(g_config.fake_mode));
|
||||||
GET_BOOL(g_config.wine_allow_resize, "wine_allow_resize", FALSE);
|
|
||||||
GET_BOOL(g_config.lock_mouse_top_left, "lock_mouse_top_left", FALSE);
|
GET_BOOL(g_config.lock_mouse_top_left, "lock_mouse_top_left", FALSE);
|
||||||
GET_BOOL(g_config.no_compat_warning, "no_compat_warning", FALSE);
|
GET_STRING("win_version", "", g_config.win_version, sizeof(g_config.win_version));
|
||||||
|
GET_INT(g_config.hook, "hook", 4);
|
||||||
GET_BOOL(g_config.remove_menu, "remove_menu", FALSE);
|
GET_BOOL(g_config.remove_menu, "remove_menu", FALSE);
|
||||||
|
GET_INT(g_config.refresh_rate, "refresh_rate", 0);
|
||||||
|
|
||||||
/* Hotkeys */
|
/* Hotkeys */
|
||||||
|
|
||||||
|
@ -113,6 +112,7 @@ void cfg_load()
|
||||||
GET_BOOL(g_config.tlc_hack, "tlc_hack", FALSE);
|
GET_BOOL(g_config.tlc_hack, "tlc_hack", FALSE);
|
||||||
GET_BOOL(g_config.homm_hack, "homm_hack", FALSE);
|
GET_BOOL(g_config.homm_hack, "homm_hack", FALSE);
|
||||||
GET_BOOL(g_config.carma95_hack, "carma95_hack", FALSE);
|
GET_BOOL(g_config.carma95_hack, "carma95_hack", FALSE);
|
||||||
|
GET_BOOL(g_config.sirtech_hack, "sirtech_hack", FALSE);
|
||||||
|
|
||||||
GameHandlesClose = GameHandlesClose || g_config.infantryhack;
|
GameHandlesClose = GameHandlesClose || g_config.infantryhack;
|
||||||
|
|
||||||
|
@ -303,28 +303,27 @@ static void cfg_create_ini()
|
||||||
"hook_peekmessage=false\n"
|
"hook_peekmessage=false\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Undocumented settings - You may or may not change these (You should rather focus on the settings above)\n"
|
"; Undocumented compatibility settings - These will probably not solve your problem, you should rather focus on the settings above\n"
|
||||||
"releasealt=false\n"
|
"fix_alt_key_stuck=false\n"
|
||||||
"game_handles_close=false\n"
|
"game_handles_close=false\n"
|
||||||
"fixnotresponding=false\n"
|
"fix_not_responding=false\n"
|
||||||
"hook=4\n"
|
"no_compat_warning=false\n"
|
||||||
|
"wine_allow_resize=false\n"
|
||||||
"guard_lines=200\n"
|
"guard_lines=200\n"
|
||||||
"max_resolutions=0\n"
|
"max_resolutions=0\n"
|
||||||
"lock_surfaces=false\n"
|
"lock_surfaces=false\n"
|
||||||
"flipclear=false\n"
|
"flipclear=false\n"
|
||||||
"fixmousehook=false\n"
|
|
||||||
"rgb555=false\n"
|
"rgb555=false\n"
|
||||||
"no_dinput_hook=false\n"
|
"no_dinput_hook=false\n"
|
||||||
"refresh_rate=0\n"
|
|
||||||
";inject_resolution=960x540\n"
|
";inject_resolution=960x540\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"
|
||||||
"wine_allow_resize=false\n"
|
|
||||||
"lock_mouse_top_left=false\n"
|
"lock_mouse_top_left=false\n"
|
||||||
"no_compat_warning=false\n"
|
|
||||||
"remove_menu=false\n"
|
|
||||||
";win_version=95\n"
|
";win_version=95\n"
|
||||||
|
"hook=4\n"
|
||||||
|
"remove_menu=false\n"
|
||||||
|
"refresh_rate=0\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -833,7 +832,7 @@ static void cfg_create_ini()
|
||||||
"; Economic War\n"
|
"; Economic War\n"
|
||||||
"[EcoW]\n"
|
"[EcoW]\n"
|
||||||
"maxgameticks=60\n"
|
"maxgameticks=60\n"
|
||||||
"fixnotresponding=true\n"
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Emperor: Rise of the Middle Kingdom\n"
|
"; Emperor: Rise of the Middle Kingdom\n"
|
||||||
"[Emperor]\n"
|
"[Emperor]\n"
|
||||||
|
@ -896,7 +895,7 @@ static void cfg_create_ini()
|
||||||
"\n"
|
"\n"
|
||||||
"; Glover\n"
|
"; Glover\n"
|
||||||
"[glover]\n"
|
"[glover]\n"
|
||||||
"fixnotresponding=true\n"
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; G-Police\n"
|
"; G-Police\n"
|
||||||
"[GPOLICE]\n"
|
"[GPOLICE]\n"
|
||||||
|
@ -1010,32 +1009,32 @@ static void cfg_create_ini()
|
||||||
"; Jagged Alliance 2\n"
|
"; Jagged Alliance 2\n"
|
||||||
"[ja2]\n"
|
"[ja2]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jagged Alliance 2: Unfinished Business\n"
|
"; Jagged Alliance 2: Unfinished Business\n"
|
||||||
"[JA2UB]\n"
|
"[JA2UB]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jagged Alliance 2: Wildfire\n"
|
"; Jagged Alliance 2: Wildfire\n"
|
||||||
"[WF6]\n"
|
"[WF6]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jagged Alliance 2 - UC mod\n"
|
"; Jagged Alliance 2 - UC mod\n"
|
||||||
"[JA2_UC]\n"
|
"[JA2_UC]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jagged Alliance 2 - Vengeance Reloaded mod\n"
|
"; Jagged Alliance 2 - Vengeance Reloaded mod\n"
|
||||||
"[JA2_Vengeance]\n"
|
"[JA2_Vengeance]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Jedi Knight Dark Forces 2\n"
|
"; Jedi Knight Dark Forces 2\n"
|
||||||
"[JK]\n"
|
"[JK]\n"
|
||||||
|
@ -1180,7 +1179,7 @@ static void cfg_create_ini()
|
||||||
"\n"
|
"\n"
|
||||||
"; Moorhuhn 2\n"
|
"; Moorhuhn 2\n"
|
||||||
"[Moorhuhn2]\n"
|
"[Moorhuhn2]\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; New Robinson\n"
|
"; New Robinson\n"
|
||||||
"[ROBY]\n"
|
"[ROBY]\n"
|
||||||
|
@ -1361,17 +1360,17 @@ static void cfg_create_ini()
|
||||||
"[Game/4]\n"
|
"[Game/4]\n"
|
||||||
"checkfile=.\\Robin Hood.exe\n"
|
"checkfile=.\\Robin Hood.exe\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixnotresponding=true\n"
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Robin Hood - The Legend of Sherwood (Steam)\n"
|
"; Robin Hood - The Legend of Sherwood (Steam)\n"
|
||||||
"[_rh]\n"
|
"[_rh]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixnotresponding=true\n"
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Robin Hood - The Legend of Sherwood\n"
|
"; Robin Hood - The Legend of Sherwood\n"
|
||||||
"[Robin Hood]\n"
|
"[Robin Hood]\n"
|
||||||
"singlecpu=false\n"
|
"singlecpu=false\n"
|
||||||
"fixnotresponding=true\n"
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Scooby-Doo(TM), Case File #1 The Glowing Bug Man - NOT WORKING YET\n"
|
"; Scooby-Doo(TM), Case File #1 The Glowing Bug Man - NOT WORKING YET\n"
|
||||||
"[Case File #1]\n"
|
"[Case File #1]\n"
|
||||||
|
@ -1512,7 +1511,7 @@ static void cfg_create_ini()
|
||||||
"\n"
|
"\n"
|
||||||
"; The Jungle Book Groove Party\n"
|
"; The Jungle Book Groove Party\n"
|
||||||
"[Jungle_vr]\n"
|
"[Jungle_vr]\n"
|
||||||
"fixnotresponding=true\n"
|
"fix_not_responding=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Three Kingdoms: Fate of the Dragon\n"
|
"; Three Kingdoms: Fate of the Dragon\n"
|
||||||
"[sanguo]\n"
|
"[sanguo]\n"
|
||||||
|
@ -1574,8 +1573,8 @@ static void cfg_create_ini()
|
||||||
"\n"
|
"\n"
|
||||||
"; Wizardry 8\n"
|
"; Wizardry 8\n"
|
||||||
"[Wiz8]\n"
|
"[Wiz8]\n"
|
||||||
"fixmousehook=true\n"
|
"sirtech_hack=true\n"
|
||||||
"releasealt=true\n"
|
"fix_alt_key_stuck=true\n"
|
||||||
"\n"
|
"\n"
|
||||||
"; Worms 2\n"
|
"; Worms 2\n"
|
||||||
"[worms2]\n"
|
"[worms2]\n"
|
||||||
|
|
|
@ -72,7 +72,7 @@ HMODULE WINAPI util_enumerate_modules(_In_opt_ HMODULE hModuleLast)
|
||||||
|
|
||||||
void util_pull_messages()
|
void util_pull_messages()
|
||||||
{
|
{
|
||||||
if (g_config.fixnotresponding &&
|
if (g_config.fix_not_responding &&
|
||||||
g_ddraw.hwnd &&
|
g_ddraw.hwnd &&
|
||||||
g_ddraw.last_msg_pull_tick + 1000 < timeGetTime() &&
|
g_ddraw.last_msg_pull_tick + 1000 < timeGetTime() &&
|
||||||
GetCurrentThreadId() == g_ddraw.gui_thread_id &&
|
GetCurrentThreadId() == g_ddraw.gui_thread_id &&
|
||||||
|
|
|
@ -596,7 +596,7 @@ HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, D
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idHook == WH_MOUSE && lpfn && !hmod && !g_mouse_hook && g_config.fixmousehook)
|
if (idHook == WH_MOUSE && lpfn && !hmod && !g_mouse_hook && g_config.sirtech_hack)
|
||||||
{
|
{
|
||||||
g_mouse_proc = lpfn;
|
g_mouse_proc = lpfn;
|
||||||
return g_mouse_hook = real_SetWindowsHookExA(idHook, mouse_hook_proc, hmod, dwThreadId);
|
return g_mouse_hook = real_SetWindowsHookExA(idHook, mouse_hook_proc, hmod, dwThreadId);
|
||||||
|
|
|
@ -675,7 +675,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam && g_config.releasealt)
|
if (wParam && g_config.fix_alt_key_stuck)
|
||||||
{
|
{
|
||||||
INPUT ip;
|
INPUT ip;
|
||||||
memset(&ip, 0, sizeof(ip));
|
memset(&ip, 0, sizeof(ip));
|
||||||
|
@ -707,7 +707,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wParam && g_ddraw.alt_key_down && !g_config.releasealt)
|
if (wParam && g_ddraw.alt_key_down && !g_config.fix_alt_key_stuck)
|
||||||
{
|
{
|
||||||
PostMessageA(g_ddraw.hwnd, WM_SYSKEYUP, VK_MENU, 0);
|
PostMessageA(g_ddraw.hwnd, WM_SYSKEYUP, VK_MENU, 0);
|
||||||
g_ddraw.alt_key_down = FALSE;
|
g_ddraw.alt_key_down = FALSE;
|
||||||
|
|
Loading…
Reference in a new issue