DXGL r848 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r847‎ | r848 | r849 >
Date:23:29, 28 August 2018
Author:admin
Status:new
Tags:
Comment:
Add "Restore defaults" button to DXGL Config.
Modified paths:
  • /cfgmgr/cfgmgr.h (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)
  • /dxglcfg/dxglcfg.rc (modified) (history)
  • /dxglcfg/resource.h (modified) (history)

Diff [purge]

Index: cfgmgr/cfgmgr.h
@@ -147,6 +147,7 @@
148148 void SaveWindowSettings(const DXGLCFG *cfg);
149149 BOOL CheckProfileExists(LPTSTR path);
150150 LPTSTR MakeNewConfig(LPTSTR path);
 151+void GetDefaultConfig(DXGLCFG *cfg);
151152
152153 #ifdef __cplusplus
153154 }
Index: dxglcfg/dxglcfg.cpp
@@ -2774,6 +2774,232 @@
27752775 return 0;
27762776 }
27772777
 2778+void RefreshControls(HWND hWnd)
 2779+{
 2780+ if (current_app)
 2781+ {
 2782+ EnableWindow(GetDlgItem(hTabs[3], IDC_PATHLABEL), TRUE);
 2783+ EnableWindow(GetDlgItem(hTabs[3], IDC_PROFILEPATH), TRUE);
 2784+ EnableWindow(GetDlgItem(hTabs[3], IDC_WRITEINI), TRUE);
 2785+ SetDlgItemText(hTabs[3], IDC_PROFILEPATH, apps[current_app].path);
 2786+ if (apps[current_app].builtin) EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), FALSE);
 2787+ else EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), TRUE);
 2788+ }
 2789+ else
 2790+ {
 2791+ EnableWindow(GetDlgItem(hTabs[3], IDC_PATHLABEL), FALSE);
 2792+ EnableWindow(GetDlgItem(hTabs[3], IDC_PROFILEPATH), FALSE);
 2793+ EnableWindow(GetDlgItem(hTabs[3], IDC_WRITEINI), FALSE);
 2794+ SetDlgItemText(hTabs[3], IDC_PROFILEPATH, _T(""));
 2795+ EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), FALSE);
 2796+ }
 2797+ // Set 3-state status
 2798+ if (current_app && !tristate)
 2799+ {
 2800+ tristate = TRUE;
 2801+ // Display tab
 2802+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2803+ SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2804+ SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2805+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2806+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2807+ SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2808+ SendDlgItemMessage(hTabs[0], IDC_DPISCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2809+ SendDlgItemMessage(hTabs[0], IDC_VSYNC, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2810+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2811+ SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETSTYLE, BS_AUTO3STATE, (LPARAM)TRUE);
 2812+ SendDlgItemMessage(hTabs[0], IDC_SINGLEBUFFER, BM_SETSTYLE, BS_AUTO3STATE, (LPARAM)TRUE);
 2813+ // Effects tab
 2814+ SendDlgItemMessage(hTabs[1], IDC_POSTSCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2815+ SendDlgItemMessage(hTabs[1], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2816+ SendDlgItemMessage(hTabs[1], IDC_PRIMARYSCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2817+ SendDlgItemMessage(hTabs[1], IDC_BLTFILTER, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2818+ // 3D tab
 2819+ SendDlgItemMessage(hTabs[2], IDC_TEXFILTER, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2820+ SendDlgItemMessage(hTabs[2], IDC_ANISO, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2821+ SendDlgItemMessage(hTabs[2], IDC_MSAA, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2822+ SendDlgItemMessage(hTabs[2], IDC_ASPECT3D, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2823+ SendDlgItemMessage(hTabs[2], IDC_LOWCOLORRENDER, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2824+ SendDlgItemMessage(hTabs[2], IDC_DITHERING, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2825+ // Advanced tab
 2826+ SendDlgItemMessage(hTabs[3], IDC_TEXTUREFORMAT, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2827+ SendDlgItemMessage(hTabs[3], IDC_TEXUPLOAD, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2828+ SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2829+ SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWPOS, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
 2830+ SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWSIZE, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
 2831+ SendDlgItemMessage(hTabs[3], IDC_WINDOWMAXIMIZED, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
 2832+ SendDlgItemMessage(hTabs[3], IDC_NOAUTOSIZE, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
 2833+ SendDlgItemMessage(hTabs[3], IDC_CAPTUREMOUSE, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
 2834+ // Debug tab
 2835+ SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)strdefault);
 2836+ }
 2837+ else if (!current_app && tristate)
 2838+ {
 2839+ tristate = FALSE;
 2840+ // Display tab
 2841+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_DELETESTRING,
 2842+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2843+ SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_DELETESTRING,
 2844+ SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2845+ SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_DELETESTRING,
 2846+ SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2847+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_DELETESTRING,
 2848+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2849+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_DELETESTRING,
 2850+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2851+ SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_DELETESTRING,
 2852+ SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2853+ SendDlgItemMessage(hTabs[0], IDC_DPISCALE, CB_DELETESTRING,
 2854+ SendDlgItemMessage(hTabs[0], IDC_DPISCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2855+ SendDlgItemMessage(hTabs[0], IDC_VSYNC, CB_DELETESTRING,
 2856+ SendDlgItemMessage(hTabs[0], IDC_VSYNC, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2857+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_DELETESTRING,
 2858+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2859+ SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETSTYLE, BS_AUTOCHECKBOX, (LPARAM)TRUE);
 2860+ SendDlgItemMessage(hTabs[0], IDC_SINGLEBUFFER, BM_SETSTYLE, BS_AUTOCHECKBOX, (LPARAM)TRUE);
 2861+ // Effects tab
 2862+ SendDlgItemMessage(hTabs[1], IDC_POSTSCALE, CB_DELETESTRING,
 2863+ SendDlgItemMessage(hTabs[1], IDC_POSTSCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2864+ SendDlgItemMessage(hTabs[1], IDC_POSTSCALESIZE, CB_DELETESTRING,
 2865+ SendDlgItemMessage(hTabs[1], IDC_POSTSCALESIZE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2866+ SendDlgItemMessage(hTabs[1], IDC_PRIMARYSCALE, CB_DELETESTRING,
 2867+ SendDlgItemMessage(hTabs[1], IDC_PRIMARYSCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2868+ SendDlgItemMessage(hTabs[1], IDC_BLTFILTER, CB_DELETESTRING,
 2869+ SendDlgItemMessage(hTabs[1], IDC_BLTFILTER, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2870+ // 3D tab
 2871+ SendDlgItemMessage(hTabs[2], IDC_TEXFILTER, CB_DELETESTRING,
 2872+ SendDlgItemMessage(hTabs[2], IDC_TEXFILTER, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2873+ SendDlgItemMessage(hTabs[2], IDC_ANISO, CB_DELETESTRING,
 2874+ SendDlgItemMessage(hTabs[2], IDC_ANISO, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2875+ SendDlgItemMessage(hTabs[2], IDC_MSAA, CB_DELETESTRING,
 2876+ SendDlgItemMessage(hTabs[2], IDC_MSAA, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2877+ SendDlgItemMessage(hTabs[2], IDC_ASPECT3D, CB_DELETESTRING,
 2878+ SendDlgItemMessage(hTabs[2], IDC_ASPECT3D, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2879+ SendDlgItemMessage(hTabs[2], IDC_LOWCOLORRENDER, CB_DELETESTRING,
 2880+ SendDlgItemMessage(hTabs[2], IDC_LOWCOLORRENDER, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2881+ SendDlgItemMessage(hTabs[2], IDC_DITHERING, CB_DELETESTRING,
 2882+ SendDlgItemMessage(hTabs[2], IDC_DITHERING, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2883+ // Advanced tab
 2884+ SendDlgItemMessage(hTabs[3], IDC_TEXTUREFORMAT, CB_DELETESTRING,
 2885+ SendDlgItemMessage(hTabs[3], IDC_TEXTUREFORMAT, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2886+ SendDlgItemMessage(hTabs[3], IDC_TEXUPLOAD, CB_DELETESTRING,
 2887+ SendDlgItemMessage(hTabs[3], IDC_TEXUPLOAD, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2888+ SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_DELETESTRING,
 2889+ SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2890+ SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWPOS, BM_SETSTYLE, BS_AUTOCHECKBOX, TRUE);
 2891+ SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWSIZE, BM_SETSTYLE, BS_AUTOCHECKBOX, TRUE);
 2892+ SendDlgItemMessage(hTabs[3], IDC_WINDOWMAXIMIZED, BM_SETSTYLE, BS_AUTOCHECKBOX, TRUE);
 2893+ SendDlgItemMessage(hTabs[3], IDC_NOAUTOSIZE, BM_SETSTYLE, BS_AUTOCHECKBOX, TRUE);
 2894+ // Debug tab
 2895+ SendDlgItemMessage(hTabs[3], IDC_GLVERSION, CB_DELETESTRING,
 2896+ SendDlgItemMessage(hTabs[3], IDC_GLVERSION, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 2897+ }
 2898+ // Read settings into controls
 2899+ // Display tab
 2900+ SetCombo(hTabs[0], IDC_VIDMODE, cfg->scaler, cfgmask->scaler, tristate);
 2901+ SetCombo(hTabs[0], IDC_COLORDEPTH, 0, 0, tristate);
 2902+ SetCombo(hTabs[0], IDC_SCALE, cfg->scalingfilter, cfgmask->scalingfilter, tristate);
 2903+ SetCombo(hTabs[0], IDC_EXTRAMODES, 0, 0, tristate);
 2904+ SetAspectCombo(hTabs[0], IDC_ASPECT, cfg->aspect, (DWORD)cfgmask->aspect, tristate);
 2905+ SetCombo(hTabs[0], IDC_SORTMODES, cfg->SortModes, cfgmask->SortModes, tristate);
 2906+ SetCombo(hTabs[0], IDC_DPISCALE, cfg->DPIScale, cfgmask->DPIScale, tristate);
 2907+ SetCombo(hTabs[0], IDC_VSYNC, cfg->vsync, cfgmask->vsync, tristate);
 2908+ SetCombo(hTabs[0], IDC_FULLMODE, cfg->fullmode, cfgmask->fullmode, tristate);
 2909+ SetCheck(hTabs[0], IDC_COLOR, cfg->colormode, cfgmask->colormode, tristate);
 2910+ SetCheck(hTabs[0], IDC_SINGLEBUFFER, cfg->SingleBufferDevice, cfgmask->SingleBufferDevice, tristate);
 2911+ if (cfg->scaler == 8)
 2912+ {
 2913+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABEL), TRUE);
 2914+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELX), TRUE);
 2915+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELY), TRUE);
 2916+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEX), TRUE);
 2917+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEY), TRUE);
 2918+ }
 2919+ else
 2920+ {
 2921+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABEL), FALSE);
 2922+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELX), FALSE);
 2923+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELY), FALSE);
 2924+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEX), FALSE);
 2925+ EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEY), FALSE);
 2926+ }
 2927+ if ((cfg->scaler == 9) || (cfg->scaler == 10))
 2928+ {
 2929+ EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODELABEL), TRUE);
 2930+ EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODE), TRUE);
 2931+ EnableWindow(GetDlgItem(hTabs[0], IDC_SETMODE), TRUE);
 2932+ }
 2933+ else
 2934+ {
 2935+ EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODELABEL), FALSE);
 2936+ EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODE), FALSE);
 2937+ EnableWindow(GetDlgItem(hTabs[0], IDC_SETMODE), FALSE);
 2938+ }
 2939+ SetFloat3place(hTabs[0], IDC_FIXEDSCALEX, cfg->DisplayMultiplierX, cfgmask->DisplayMultiplierX);
 2940+ SetFloat3place(hTabs[0], IDC_FIXEDSCALEY, cfg->DisplayMultiplierY, cfgmask->DisplayMultiplierY);
 2941+ SetResolution(hTabs[0], IDC_CUSTOMMODE, cfg, cfgmask);
 2942+ // Effects tab
 2943+ SetCombo(hTabs[1], IDC_POSTSCALE, cfg->postfilter, cfgmask->postfilter, tristate);
 2944+ SetPostScaleCombo(hTabs[1], IDC_POSTSCALESIZE, cfg->postsizex, cfg->postsizey,
 2945+ (DWORD)cfgmask->postsizex, (DWORD)cfgmask->postsizey, tristate);
 2946+ SetCombo(hTabs[1], IDC_PRIMARYSCALE, cfg->primaryscale, cfgmask->primaryscale, tristate);
 2947+ if (cfg->primaryscale == 12)
 2948+ {
 2949+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABEL), TRUE);
 2950+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABELX), TRUE);
 2951+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALEX), TRUE);
 2952+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABELY), TRUE);
 2953+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALEY), TRUE);
 2954+ }
 2955+ else
 2956+ {
 2957+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABEL), FALSE);
 2958+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABELX), FALSE);
 2959+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALEX), FALSE);
 2960+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABELY), FALSE);
 2961+ EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALEY), FALSE);
 2962+ }
 2963+ SetFloat3place(hTabs[1], IDC_CUSTOMSCALEX, cfg->primaryscalex, cfgmask->primaryscalex);
 2964+ SetFloat3place(hTabs[1], IDC_CUSTOMSCALEY, cfg->primaryscaley, cfgmask->primaryscaley);
 2965+ SetText(hTabs[1], IDC_SHADER, cfg->shaderfile, cfgmask->shaderfile, tristate);
 2966+ SetCombo(hTabs[1], IDC_BLTFILTER, cfg->BltScale, cfgmask->BltScale, tristate);
 2967+ // Removed for DXGL 0.5.13 release
 2968+ /* SetInteger(hTabs[1], IDC_BLTTHRESHOLD, cfg->BltThreshold, cfgmask->BltThreshold);
 2969+ if (cfgmask->BltThreshold)
 2970+ {
 2971+ SendDlgItemMessage(hTabs[1], IDC_BLTTHRESHOLDSLIDER, TBM_SETPOS, TRUE, cfg->BltThreshold);
 2972+ }
 2973+ else SendDlgItemMessage(hTabs[1], IDC_BLTTHRESHOLDSLIDER, TBM_SETPOS, TRUE, 127);*/
 2974+ // 3D tab
 2975+ SetCombo(hTabs[2], IDC_TEXFILTER, cfg->texfilter, cfgmask->texfilter, tristate);
 2976+ SetCombo(hTabs[2], IDC_ANISO, cfg->anisotropic, cfgmask->anisotropic, tristate);
 2977+ SetCombo(hTabs[2], IDC_MSAA, cfg->msaa, cfgmask->msaa, tristate);
 2978+ SetCombo(hTabs[2], IDC_ASPECT3D, cfg->aspect3d, cfgmask->aspect3d, tristate);
 2979+ SetCombo(hTabs[2], IDC_LOWCOLORRENDER, cfg->LowColorRendering, cfgmask->LowColorRendering, tristate);
 2980+ SetCombo(hTabs[2], IDC_DITHERING, cfg->EnableDithering, cfgmask->EnableDithering, tristate);
 2981+ // Advanced tab
 2982+ SetCombo(hTabs[3], IDC_TEXTUREFORMAT, cfg->TextureFormat, cfgmask->TextureFormat, tristate);
 2983+ SetCombo(hTabs[3], IDC_TEXUPLOAD, cfg->TexUpload, cfgmask->TexUpload, tristate);
 2984+ SetCombo(hTabs[3], IDC_WINDOWPOS, cfg->WindowPosition, cfgmask->WindowPosition, tristate);
 2985+ SetCheck(hTabs[3], IDC_REMEMBERWINDOWPOS, cfg->RememberWindowPosition, cfgmask->RememberWindowPosition, tristate);
 2986+ SetCheck(hTabs[3], IDC_REMEMBERWINDOWSIZE, cfg->RememberWindowSize, cfgmask->RememberWindowSize, tristate);
 2987+ SetInteger(hTabs[3], IDC_WINDOWX, cfg->WindowX, cfgmask->WindowX);
 2988+ SetInteger(hTabs[3], IDC_WINDOWY, cfg->WindowY, cfgmask->WindowY);
 2989+ SetInteger(hTabs[3], IDC_WINDOWWIDTH, cfg->WindowWidth, cfgmask->WindowWidth);
 2990+ SetInteger(hTabs[3], IDC_WINDOWHEIGHT, cfg->WindowHeight, cfgmask->WindowHeight);
 2991+ SetCheck(hTabs[3], IDC_WINDOWMAXIMIZED, cfg->WindowMaximized, cfgmask->WindowMaximized, tristate);
 2992+ SetCheck(hTabs[3], IDC_NOAUTOSIZE, cfg->NoResizeWindow, cfgmask->NoResizeWindow, tristate);
 2993+ SetCheck(hTabs[3], IDC_CAPTUREMOUSE, cfg->CaptureMouse, cfgmask->CaptureMouse, tristate);
 2994+ // Debug tab
 2995+ RedrawWindow(GetDlgItem(hTabs[4], IDC_DEBUGLIST), NULL, NULL, RDW_INVALIDATE);
 2996+ SetGLCombo(hTabs[4], IDC_GLVERSION, &cfg->DebugMaxGLVersionMajor, &cfg->DebugMaxGLVersionMinor,
 2997+ &cfgmask->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMinor, tristate, hWnd);
 2998+ // Hacks tab
 2999+ UpdateHacksControl(GetDlgItem(hTabs[5], IDC_HACKSLIST), IDC_HACKSDROPDOWN, hackstabitem);
 3000+ SetRGBHex(GetDlgItem(hTabs[5], IDC_HACKSLIST), IDC_HACKSEDIT, cfg->HackAutoExpandViewportValue, cfgmask->HackAutoExpandViewportValue);
 3001+ RedrawWindow(GetDlgItem(hTabs[5], IDC_HACKSLIST), NULL, NULL, RDW_INVALIDATE);
 3002+}
 3003+
