gsdx-gui: Adjust advanced settings and hacks gui.

Allow to open Advanced settings and hacks window even when hw hacks are
off, this should allow OpenGL advanced settings to be configured even
when hw hacks are off in the gui since the options are configurable
wihtout depending on hw hacks checkbox.

Hw hacks will be greyed out when the checkbox button is not enabled.

New behavior will only be present on opengl hw gui. Direct3d11 will remain the same.
This commit is contained in:
lightningterror 2019-03-05 23:05:06 +01:00
parent 3155278ac7
commit 47c255be2c
3 changed files with 66 additions and 37 deletions

View File

@ -142,16 +142,16 @@ BEGIN
COMBOBOX IDC_SPRITEHACK,80,126,116,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
RTEXT "Round Sprite:",IDC_ROUND_SPRITE_TEXT,30,144,46,8
COMBOBOX IDC_ROUND_SPRITE,80,141,116,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
RTEXT "Skipdraw Range:",IDC_STATIC,14,159,62,8
RTEXT "Skipdraw Range:",IDC_SKIPDRAWHACK_TEXT,14,159,62,8
EDITTEXT IDC_SKIPDRAWOFFSETEDIT,80,156,58,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_SKIPDRAWOFFSET,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,0,0,11,14
EDITTEXT IDC_SKIPDRAWHACKEDIT,138,156,58,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_SKIPDRAWHACK,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,0,0,11,14
RTEXT "Texture Offsets",IDC_STATIC,14,175,59,8
RTEXT "X:",IDC_STATIC,81,175,10,8
RTEXT "Texture Offsets",IDC_TCOFFSET_TEXT,14,175,59,8
RTEXT "X:",IDC_TCOFFSETX_TEXT,81,175,10,8
EDITTEXT IDC_TCOFFSETX2,94,172,44,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_TCOFFSETX,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,0,0,11,14
RTEXT "Y:",IDC_STATIC,139,175,10,8
RTEXT "Y:",IDC_TCOFFSETY_TEXT,139,175,10,8
EDITTEXT IDC_TCOFFSETY2,152,172,44,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_TCOFFSETY,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,0,0,11,14
// OpenGL Advanced Settings:

View File

@ -396,7 +396,7 @@ void GSSettingsDlg::UpdateControls()
// Hacks
EnableWindow(GetDlgItem(m_hWnd, IDC_HACKS_ENABLED), hw);
EnableWindow(GetDlgItem(m_hWnd, IDC_HACKSBUTTON), hw && IsDlgButtonChecked(m_hWnd, IDC_HACKS_ENABLED));
EnableWindow(GetDlgItem(m_hWnd, IDC_HACKSBUTTON), hw && (ogl || IsDlgButtonChecked(m_hWnd, IDC_HACKS_ENABLED)));
// OSD Configuration
EnableWindow(GetDlgItem(m_hWnd, IDC_OSDBUTTON), !null);
@ -610,6 +610,7 @@ void GSHacksDlg::OnInit()
unsigned short upscaling_multiplier = static_cast<unsigned short>(SendMessage(hwnd_upscaling, CB_GETITEMDATA, SendMessage(hwnd_upscaling, CB_GETCURSEL, 0, 0), 0));
// It can only be accessed with a HW renderer, so this is sufficient.
bool hwhacks = IsDlgButtonChecked(GetParent(m_hWnd), IDC_HACKS_ENABLED) == BST_CHECKED;
bool ogl = renderer == GSRendererType::OGL_HW;
bool native = upscaling_multiplier == 1;
@ -645,24 +646,48 @@ void GSHacksDlg::OnInit()
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_SETRANGE, 0, MAKELPARAM(10000, 0));
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfigI("UserHacks_TCOffsetY"), 0));
EnableWindow(GetDlgItem(m_hWnd, IDC_PRELOAD_GS), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_TC_DEPTH), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_CPU_FB_CONVERSION), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_FAST_TC_INV), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_AUTO_FLUSH), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_SAFE_FEATURES), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_MEMORY_WRAPPING), hwhacks);
// Skipdraw hack:
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK_TEXT), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWOFFSETEDIT), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWOFFSET), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACKEDIT), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), hwhacks);
// Texture offsets hack:
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSET_TEXT), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETX_TEXT), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETX), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETX2), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETY_TEXT), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETY), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETY2), hwhacks);
// Direct3D-only hacks:
EnableWindow(GetDlgItem(m_hWnd, IDC_ALPHASTENCIL), !ogl);
EnableWindow(GetDlgItem(m_hWnd, IDC_ALPHAHACK), !ogl);
// OpenGL-only hacks:
EnableWindow(GetDlgItem(m_hWnd, IDC_TRI_FILTER), ogl);
EnableWindow(GetDlgItem(m_hWnd, IDC_TRI_FILTER_TEXT), ogl);
EnableWindow(GetDlgItem(m_hWnd, IDC_TRI_FILTER), hwhacks && ogl);
EnableWindow(GetDlgItem(m_hWnd, IDC_TRI_FILTER_TEXT), hwhacks && ogl);
// Upscaling hacks:
EnableWindow(GetDlgItem(m_hWnd, IDC_SPRITEHACK), !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_WILDHACK), !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_ALIGN_SPRITE), !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_ROUND_SPRITE), !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_SPRITEHACK_TEXT), !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_ROUND_SPRITE_TEXT), !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_OFFSETHACK_TEXT), !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_OFFSETHACK), !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_MERGE_PP_SPRITE), !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_SPRITEHACK), hwhacks && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_WILDHACK), hwhacks && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_ALIGN_SPRITE), hwhacks && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_ROUND_SPRITE), hwhacks && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_SPRITEHACK_TEXT), hwhacks && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_ROUND_SPRITE_TEXT), hwhacks && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_OFFSETHACK_TEXT), hwhacks && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_OFFSETHACK), hwhacks && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_MERGE_PP_SPRITE), hwhacks && !native);
// OpenGL Very Advanced Custom Settings:
EnableWindow(GetDlgItem(m_hWnd, IDC_GEOMETRY_SHADER_OVERRIDE), ogl);
@ -878,8 +903,8 @@ void GSOSDDlg::UpdateControls()
sprintf(text, "%d", m_color.b);
SetDlgItemText(m_hWnd, IDC_OSD_COLOR_BLUE_AMOUNT, text);
int monitor_enabled = IsDlgButtonChecked(m_hWnd, IDC_OSD_MONITOR);
int log_enabled = IsDlgButtonChecked(m_hWnd, IDC_OSD_LOG);
bool monitor_enabled = IsDlgButtonChecked(m_hWnd, IDC_OSD_MONITOR) == BST_CHECKED;
bool log_enabled = IsDlgButtonChecked(m_hWnd, IDC_OSD_LOG) == BST_CHECKED;
// Font
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_RED_SLIDER), monitor_enabled || log_enabled);

