DXGL r754 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r753‎ | r754 | r755 >
Date:15:17, 14 October 2017
Author:admin
Status:new
Tags:
Comment:
Implement most of Display tab in dxglcfg2.
Add color depths and Additional display modes not yet functional.
Modified paths:
  • /dxglcfg2/dxglcfg2.c (modified) (history)
  • /dxglcfg2/dxglcfg2.rc (modified) (history)
  • /dxglcfg2/resource.h (modified) (history)

Diff [purge]

Index: dxglcfg2/dxglcfg2.c
@@ -67,6 +67,7 @@
6868 int iStateID, const RECT *pRect, const RECT *pClipRect) = NULL;
6969 HRESULT(WINAPI *_EnableThemeDialogTexture)(HWND hwnd, DWORD dwFlags) = NULL;
7070 static BOOL ExtraModes_Dropdown = FALSE;
 71+static BOOL ColorDepth_Dropdown = FALSE;
7172 static HWND hDialog = NULL;
7273
7374
@@ -117,7 +118,7 @@
118119 _T("15/32-bit"),
119120 _T("8/15/32-bit"),
120121 _T("16/32-bit"),
121 - _T("8/16/32-bit (recommended)"),
 122+ _T("8/16/32-bit"),
122123 _T("8/15/32-bit"),
123124 _T("8/15/16/32-bit"),
124125 _T("24/32-bit"),
@@ -130,6 +131,14 @@
131132 _T("8/15/16/24/32-bit")
132133 };
133134
 135+static const TCHAR *colormodedropdown[5] = {
 136+ _T("8-bit"),
 137+ _T("15-bit"),
 138+ _T("16-bit"),
 139+ _T("24-bit"),
 140+ _T("32-bit")
 141+};
 142+
134143 static const TCHAR *extramodes[7] = {
135144 _T("Common low resolutions"),
136145 _T("Uncommon low resolutions"),
@@ -732,6 +741,7 @@
733742 case WM_MEASUREITEM:
734743 switch (wParam)
735744 {
 745+ case IDC_COLORDEPTH:
736746 case IDC_EXTRAMODES:
737747 ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = GetSystemMetrics(SM_CYMENUCHECK);
738748 ((LPMEASUREITEMSTRUCT)lParam)->itemWidth = GetSystemMetrics(SM_CXMENUCHECK);
@@ -743,6 +753,66 @@
744754 drawitem = (DRAWITEMSTRUCT*)lParam;
745755 switch (wParam)
746756 {
 757+ case IDC_COLORDEPTH:
 758+ OldTextColor = GetTextColor(drawitem->hDC);
 759+ OldBackColor = GetBkColor(drawitem->hDC);
 760+ if ((drawitem->itemState & ODS_SELECTED) && !(drawitem->itemState & ODS_COMBOBOXEDIT))
 761+ {
 762+ SetTextColor(drawitem->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
 763+ SetBkColor(drawitem->hDC, GetSysColor(COLOR_HIGHLIGHT));
 764+ FillRect(drawitem->hDC, &drawitem->rcItem, (HBRUSH)(COLOR_HIGHLIGHT + 1));
 765+ }
 766+ else ExtTextOut(drawitem->hDC, 0, 0, ETO_OPAQUE, &drawitem->rcItem, NULL, 0, NULL);
 767+ memcpy(&r, &drawitem->rcItem, sizeof(RECT));
 768+ if (drawitem->itemID != -1 && !(drawitem->itemState & ODS_COMBOBOXEDIT))
 769+ {
 770+ r.left = r.left + 2;
 771+ r.right = r.left + GetSystemMetrics(SM_CXMENUCHECK);
 772+ if ((cfg->AddColorDepths >> drawitem->itemID) & 1)
 773+ {
 774+ if (hThemeDisplay)
 775+ {
 776+ if (drawitem->itemState & ODS_SELECTED)
 777+ _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_CHECKEDHOT, &r, NULL);
 778+ else _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_CHECKEDNORMAL, &r, NULL);
 779+ }
 780+ else
 781+ {
 782+ if (drawitem->itemState & ODS_SELECTED)
 783+ DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_HOT);
 784+ else DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED);
 785+ }
 786+ }
 787+ else
 788+ {
 789+ if (hThemeDisplay)
 790+ {
 791+ if (drawitem->itemState & ODS_SELECTED)
 792+ _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_UNCHECKEDHOT, &r, NULL);
 793+ else _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_UNCHECKEDNORMAL, &r, NULL);
 794+ }
 795+ else
 796+ {
 797+ if (drawitem->itemState & ODS_SELECTED)
 798+ DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_HOT);
 799+ else DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK);
 800+ }
 801+ }
 802+ drawitem->rcItem.left += GetSystemMetrics(SM_CXMENUCHECK) + 5;
 803+ }
 804+ combotext[0] = 0;
 805+ if (drawitem->itemID != -1 && !(drawitem->itemState & ODS_COMBOBOXEDIT))
 806+ SendDlgItemMessage(hWnd, IDC_COLORDEPTH, CB_GETLBTEXT, drawitem->itemID, combotext);
 807+ else _tcscpy(combotext, colormodes[cfg->AddColorDepths & 31]);
 808+ DrawText(drawitem->hDC, combotext, _tcslen(combotext), &drawitem->rcItem,
 809+ DT_LEFT | DT_SINGLELINE | DT_VCENTER);
 810+ SetTextColor(drawitem->hDC, OldTextColor);
 811+ SetBkColor(drawitem->hDC, OldBackColor);
 812+ if (drawitem->itemID != -1 && !(drawitem->itemState & ODS_COMBOBOXEDIT))
 813+ drawitem->rcItem.left -= GetSystemMetrics(SM_CXMENUCHECK) + 5;
 814+ if (drawitem->itemState & ODS_FOCUS) DrawFocusRect(drawitem->hDC, &drawitem->rcItem);
 815+ DefWindowProc(hWnd, Msg, wParam, lParam);
 816+ break;