27783004 LRESULT CALLBACK DXGLCfgCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
27793005 {
27803006 PIXELFORMATDESCRIPTOR pfd =
@@ -3756,228 +3982,7 @@
37573983 cfg = &apps[current_app].cfg;
37583984 cfgmask = &apps[current_app].mask;
37593985 dirty = &apps[current_app].dirty;
3760 - if (current_app)
3761 - {
3762 - EnableWindow(GetDlgItem(hTabs[3], IDC_PATHLABEL), TRUE);
3763 - EnableWindow(GetDlgItem(hTabs[3], IDC_PROFILEPATH), TRUE);
3764 - EnableWindow(GetDlgItem(hTabs[3], IDC_WRITEINI), TRUE);
3765 - SetDlgItemText(hTabs[3], IDC_PROFILEPATH, apps[current_app].path);
3766 - if (apps[current_app].builtin) EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), FALSE);
3767 - else EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), TRUE);
3768 - }
3769 - else
3770 - {
3771 - EnableWindow(GetDlgItem(hTabs[3], IDC_PATHLABEL), FALSE);
3772 - EnableWindow(GetDlgItem(hTabs[3], IDC_PROFILEPATH), FALSE);
3773 - EnableWindow(GetDlgItem(hTabs[3], IDC_WRITEINI), FALSE);
3774 - SetDlgItemText(hTabs[3], IDC_PROFILEPATH, _T(""));
3775 - EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), FALSE);
3776 - }
3777 - // Set 3-state status
3778 - if(current_app && !tristate)
3779 - {
3780 - tristate = TRUE;
3781 - // Display tab
3782 - SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 0, (LPARAM)strdefault);
3783 - SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_ADDSTRING, 0, (LPARAM)strdefault);
3784 - SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
3785 - SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 0, (LPARAM)strdefault);
3786 - SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)strdefault);
3787 - SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_ADDSTRING, 0, (LPARAM)strdefault);
3788 - SendDlgItemMessage(hTabs[0], IDC_DPISCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
3789 - SendDlgItemMessage(hTabs[0], IDC_VSYNC, CB_ADDSTRING, 0, (LPARAM)strdefault);
3790 - SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 0, (LPARAM)strdefault);
3791 - SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETSTYLE, BS_AUTO3STATE, (LPARAM)TRUE);
3792 - SendDlgItemMessage(hTabs[0], IDC_SINGLEBUFFER, BM_SETSTYLE, BS_AUTO3STATE, (LPARAM)TRUE);
3793 - // Effects tab
3794 - SendDlgItemMessage(hTabs[1], IDC_POSTSCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
3795 - SendDlgItemMessage(hTabs[1], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)strdefault);
3796 - SendDlgItemMessage(hTabs[1], IDC_PRIMARYSCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
3797 - SendDlgItemMessage(hTabs[1], IDC_BLTFILTER, CB_ADDSTRING, 0, (LPARAM)strdefault);
3798 - // 3D tab
3799 - SendDlgItemMessage(hTabs[2], IDC_TEXFILTER, CB_ADDSTRING, 0, (LPARAM)strdefault);
3800 - SendDlgItemMessage(hTabs[2], IDC_ANISO, CB_ADDSTRING, 0, (LPARAM)strdefault);
3801 - SendDlgItemMessage(hTabs[2], IDC_MSAA, CB_ADDSTRING, 0, (LPARAM)strdefault);
3802 - SendDlgItemMessage(hTabs[2], IDC_ASPECT3D, CB_ADDSTRING, 0, (LPARAM)strdefault);
3803 - SendDlgItemMessage(hTabs[2], IDC_LOWCOLORRENDER, CB_ADDSTRING, 0, (LPARAM)strdefault);
3804 - SendDlgItemMessage(hTabs[2], IDC_DITHERING, CB_ADDSTRING, 0, (LPARAM)strdefault);
3805 - // Advanced tab
3806 - SendDlgItemMessage(hTabs[3], IDC_TEXTUREFORMAT, CB_ADDSTRING, 0, (LPARAM)strdefault);
3807 - SendDlgItemMessage(hTabs[3], IDC_TEXUPLOAD, CB_ADDSTRING, 0, (LPARAM)strdefault);
3808 - SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_ADDSTRING, 0, (LPARAM)strdefault);
3809 - SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWPOS, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
3810 - SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWSIZE, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
3811 - SendDlgItemMessage(hTabs[3], IDC_WINDOWMAXIMIZED, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
3812 - SendDlgItemMessage(hTabs[3], IDC_NOAUTOSIZE, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
3813 - SendDlgItemMessage(hTabs[3], IDC_CAPTUREMOUSE, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
3814 - // Debug tab
3815 - SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)strdefault);
3816 - }
3817 - else if(!current_app && tristate)
3818 - {
3819 - tristate = FALSE;
3820 - // Display tab
3821 - SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_DELETESTRING,
3822 - SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3823 - SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_DELETESTRING,
3824 - SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3825 - SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_DELETESTRING,
3826 - SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3827 - SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_DELETESTRING,
3828 - SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3829 - SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_DELETESTRING,
3830 - SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3831 - SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_DELETESTRING,
3832 - SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3833 - SendDlgItemMessage(hTabs[0], IDC_DPISCALE, CB_DELETESTRING,
3834 - SendDlgItemMessage(hTabs[0], IDC_DPISCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3835 - SendDlgItemMessage(hTabs[0], IDC_VSYNC, CB_DELETESTRING,
3836 - SendDlgItemMessage(hTabs[0], IDC_VSYNC, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3837 - SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_DELETESTRING,
3838 - SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3839 - SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETSTYLE, BS_AUTOCHECKBOX, (LPARAM)TRUE);
3840 - SendDlgItemMessage(hTabs[0], IDC_SINGLEBUFFER, BM_SETSTYLE, BS_AUTOCHECKBOX, (LPARAM)TRUE);
3841 - // Effects tab
3842 - SendDlgItemMessage(hTabs[1], IDC_POSTSCALE, CB_DELETESTRING,
3843 - SendDlgItemMessage(hTabs[1], IDC_POSTSCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3844 - SendDlgItemMessage(hTabs[1], IDC_POSTSCALESIZE, CB_DELETESTRING,
3845 - SendDlgItemMessage(hTabs[1], IDC_POSTSCALESIZE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3846 - SendDlgItemMessage(hTabs[1], IDC_PRIMARYSCALE, CB_DELETESTRING,
3847 - SendDlgItemMessage(hTabs[1], IDC_PRIMARYSCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3848 - SendDlgItemMessage(hTabs[1], IDC_BLTFILTER, CB_DELETESTRING,
3849 - SendDlgItemMessage(hTabs[1], IDC_BLTFILTER, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3850 - // 3D tab
3851 - SendDlgItemMessage(hTabs[2], IDC_TEXFILTER, CB_DELETESTRING,
3852 - SendDlgItemMessage(hTabs[2], IDC_TEXFILTER, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3853 - SendDlgItemMessage(hTabs[2], IDC_ANISO, CB_DELETESTRING,
3854 - SendDlgItemMessage(hTabs[2], IDC_ANISO, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3855 - SendDlgItemMessage(hTabs[2], IDC_MSAA, CB_DELETESTRING,
3856 - SendDlgItemMessage(hTabs[2], IDC_MSAA, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3857 - SendDlgItemMessage(hTabs[2], IDC_ASPECT3D, CB_DELETESTRING,
3858 - SendDlgItemMessage(hTabs[2], IDC_ASPECT3D, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3859 - SendDlgItemMessage(hTabs[2], IDC_LOWCOLORRENDER, CB_DELETESTRING,
3860 - SendDlgItemMessage(hTabs[2], IDC_LOWCOLORRENDER, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3861 - SendDlgItemMessage(hTabs[2], IDC_DITHERING, CB_DELETESTRING,
3862 - SendDlgItemMessage(hTabs[2], IDC_DITHERING, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3863 - // Advanced tab
3864 - SendDlgItemMessage(hTabs[3], IDC_TEXTUREFORMAT, CB_DELETESTRING,
3865 - SendDlgItemMessage(hTabs[3], IDC_TEXTUREFORMAT, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3866 - SendDlgItemMessage(hTabs[3], IDC_TEXUPLOAD, CB_DELETESTRING,
3867 - SendDlgItemMessage(hTabs[3], IDC_TEXUPLOAD, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3868 - SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_DELETESTRING,
3869 - SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3870 - SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWPOS, BM_SETSTYLE, BS_AUTOCHECKBOX, TRUE);
3871 - SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWSIZE, BM_SETSTYLE, BS_AUTOCHECKBOX, TRUE);
3872 - SendDlgItemMessage(hTabs[3], IDC_WINDOWMAXIMIZED, BM_SETSTYLE, BS_AUTOCHECKBOX, TRUE);
3873 - SendDlgItemMessage(hTabs[3], IDC_NOAUTOSIZE, BM_SETSTYLE, BS_AUTOCHECKBOX, TRUE);
3874 - // Debug tab
3875 - SendDlgItemMessage(hTabs[3], IDC_GLVERSION, CB_DELETESTRING,
3876 - SendDlgItemMessage(hTabs[3], IDC_GLVERSION, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
3877 - }
3878 - // Read settings into controls
3879 - // Display tab
3880 - SetCombo(hTabs[0], IDC_VIDMODE, cfg->scaler, cfgmask->scaler, tristate);
3881 - SetCombo(hTabs[0], IDC_COLORDEPTH, 0, 0, tristate);
3882 - SetCombo(hTabs[0], IDC_SCALE, cfg->scalingfilter, cfgmask->scalingfilter, tristate);
3883 - SetCombo(hTabs[0], IDC_EXTRAMODES, 0, 0, tristate);
3884 - SetAspectCombo(hTabs[0], IDC_ASPECT, cfg->aspect, (DWORD)cfgmask->aspect, tristate);
3885 - SetCombo(hTabs[0], IDC_SORTMODES, cfg->SortModes, cfgmask->SortModes, tristate);
3886 - SetCombo(hTabs[0], IDC_DPISCALE, cfg->DPIScale, cfgmask->DPIScale, tristate);
3887 - SetCombo(hTabs[0], IDC_VSYNC, cfg->vsync, cfgmask->vsync, tristate);
3888 - SetCombo(hTabs[0], IDC_FULLMODE, cfg->fullmode, cfgmask->fullmode, tristate);
3889 - SetCheck(hTabs[0], IDC_COLOR, cfg->colormode, cfgmask->colormode, tristate);
3890 - SetCheck(hTabs[0], IDC_SINGLEBUFFER, cfg->SingleBufferDevice, cfgmask->SingleBufferDevice, tristate);
3891 - if (cfg->scaler == 8)
3892 - {
3893 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABEL), TRUE);
3894 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELX), TRUE);
3895 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELY), TRUE);
3896 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEX), TRUE);
3897 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEY), TRUE);
3898 - }
3899 - else
3900 - {
3901 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABEL), FALSE);
3902 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELX), FALSE);
3903 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELY), FALSE);
3904 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEX), FALSE);
3905 - EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEY), FALSE);
3906 - }
3907 - if ((cfg->scaler == 9) || (cfg->scaler == 10))
3908 - {
3909 - EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODELABEL), TRUE);
3910 - EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODE), TRUE);
3911 - EnableWindow(GetDlgItem(hTabs[0], IDC_SETMODE), TRUE);
3912 - }
3913 - else
3914 - {
3915 - EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODELABEL), FALSE);
3916 - EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODE), FALSE);
3917 - EnableWindow(GetDlgItem(hTabs[0], IDC_SETMODE), FALSE);
3918 - }
3919 - SetFloat3place(hTabs[0], IDC_FIXEDSCALEX, cfg->DisplayMultiplierX, cfgmask->DisplayMultiplierX);
3920 - SetFloat3place(hTabs[0], IDC_FIXEDSCALEY, cfg->DisplayMultiplierY, cfgmask->DisplayMultiplierY);
3921 - SetResolution(hTabs[0], IDC_CUSTOMMODE, cfg, cfgmask);
3922 - // Effects tab
3923 - SetCombo(hTabs[1], IDC_POSTSCALE, cfg->postfilter, cfgmask->postfilter, tristate);
3924 - SetPostScaleCombo(hTabs[1], IDC_POSTSCALESIZE, cfg->postsizex, cfg->postsizey,
3925 - (DWORD)cfgmask->postsizex , (DWORD)cfgmask->postsizey, tristate);
3926 - SetCombo(hTabs[1], IDC_PRIMARYSCALE, cfg->primaryscale, cfgmask->primaryscale, tristate);
3927 - if (cfg->primaryscale == 12)
3928 - {
3929 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABEL), TRUE);
3930 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABELX), TRUE);
3931 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALEX), TRUE);
3932 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABELY), TRUE);
3933 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALEY), TRUE);
3934 - }
3935 - else
3936 - {
3937 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABEL), FALSE);
3938 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABELX), FALSE);
3939 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALEX), FALSE);
3940 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALELABELY), FALSE);
3941 - EnableWindow(GetDlgItem(hTabs[1], IDC_CUSTOMSCALEY), FALSE);
3942 - }
3943 - SetFloat3place(hTabs[1], IDC_CUSTOMSCALEX, cfg->primaryscalex, cfgmask->primaryscalex);
3944 - SetFloat3place(hTabs[1], IDC_CUSTOMSCALEY, cfg->primaryscaley, cfgmask->primaryscaley);
3945 - SetText(hTabs[1], IDC_SHADER, cfg->shaderfile, cfgmask->shaderfile, tristate);
3946 - SetCombo(hTabs[1], IDC_BLTFILTER, cfg->BltScale, cfgmask->BltScale, tristate);
3947 - // Removed for DXGL 0.5.13 release
3948 - /* SetInteger(hTabs[1], IDC_BLTTHRESHOLD, cfg->BltThreshold, cfgmask->BltThreshold);
3949 - if (cfgmask->BltThreshold)
3950 - {
3951 - SendDlgItemMessage(hTabs[1], IDC_BLTTHRESHOLDSLIDER, TBM_SETPOS, TRUE, cfg->BltThreshold);
3952 - }
3953 - else SendDlgItemMessage(hTabs[1], IDC_BLTTHRESHOLDSLIDER, TBM_SETPOS, TRUE, 127);*/
3954 - // 3D tab
3955 - SetCombo(hTabs[2], IDC_TEXFILTER, cfg->texfilter, cfgmask->texfilter, tristate);
3956 - SetCombo(hTabs[2], IDC_ANISO, cfg->anisotropic, cfgmask->anisotropic, tristate);
3957 - SetCombo(hTabs[2], IDC_MSAA, cfg->msaa, cfgmask->msaa, tristate);
3958 - SetCombo(hTabs[2], IDC_ASPECT3D, cfg->aspect3d, cfgmask->aspect3d, tristate);
3959 - SetCombo(hTabs[2], IDC_LOWCOLORRENDER, cfg->LowColorRendering, cfgmask->LowColorRendering, tristate);
3960 - SetCombo(hTabs[2], IDC_DITHERING, cfg->EnableDithering, cfgmask->EnableDithering, tristate);
3961 - // Advanced tab
3962 - SetCombo(hTabs[3],IDC_TEXTUREFORMAT,cfg->TextureFormat,cfgmask->TextureFormat,tristate);
3963 - SetCombo(hTabs[3],IDC_TEXUPLOAD,cfg->TexUpload,cfgmask->TexUpload,tristate);
3964 - SetCombo(hTabs[3], IDC_WINDOWPOS, cfg->WindowPosition, cfgmask->WindowPosition, tristate);
3965 - SetCheck(hTabs[3], IDC_REMEMBERWINDOWPOS, cfg->RememberWindowPosition, cfgmask->RememberWindowPosition, tristate);
3966 - SetCheck(hTabs[3], IDC_REMEMBERWINDOWSIZE, cfg->RememberWindowSize, cfgmask->RememberWindowSize, tristate);
3967 - SetInteger(hTabs[3], IDC_WINDOWX, cfg->WindowX, cfgmask->WindowX);
3968 - SetInteger(hTabs[3], IDC_WINDOWY, cfg->WindowY, cfgmask->WindowY);
3969 - SetInteger(hTabs[3], IDC_WINDOWWIDTH, cfg->WindowWidth, cfgmask->WindowWidth);
3970 - SetInteger(hTabs[3], IDC_WINDOWHEIGHT, cfg->WindowHeight, cfgmask->WindowHeight);
3971 - SetCheck(hTabs[3], IDC_WINDOWMAXIMIZED, cfg->WindowMaximized, cfgmask->WindowMaximized, tristate);
3972 - SetCheck(hTabs[3], IDC_NOAUTOSIZE, cfg->NoResizeWindow, cfgmask->NoResizeWindow, tristate);
3973 - SetCheck(hTabs[3], IDC_CAPTUREMOUSE, cfg->CaptureMouse, cfgmask->CaptureMouse, tristate);
3974 - // Debug tab
3975 - RedrawWindow(GetDlgItem(hTabs[4], IDC_DEBUGLIST), NULL, NULL, RDW_INVALIDATE);
3976 - SetGLCombo(hTabs[4], IDC_GLVERSION, &cfg->DebugMaxGLVersionMajor, &cfg->DebugMaxGLVersionMinor,
3977 - &cfgmask->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMinor, tristate, hWnd);
3978 - // Hacks tab
3979 - UpdateHacksControl(GetDlgItem(hTabs[5], IDC_HACKSLIST), IDC_HACKSDROPDOWN, hackstabitem);
3980 - SetRGBHex(GetDlgItem(hTabs[5], IDC_HACKSLIST), IDC_HACKSEDIT, cfg->HackAutoExpandViewportValue, cfgmask->HackAutoExpandViewportValue);
3981 - RedrawWindow(GetDlgItem(hTabs[5], IDC_HACKSLIST), NULL, NULL, RDW_INVALIDATE);
 3986+ RefreshControls(hWnd);