View File

@ -79,25 +79,29 @@
#define IDC_ALPHASTENCIL 2106
#define IDC_TCOFFSETX 2107
#define IDC_TCOFFSETX2 2108
#define IDC_TCOFFSETY 2109
#define IDC_TCOFFSETY2 2110
#define IDC_ROUND_SPRITE 2111
#define IDC_ROUND_SPRITE_TEXT 2112
#define IDC_ALIGN_SPRITE 2113
#define IDC_TC_DEPTH 2114
#define IDC_PRELOAD_GS 2115
#define IDC_FAST_TC_INV 2116
#define IDC_AUTO_FLUSH 2117
#define IDC_MEMORY_WRAPPING 2118
#define IDC_TRI_FILTER 2119
#define IDC_TRI_FILTER_TEXT 2120
#define IDC_SAFE_FEATURES 2121
#define IDC_MERGE_PP_SPRITE 2122
#define IDC_CPU_FB_CONVERSION 2123
#define IDC_SKIPDRAWHACK 2124
#define IDC_SKIPDRAWHACKEDIT 2125
#define IDC_SKIPDRAWOFFSET 2126
#define IDC_SKIPDRAWOFFSETEDIT 2127
#define IDC_TCOFFSETX_TEXT 2109
#define IDC_TCOFFSETY 2110
#define IDC_TCOFFSETY2 2111
#define IDC_TCOFFSETY_TEXT 2112
#define IDC_TCOFFSET_TEXT 2113
#define IDC_ROUND_SPRITE 2114
#define IDC_ROUND_SPRITE_TEXT 2115
#define IDC_ALIGN_SPRITE 2116
#define IDC_TC_DEPTH 2117
#define IDC_PRELOAD_GS 2118
#define IDC_FAST_TC_INV 2119
#define IDC_AUTO_FLUSH 2120
#define IDC_MEMORY_WRAPPING 2121
#define IDC_TRI_FILTER 2122
#define IDC_TRI_FILTER_TEXT 2123
#define IDC_SAFE_FEATURES 2124
#define IDC_MERGE_PP_SPRITE 2125
#define IDC_CPU_FB_CONVERSION 2126
#define IDC_SKIPDRAWHACK 2127
#define IDC_SKIPDRAWHACK_TEXT 2128
#define IDC_SKIPDRAWHACKEDIT 2129
#define IDC_SKIPDRAWOFFSET 2130
#define IDC_SKIPDRAWOFFSETEDIT 2131
// Shader:
#define IDC_SHADEBOOST 2140
#define IDC_FXAA 2141