747817 case IDC_EXTRAMODES:
748818 OldTextColor = GetTextColor(drawitem->hDC);
749819 OldBackColor = GetBkColor(drawitem->hDC);
@@ -847,6 +917,28 @@
848918 {
849919 switch (LOWORD(wParam))
850920 {
 921+ case IDC_COLORDEPTH:
 922+ if (HIWORD(wParam) == CBN_SELENDOK)
 923+ {
 924+ if (ColorDepth_Dropdown)
 925+ {
 926+ cursel = SendDlgItemMessage(hWnd, IDC_COLORDEPTH, CB_GETCURSEL, 0, 0);
 927+ i = ((cfg->AddColorDepths >> cursel) & 1);
 928+ if (i) cfg->AddColorDepths &= ~(1 << cursel);
 929+ else cfg->AddColorDepths |= 1 << cursel;
 930+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 931+ *dirty = TRUE;
 932+ }
 933+ }
 934+ if (HIWORD(wParam) == CBN_DROPDOWN)
 935+ {
 936+ ColorDepth_Dropdown = TRUE;
 937+ }
 938+ if (HIWORD(wParam) == CBN_CLOSEUP)
 939+ {
 940+ ColorDepth_Dropdown = FALSE;
 941+ }
 942+ break;
851943 case IDC_EXTRAMODES:
852944 if (HIWORD(wParam) == CBN_SELENDOK)
853945 {
@@ -868,9 +960,57 @@
869961 {
870962 ExtraModes_Dropdown = FALSE;
871963 }
872 - /*cfg->ExtraModes = GetCheck(hWnd,IDC_EXTRAMODES,&cfgmask->ExtraModes);
873 - */
874964 break;
 965+ case IDC_VIDMODE:
 966+ cfg->scaler = GetCombo(hWnd, IDC_VIDMODE, &cfgmask->scaler);
 967+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 968+ *dirty = TRUE;
 969+ break;
 970+ case IDC_SCALE:
 971+ cfg->scalingfilter = GetCombo(hWnd, IDC_SCALE, &cfgmask->scalingfilter);
 972+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 973+ *dirty = TRUE;
 974+ break;
 975+ case IDC_ASPECT:
 976+ if (HIWORD(wParam) == CBN_KILLFOCUS)
 977+ {
 978+ cfg->aspect = GetAspectCombo(hWnd, IDC_ASPECT, &cfgmask->aspect);
 979+ SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
 980+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 981+ *dirty = TRUE;
 982+ }
 983+ else if (HIWORD(wParam) == CBN_SELCHANGE)
 984+ {
 985+ cfg->aspect = GetAspectCombo(hWnd, IDC_ASPECT, &cfgmask->aspect);
 986+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 987+ *dirty = TRUE;
 988+ }
 989+ break;
 990+ case IDC_SORTMODES:
 991+ cfg->SortModes = GetCombo(hWnd, IDC_SORTMODES, &cfgmask->SortModes);
 992+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 993+ *dirty = TRUE;
 994+ break;
 995+ case IDC_DPISCALE:
 996+ cfg->DPIScale = GetCombo(hWnd, IDC_DPISCALE, &cfgmask->DPIScale);
 997+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 998+ *dirty = TRUE;
 999+ break;
 1000+ case IDC_VSYNC:
 1001+ cfg->vsync = GetCombo(hWnd, IDC_VSYNC, &cfgmask->vsync);
 1002+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 1003+ *dirty = TRUE;
 1004+ break;
 1005+ case IDC_FULLMODE:
 1006+ cfg->fullmode = GetCombo(hWnd, IDC_FULLMODE, &cfgmask->fullmode);
 1007+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 1008+ *dirty = TRUE;
 1009+ break;
 1010+ case IDC_COLOR:
 1011+ cfg->colormode = GetCheck(hWnd, IDC_COLOR, &cfgmask->colormode);
 1012+ EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
 1013+ *dirty = TRUE;
 1014+ break;
8751015 }
8761016 }
8771017 default:
@@ -1329,9 +1469,9 @@
13301470 SendDlgItemMessage(hTabs[0],IDC_SORTMODES,CB_ADDSTRING,2,(LPARAM)buffer);
13311471 SendDlgItemMessage(hTabs[0],IDC_SORTMODES,CB_SETCURSEL,cfg->SortModes,0);
13321472 // color depths
1333 - for (i = 0; i < 32; i++)
 1473+ for (i = 0; i < 5; i++)
13341474 {
1335 - _tcscpy(buffer, colormodes[i]);
 1475+ _tcscpy(buffer, colormodedropdown[i]);
13361476 SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_ADDSTRING, i, (LPARAM)buffer);
13371477 }
13381478 SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_SETCURSEL, cfg->AddColorDepths, 0);
@@ -1361,8 +1501,8 @@
13621502 _tcscpy(buffer, _T("Windows AppCompat"));
13631503 SendDlgItemMessage(hTabs[0],IDC_DPISCALE,CB_ADDSTRING,2,(LPARAM)buffer);
13641504 SendDlgItemMessage(hTabs[0],IDC_DPISCALE,CB_SETCURSEL,cfg->DPIScale,0);
1365 - //EnableWindow(GetDlgItem(hWnd, IDC_PATHLABEL), FALSE);
1366 - //EnableWindow(GetDlgItem(hWnd, IDC_PROFILEPATH), FALSE);
 1505+ EnableWindow(GetDlgItem(hTabs[3], IDC_PATHLABEL), FALSE);
 1506+ EnableWindow(GetDlgItem(hTabs[3], IDC_PROFILEPATH), FALSE);