39823987 }
39833988 break;
39843989 case IDC_ADD:
@@ -4145,6 +4150,13 @@
41464151 SendDlgItemMessage(hWnd,IDC_APPS,CB_DELETESTRING,current_app,0);
41474152 SendMessage(hWnd, WM_COMMAND, IDC_APPS + 0x10000, 0);
41484153 break;
 4154+ case IDC_RESTOREDEFAULTS:
 4155+ GetDefaultConfig(&apps[current_app].cfg);
 4156+ if(current_app) ZeroMemory(&apps[current_app].mask, sizeof(DXGLCFG));
 4157+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 4158+ *dirty = TRUE;
 4159+ RefreshControls(hWnd);
 4160+ break;
41494161 }
41504162 break;
41514163 }
Index: dxglcfg/dxglcfg.rc
@@ -40,6 +40,7 @@
4141 CONTROL "", IDC_TABS, WC_TABCONTROL, 0, 7, 35, 344, 185, WS_EX_LEFT
4242 PUSHBUTTON "A&dd...", IDC_ADD, 7, 223, 50, 14, 0, WS_EX_LEFT
4343 PUSHBUTTON "&Remove", IDC_REMOVE, 59, 223, 50, 14, WS_DISABLED, WS_EX_LEFT
 44+ PUSHBUTTON "Restore defaults", IDC_RESTOREDEFAULTS, 111, 223, 56, 14, 0, WS_EX_LEFT
4445 DEFPUSHBUTTON "OK", IDOK, 195, 223, 50, 14, 0, WS_EX_LEFT
4546 PUSHBUTTON "Cancel", IDCANCEL, 247, 223, 50, 14, 0, WS_EX_LEFT
4647 PUSHBUTTON "&Apply", IDC_APPLY, 299, 223, 50, 14, WS_DISABLED, WS_EX_LEFT
Index: dxglcfg/resource.h
@@ -49,6 +49,7 @@
5050 #define IDC_TABS 1002
5151 #define IDC_ADD 1003
5252 #define IDC_REMOVE 1004
 53+#define IDC_RESTOREDEFAULTS 1005
5354
5455 // Bitmaps
5556 #define IDB_DXGLINV 311