13671507 // Check install path
13681508 installpath = NULL;
13691509 error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\DXGL"), 0, KEY_READ, &hKey);
@@ -1614,9 +1754,9 @@
16151755 SaveChanges(hWnd);
16161756 return TRUE;
16171757 case IDC_APPS:
1618 - if(HIWORD(wParam) == LBN_SELCHANGE)
 1758+ if(HIWORD(wParam) == CBN_SELCHANGE)
16191759 {
1620 - cursel = SendDlgItemMessage(hWnd,IDC_APPS,LB_GETCURSEL,0,0);
 1760+ cursel = SendDlgItemMessage(hWnd,IDC_APPS,CB_GETCURSEL,0,0);
16211761 if(cursel == current_app) break;
16221762 current_app = cursel;
16231763 cfg = &apps[current_app].cfg;
@@ -1624,56 +1764,74 @@
16251765 dirty = &apps[current_app].dirty;
16261766 if (current_app)
16271767 {
1628 -// EnableWindow(GetDlgItem(hWnd, IDC_PATHLABEL), TRUE);
1629 -// EnableWindow(GetDlgItem(hWnd, IDC_PROFILEPATH), TRUE);
1630 -// SetDlgItemText(hWnd, IDC_PROFILEPATH, apps[current_app].path);
1631 - EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), TRUE);
 1768+ EnableWindow(GetDlgItem(hTabs[3], IDC_PATHLABEL), TRUE);
 1769+ EnableWindow(GetDlgItem(hTabs[3], IDC_PROFILEPATH), TRUE);
 1770+ SetDlgItemText(hTabs[3], IDC_PROFILEPATH, apps[current_app].path);
 1771+ if (apps[current_app].builtin) EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), FALSE);
 1772+ else EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), TRUE);
16321773 }
16331774 else
16341775 {
1635 -// EnableWindow(GetDlgItem(hWnd, IDC_PATHLABEL), FALSE);
1636 -// EnableWindow(GetDlgItem(hWnd, IDC_PROFILEPATH), FALSE);
1637 -// SetDlgItemText(hWnd, IDC_PROFILEPATH, _T(""));
 1776+ EnableWindow(GetDlgItem(hTabs[3], IDC_PATHLABEL), FALSE);
 1777+ EnableWindow(GetDlgItem(hTabs[3], IDC_PROFILEPATH), FALSE);
 1778+ SetDlgItemText(hTabs[3], IDC_PROFILEPATH, _T(""));
16381779 EnableWindow(GetDlgItem(hWnd, IDC_REMOVE), FALSE);
16391780 }
1640 - /* // Set 3-state status
 1781+ // Set 3-state status
16411782 if(current_app && !tristate)
16421783 {
16431784 tristate = TRUE;
1644 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,0,(LPARAM)strdefault);
1645 - SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_ADDSTRING,0,(LPARAM)strdefault);
 1785+ // Display tab
 1786+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1787+ SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1788+ SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1789+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1790+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1791+ SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1792+ SendDlgItemMessage(hTabs[0], IDC_DPISCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1793+ SendDlgItemMessage(hTabs[0], IDC_VSYNC, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1794+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1795+ SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETSTYLE, BS_AUTO3STATE, (LPARAM)TRUE);
 1796+ /*
16461797 SendDlgItemMessage(hWnd, IDC_POSTSCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
16471798 SendDlgItemMessage(hWnd, IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)strdefault);
1648 - SendDlgItemMessage(hWnd,IDC_SCALE,CB_ADDSTRING,0,(LPARAM)strdefault);
1649 - SendDlgItemMessage(hWnd,IDC_VSYNC,CB_ADDSTRING,0,(LPARAM)strdefault);
16501799 SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,0,(LPARAM)strdefault);
16511800 SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,0,(LPARAM)strdefault);
16521801 SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,0,(LPARAM)strdefault);
16531802 SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_ADDSTRING,0,(LPARAM)strdefault);
1654 - SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
1655 - SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
1656 - SendDlgItemMessage(hWnd,IDC_UNCOMMONCOLOR,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
1657 - SendDlgItemMessage(hWnd,IDC_EXTRAMODES,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
 1803+ SendDlgItemMessage(hTabs[0], IDC_HIGHRES, BM_SETSTYLE, BS_AUTO3STATE, (LPARAM)TRUE);
16581804 SendDlgItemMessage(hWnd,IDC_TEXTUREFORMAT,CB_ADDSTRING,0,(LPARAM)strdefault);
16591805 SendDlgItemMessage(hWnd,IDC_TEXUPLOAD,CB_ADDSTRING,0,(LPARAM)strdefault);
1660 - SendDlgItemMessage(hWnd, IDC_DPISCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
1661 - SendDlgItemMessage(hWnd, IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)strdefault);
 1806+ */
16621807 }
16631808 else if(!current_app && tristate)
16641809 {
16651810 tristate = FALSE;
1666 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_DELETESTRING,
1667 - SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
1668 - SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_DELETESTRING,
1669 - SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
 1811+ // Display tab
 1812+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_DELETESTRING,
 1813+ SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1814+ SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_DELETESTRING,
 1815+ SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1816+ SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_DELETESTRING,
 1817+ SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1818+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_DELETESTRING,
 1819+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1820+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_DELETESTRING,
 1821+ SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1822+ SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_DELETESTRING,
 1823+ SendDlgItemMessage(hTabs[0], IDC_SORTMODES, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1824+ SendDlgItemMessage(hTabs[0], IDC_DPISCALE, CB_DELETESTRING,
 1825+ SendDlgItemMessage(hTabs[0], IDC_DPISCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1826+ SendDlgItemMessage(hTabs[0], IDC_VSYNC, CB_DELETESTRING,
 1827+ SendDlgItemMessage(hTabs[0], IDC_VSYNC, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1828+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_DELETESTRING,
 1829+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1830+ SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETSTYLE, BS_AUTOCHECKBOX, (LPARAM)TRUE);
 1831+ /*
16701832 SendDlgItemMessage(hWnd, IDC_POSTSCALE, CB_DELETESTRING,
16711833 SendDlgItemMessage(hWnd, IDC_POSTSCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
16721834 SendDlgItemMessage(hWnd, IDC_POSTSCALESIZE, CB_DELETESTRING,
16731835 SendDlgItemMessage(hWnd, IDC_POSTSCALESIZE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
1674 - SendDlgItemMessage(hWnd,IDC_SCALE,CB_DELETESTRING,
1675 - SendDlgItemMessage(hWnd,IDC_SCALE,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
1676 - SendDlgItemMessage(hWnd,IDC_VSYNC,CB_DELETESTRING,
1677 - SendDlgItemMessage(hWnd,IDC_VSYNC,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
16781836 SendDlgItemMessage(hWnd,IDC_MSAA,CB_DELETESTRING,
16791837 SendDlgItemMessage(hWnd,IDC_MSAA,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
16801838 SendDlgItemMessage(hWnd,IDC_ANISO,CB_DELETESTRING,
@@ -1682,30 +1840,31 @@
16831841 SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
16841842 SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_DELETESTRING,
16851843 SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
1686 - SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
16871844 SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
1688 - SendDlgItemMessage(hWnd,IDC_UNCOMMONCOLOR,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
1689 - SendDlgItemMessage(hWnd,IDC_EXTRAMODES,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
16901845 SendDlgItemMessage(hWnd,IDC_TEXTUREFORMAT,CB_DELETESTRING,
16911846 SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
16921847 SendDlgItemMessage(hWnd,IDC_TEXUPLOAD,CB_DELETESTRING,
16931848 SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
1694 - SendDlgItemMessage(hWnd, IDC_DPISCALE, CB_DELETESTRING,
1695 - SendDlgItemMessage(hWnd, IDC_DPISCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
1696 - SendDlgItemMessage(hWnd, IDC_ASPECT, CB_DELETESTRING,
1697 - SendDlgItemMessage(hWnd, IDC_ASPECT, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
 1849+ */
16981850 }
16991851 // Read settings into controls
1700 - SetCombo(hWnd,IDC_VIDMODE,cfg->scaler,cfgmask->scaler,tristate);
1701 - SetCombo(hWnd,IDC_SORTMODES,cfg->SortModes,cfgmask->SortModes,tristate);
 1852+ // Display tab
 1853+ SetCombo(hTabs[0], IDC_VIDMODE, cfg->scaler, cfgmask->scaler, tristate);
 1854+ SetCombo(hTabs[0], IDC_COLORDEPTH, 0, 0, tristate);
 1855+ SetCombo(hTabs[0], IDC_SCALE, cfg->scalingfilter, cfgmask->scalingfilter, tristate);
 1856+ SetCombo(hTabs[0], IDC_EXTRAMODES, 0, 0, tristate);
 1857+ SetAspectCombo(hTabs[0], IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
 1858+ SetCombo(hTabs[0], IDC_SORTMODES, cfg->SortModes, cfgmask->SortModes, tristate);
 1859+ SetCombo(hTabs[0], IDC_DPISCALE, cfg->DPIScale, cfgmask->DPIScale, tristate);
 1860+ SetCombo(hTabs[0], IDC_VSYNC, cfg->vsync, cfgmask->vsync, tristate);
 1861+ SetCombo(hTabs[0], IDC_FULLMODE, cfg->fullmode, cfgmask->fullmode, tristate);
 1862+ SetCheck(hTabs[0], IDC_COLOR, cfg->colormode, cfgmask->colormode, tristate);
 1863+ /*
17021864 SetCombo(hWnd,IDC_POSTSCALE,cfg->firstscalefilter,cfgmask->firstscalefilter,tristate);
1703 - SetCombo(hWnd,IDC_SCALE,cfg->scalingfilter,cfgmask->scalingfilter,tristate);
1704 - SetCombo(hWnd,IDC_VSYNC,cfg->vsync,cfgmask->vsync,tristate);
17051865 SetCombo(hWnd,IDC_MSAA,cfg->msaa,cfgmask->msaa,tristate);
17061866 SetCombo(hWnd,IDC_ANISO,cfg->anisotropic,cfgmask->anisotropic,tristate);
17071867 SetCombo(hWnd,IDC_TEXFILTER,cfg->texfilter,cfgmask->texfilter,tristate);
17081868 SetCombo(hWnd,IDC_ASPECT3D,cfg->aspect3d,cfgmask->aspect3d,tristate);
1709 - SetCheck(hWnd,IDC_COLOR,cfg->colormode,cfgmask->colormode,tristate);
17101869 SetCheck(hWnd,IDC_HIGHRES,cfg->highres,cfgmask->highres,tristate);
17111870 SetCheck(hWnd,IDC_UNCOMMONCOLOR,cfg->AllColorDepths,cfgmask->AllColorDepths,tristate);
17121871 SetCombo(hWnd,IDC_TEXTUREFORMAT,cfg->TextureFormat,cfgmask->TextureFormat,tristate);
@@ -1712,37 +1871,16 @@
17131872 SetCombo(hWnd,IDC_TEXUPLOAD,cfg->TexUpload,cfgmask->TexUpload,tristate);
17141873 SetCheck(hWnd,IDC_EXTRAMODES,cfg->ExtraModes,cfgmask->ExtraModes,tristate);
17151874 SetText(hWnd,IDC_SHADER,cfg->shaderfile,cfgmask->shaderfile,tristate);
1716 - SetCombo(hWnd, IDC_DPISCALE, cfg->DPIScale, cfgmask->DPIScale, tristate);
17171875 SetPostScaleCombo(hWnd, IDC_POSTSCALESIZE, cfg->firstscalex, cfg->firstscaley,
17181876 cfgmask->firstscalex, cfgmask->firstscaley, tristate);
1719 - SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);*/
 1877+ */
17201878 }
1721 - break;
1722 -/* case IDC_VIDMODE:
1723 - cfg->scaler = GetCombo(hWnd,IDC_VIDMODE,&cfgmask->scaler);
1724 - EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
1725 - *dirty = TRUE;
1726 - break;
1727 - case IDC_SORTMODES:
1728 - cfg->SortModes = GetCombo(hWnd,IDC_SORTMODES,&cfgmask->SortModes);
1729 - EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
1730 - *dirty = TRUE;
1731 - break;
 1879+ break;/*
17321880 case IDC_POSTSCALE:
17331881 cfg->firstscalefilter = GetCombo(hWnd,IDC_POSTSCALE,&cfgmask->firstscalefilter);
17341882 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
17351883 *dirty = TRUE;
17361884 break;
1737 - case IDC_SCALE:
1738 - cfg->scalingfilter = GetCombo(hWnd,IDC_SCALE,&cfgmask->scalingfilter);
1739 - EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
1740 - *dirty = TRUE;
1741 - break;
1742 - case IDC_VSYNC:
1743 - cfg->vsync = GetCombo(hWnd,IDC_VSYNC,&cfgmask->vsync);
1744 - EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
1745 - *dirty = TRUE;
1746 - break;
17471885 case IDC_MSAA:
17481886 cfg->msaa = GetCombo(hWnd,IDC_MSAA,&cfgmask->msaa);
17491887 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
@@ -1763,11 +1901,6 @@
17641902 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
17651903 *dirty = TRUE;
17661904 break;
1767 - case IDC_COLOR:
1768 - cfg->colormode = GetCheck(hWnd,IDC_COLOR,&cfgmask->colormode);
1769 - EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
1770 - *dirty = TRUE;
1771 - break;
17721905 case IDC_HIGHRES:
17731906 cfg->highres = GetCheck(hWnd,IDC_HIGHRES,&cfgmask->highres);
17741907 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
@@ -1788,11 +1921,6 @@
17891922 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
17901923 *dirty = TRUE;
17911924 break;
1792 - case IDC_DPISCALE:
1793 - cfg->DPIScale = GetCombo(hWnd,IDC_DPISCALE,&cfgmask->DPIScale);
1794 - EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
1795 - *dirty = TRUE;
1796 - break;
17971925 case IDC_POSTSCALESIZE:
17981926 if (HIWORD(wParam) == CBN_KILLFOCUS)
17991927 {
@@ -1819,21 +1947,7 @@
18201948 *dirty = TRUE;
18211949 }
18221950 break;
1823 - case IDC_ASPECT:
1824 - if (HIWORD(wParam) == CBN_KILLFOCUS)
1825 - {
1826 - cfg->aspect = GetAspectCombo(hWnd, IDC_ASPECT, &cfgmask->aspect);
1827 - SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
1828 - EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
1829 - *dirty = TRUE;
1830 - }
1831 - else if (HIWORD(wParam) == CBN_SELCHANGE)
1832 - {
1833 - cfg->aspect = GetAspectCombo(hWnd, IDC_ASPECT, &cfgmask->aspect);
1834 - EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
1835 - *dirty = TRUE;
1836 - }
1837 - break;*/
 1951+*/
18381952 case IDC_ADD:
18391953 selectedfile[0] = 0;
18401954 ZeroMemory(&filename, OPENFILENAME_SIZE_VERSION_400);
Index: dxglcfg2/dxglcfg2.rc
@@ -40,9 +40,9 @@
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 - DEFPUSHBUTTON "OK", IDOK, 140, 223, 50, 14, 0, WS_EX_LEFT
45 - PUSHBUTTON "Cancel", IDCANCEL, 192, 223, 50, 14, 0, WS_EX_LEFT
46 - PUSHBUTTON "&Apply", IDC_APPLY, 244, 223, 50, 14, WS_DISABLED, WS_EX_LEFT
 44+ DEFPUSHBUTTON "OK", IDOK, 195, 223, 50, 14, 0, WS_EX_LEFT
 45+ PUSHBUTTON "Cancel", IDCANCEL, 247, 223, 50, 14, 0, WS_EX_LEFT
 46+ PUSHBUTTON "&Apply", IDC_APPLY, 299, 223, 50, 14, WS_DISABLED, WS_EX_LEFT
4747 }
4848
4949
@@ -55,7 +55,7 @@
5656 LTEXT "Video mode", IDC_STATIC, 7, 7, 38, 8, SS_LEFT, WS_EX_LEFT
5757 COMBOBOX IDC_VIDMODE, 7, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
5858 LTEXT "Add color depths", IDC_STATIC, 114, 7, 54, 8, SS_LEFT, WS_EX_LEFT
59 - COMBOBOX IDC_COLORDEPTH, 114, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 59+ COMBOBOX IDC_COLORDEPTH, 114, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_OWNERDRAWFIXED, WS_EX_LEFT
6060 LTEXT "Scaling method", IDC_STATIC, 7, 32, 49, 9, SS_LEFT, WS_EX_LEFT
6161 COMBOBOX IDC_SCALE, 7, 43, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
6262 LTEXT "Additional display modes", IDC_STATIC, 114, 32, 78, 8, SS_LEFT, WS_EX_LEFT
@@ -110,7 +110,9 @@
111111 LTEXT "Display name", 0, 7, 35, 43, 9, SS_LEFT, WS_EX_LEFT
112112 EDITTEXT IDC_DISPLAYNAME, 7, 46, 209, 14, ES_AUTOHSCROLL, WS_EX_LEFT
113113 LTEXT "Low color rendering", 0, 7, 65, 63, 9, SS_LEFT, WS_EX_LEFT
114 - COMBOBOX IDC_LOWCOLORRENDER, 5, 76, 104, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 114+ COMBOBOX IDC_LOWCOLORRENDER, 7, 76, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 115+ LTEXT "Installation path", IDC_PATHLABEL, 7, 94, 50, 9, SS_LEFT, WS_EX_LEFT
 116+ EDITTEXT IDC_PROFILEPATH, 7, 105, 209, 14, NOT WS_BORDER | NOT WS_TABSTOP | ES_AUTOHSCROLL | ES_READONLY, WS_EX_LEFT
115117 PUSHBUTTON "Write INI file...", IDC_WRITEINI, 203, 151, 73, 14, 0, WS_EX_LEFT
116118 }
117119
@@ -133,12 +135,12 @@
134136 {
135137 LTEXT "Postprocess scaler", IDC_STATIC, 7, 5, 60, 9, SS_LEFT, WS_EX_LEFT
136138 COMBOBOX IDC_POSTSCALE, 7, 15, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
137 - LTEXT "Postprocess input miultiplier", 0, 114, 5, 86, 9, SS_LEFT, WS_EX_LEFT
 139+ LTEXT "Postprocess input miultiplier", IDC_STATIC, 114, 5, 86, 9, SS_LEFT, WS_EX_LEFT
138140 COMBOBOX IDC_POSTSCALESIZE, 114, 15, 102, 30, CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
139141 AUTOCHECKBOX "Use post-processing shader", IDC_USESHADER, 7, 34, 103, 8, 0, WS_EX_LEFT
140142 COMBOBOX IDC_SHADER, 7, 44, 247, 92, WS_DISABLED | CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
141143 PUSHBUTTON "...", IDC_BROWSESHADER, 256, 43, 20, 14, WS_DISABLED, WS_EX_LEFT
142 - LTEXT "Primary buffer scaling", 0, 7, 60, 68, 8, SS_LEFT, WS_EX_LEFT
 144+ LTEXT "Primary buffer scaling", IDC_STATIC, 7, 60, 68, 8, SS_LEFT, WS_EX_LEFT
143145 COMBOBOX IDC_PRIMARYSCALE, 7, 70, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
144146 LTEXT "Custom scale", IDC_CUSTOMSCALELABEL, 7, 85, 43, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
145147 LTEXT "X", IDC_CUSTOMSCALELABELX, 7, 98, 8, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
Index: dxglcfg2/resource.h
@@ -87,7 +87,9 @@
8888 #define IDC_TEXUPLOAD 2302
8989 #define IDC_DISPLAYNAME 2303
9090 #define IDC_LOWCOLORRENDER 2304
91 -#define IDC_WRITEINI 2305
 91+#define IDC_PATHLABEL 2305
 92+#define IDC_PROFILEPATH 2306
 93+#define IDC_WRITEINI 2307
9294
9395 // Controls - Debug Tab
9496 #define IDC_DEBUGLIST 2401