DXGL r720 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r719‎ | r720 | r721 >
Date:04:53, 9 July 2017
Author:admin
Status:new
Tags:
Comment:
Remove paths tab from dxglcfg2 (was for old config format)
Move postprocess scaling from Display to Effects tab in dxglcfg2.
Modified paths:
  • /dxgl-example.ini (modified) (history)
  • /dxglcfg2/dxglcfg2.c (modified) (history)
  • /dxglcfg2/dxglcfg2.rc (modified) (history)
  • /dxglcfg2/resource.h (modified) (history)

Diff [purge]

Index: dxgl-example.ini
@@ -10,10 +10,17 @@
1111 ; the end user's registry.
1212 NoWriteRegistry = true
1313
 14+; OverrideDefaults - Boolean
 15+; If true, settings not set in the .ini file will not be read from the
 16+; settings in the user's registry but instead will use the default settings.
 17+; If false, the settings in DXGL Config global section will be used as default.
 18+; Default is false
 19+OverrideDefaults = false
 20+
1421 [display]
1522 ; ScalingMode - Integer
1623 ; Determines the method DXGL will use to scale full screen modes.
17 -; Default is 0.
 24+; Default is 0
1825 ; The following values are valid:
1926 ; 0 - Change display mode to match requested mode.
2027 ; 1 - Stretch output to desktop
Index: dxglcfg2/dxglcfg2.c
@@ -852,8 +852,6 @@
853853 SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 3, (LPARAM)&tab);
854854 tab.pszText = _T("Debug");
855855 SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 4, (LPARAM)&tab);
856 - tab.pszText = _T("Paths");
857 - SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 5, (LPARAM)&tab);
858856 hTab = GetDlgItem(hWnd, IDC_TABS);
859857 hTabs[0] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_DISPLAY), hTab, DisplayTabCallback);
860858 hTabs[1] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_3DGRAPHICS), hTab, Tab3DCallback);
@@ -860,7 +858,6 @@
861859 hTabs[2] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_EFFECTS), hTab, EffectsTabCallback);
862860 hTabs[3] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_ADVANCED), hTab, AdvancedTabCallback);
863861 hTabs[4] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_DEBUG), hTab, DebugTabCallback);
864 - hTabs[5] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_PATHS), hTab, PathsTabCallback);
865862 SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETITEMRECT, 0, (LPARAM)&r);
866863 SetWindowPos(hTabs[0], NULL, r.left, r.bottom + 3, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
867864 ShowWindow(hTabs[1], SW_HIDE);
@@ -908,24 +905,24 @@
909906 else SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETCHECK, BST_UNCHECKED, 0);
910907 // first scaling filter
911908 _tcscpy(buffer, _T("Nearest"));
912 - SendDlgItemMessage(hTabs[0], IDC_POSTSCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
 909+ SendDlgItemMessage(hTabs[2], IDC_POSTSCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
913910 _tcscpy(buffer, _T("Bilinear"));
914 - SendDlgItemMessage(hTabs[0], IDC_POSTSCALE, CB_ADDSTRING, 1, (LPARAM)buffer);
915 - SendDlgItemMessage(hWnd, IDC_POSTSCALE, CB_SETCURSEL, cfg->postfilter, 0);
 911+ SendDlgItemMessage(hTabs[2], IDC_POSTSCALE, CB_ADDSTRING, 1, (LPARAM)buffer);
 912+ SendDlgItemMessage(hTabs[2], IDC_POSTSCALE, CB_SETCURSEL, cfg->postfilter, 0);
916913 // first scaling sizes
917914 _tcscpy(buffer, _T("Auto"));
918 - SendDlgItemMessage(hTabs[0], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 915+ SendDlgItemMessage(hTabs[2], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
919916 _tcscpy(buffer, _T("1x"));
920 - SendDlgItemMessage(hTabs[0], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 917+ SendDlgItemMessage(hTabs[2], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
921918 _tcscpy(buffer, _T("2x1"));
922 - SendDlgItemMessage(hTabs[0], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 919+ SendDlgItemMessage(hTabs[2], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
923920 _tcscpy(buffer, _T("2x"));
924 - SendDlgItemMessage(hTabs[0], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 921+ SendDlgItemMessage(hTabs[2], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
925922 _tcscpy(buffer, _T("3x"));
926 - SendDlgItemMessage(hTabs[0], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 923+ SendDlgItemMessage(hTabs[2], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
927924 _tcscpy(buffer, _T("4x"));
928 - SendDlgItemMessage(hTabs[0], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
929 - SetPostScaleCombo(hWnd, IDC_POSTSCALESIZE, cfg->postsizex, cfg->postsizey,
 925+ SendDlgItemMessage(hTabs[2], IDC_POSTSCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 926+ SetPostScaleCombo(hTabs[2], IDC_POSTSCALESIZE, cfg->postsizex, cfg->postsizey,
930927 cfgmask->postsizex, cfgmask->postsizey, tristate);
931928 // final scaling filter
932929 _tcscpy(buffer,_T("Nearest"));
Index: dxglcfg2/dxglcfg2.rc
@@ -42,27 +42,23 @@
4343 COMBOBOX IDC_SCALE, 7, 43, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
4444 LTEXT "Additional display modes", IDC_STATIC, 114, 32, 78, 8, SS_LEFT, WS_EX_LEFT
4545 COMBOBOX IDC_EXTRAMODES, 114, 43, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_OWNERDRAWFIXED, WS_EX_LEFT
46 - LTEXT "Postprocess scaler", IDC_STATIC, 7, 57, 60, 9, SS_LEFT, WS_EX_LEFT
47 - COMBOBOX IDC_POSTSCALE, 7, 67, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
48 - LTEXT "Postprocess input miultiplier", 0, 114, 57, 86, 9, SS_LEFT, WS_EX_LEFT
49 - COMBOBOX IDC_POSTSCALESIZE, 114, 67, 102, 30, CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
50 - LTEXT "Fixed scaling", IDC_FIXEDSCALELABEL, 113, 133, 47, 9, WS_DISABLED | SS_LEFT, WS_EX_LEFT
51 - LTEXT "X", IDC_FIXEDSCALELABELX, 113, 146, 8, 9, WS_DISABLED | SS_LEFT, WS_EX_LEFT
52 - EDITTEXT IDC_FIXEDSCALEX, 121, 143, 24, 14, ES_AUTOHSCROLL, WS_EX_LEFT
53 - LTEXT "Y", IDC_FIXEDSCALELABELY, 150, 146, 8, 9, WS_DISABLED | SS_LEFT, WS_EX_LEFT
54 - EDITTEXT IDC_FIXEDSCALEY, 158, 143, 24, 14, ES_AUTOHSCROLL, WS_EX_LEFT
55 - AUTOCHECKBOX "Square", IDC_FIXEDSCALESQUARE, 187, 143, 29, 14, BS_PUSHLIKE, WS_EX_LEFT
56 - LTEXT "Sort video modes", IDC_STATIC, 114, 82, 56, 8, SS_LEFT, WS_EX_LEFT
57 - COMBOBOX IDC_SORTMODES, 114, 92, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
58 - LTEXT "Screen aspect ratio", IDC_STATIC, 7, 82, 63, 8, SS_LEFT, WS_EX_LEFT
59 - COMBOBOX IDC_ASPECT, 7, 92, 102, 30, CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
60 - LTEXT "Vertical sync", IDC_STATIC, 114, 107, 41, 8, SS_LEFT, WS_EX_LEFT
61 - COMBOBOX IDC_VSYNC, 114, 117, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
62 - LTEXT "DPI scaling mode", IDC_STATIC, 7, 107, 55, 8, SS_LEFT, WS_EX_LEFT
63 - COMBOBOX IDC_DPISCALE, 7, 117, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
64 - AUTOCHECKBOX "Change display color depth", IDC_COLOR, 9, 158, 100, 10, 0, WS_EX_LEFT
65 - LTEXT "Fullscreen window mode", IDC_STATIC, 7, 132, 78, 9, SS_LEFT, WS_EX_LEFT
66 - COMBOBOX IDC_FULLMODE, 8, 143, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 46+ LTEXT "Fixed scaling", IDC_FIXEDSCALELABEL, 113, 112, 47, 9, WS_DISABLED | SS_LEFT, WS_EX_LEFT
 47+ LTEXT "X", IDC_FIXEDSCALELABELX, 113, 125, 8, 9, WS_DISABLED | SS_LEFT, WS_EX_LEFT
 48+ EDITTEXT IDC_FIXEDSCALEX, 121, 122, 24, 14, ES_AUTOHSCROLL, WS_EX_LEFT
 49+ LTEXT "Y", IDC_FIXEDSCALELABELY, 150, 125, 8, 9, WS_DISABLED | SS_LEFT, WS_EX_LEFT
 50+ EDITTEXT IDC_FIXEDSCALEY, 158, 122, 24, 14, ES_AUTOHSCROLL, WS_EX_LEFT
 51+ AUTOCHECKBOX "Square", IDC_FIXEDSCALESQUARE, 187, 122, 29, 14, BS_PUSHLIKE, WS_EX_LEFT
 52+ LTEXT "Sort video modes", IDC_STATIC, 114, 61, 56, 8, SS_LEFT, WS_EX_LEFT
 53+ COMBOBOX IDC_SORTMODES, 114, 71, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 54+ LTEXT "Screen aspect ratio", IDC_STATIC, 7, 61, 63, 8, SS_LEFT, WS_EX_LEFT
 55+ COMBOBOX IDC_ASPECT, 7, 71, 102, 30, CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
 56+ LTEXT "Vertical sync", IDC_STATIC, 114, 86, 41, 8, SS_LEFT, WS_EX_LEFT
 57+ COMBOBOX IDC_VSYNC, 114, 96, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 58+ LTEXT "DPI scaling mode", IDC_STATIC, 7, 86, 55, 8, SS_LEFT, WS_EX_LEFT
 59+ COMBOBOX IDC_DPISCALE, 7, 96, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 60+ AUTOCHECKBOX "Change display color depth", IDC_COLOR, 9, 137, 100, 10, 0, WS_EX_LEFT
 61+ LTEXT "Fullscreen window mode", IDC_STATIC, 7, 111, 78, 9, SS_LEFT, WS_EX_LEFT
 62+ COMBOBOX IDC_FULLMODE, 8, 122, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
6763 }
6864
6965
@@ -135,16 +131,20 @@
136132 STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_CHILDWINDOW
137133 FONT 8, "Ms Shell Dlg"
138134 {
139 - AUTOCHECKBOX "Use post-processing shader", IDC_USESHADER, 7, 8, 103, 8, 0, WS_EX_LEFT
140 - COMBOBOX IDC_SHADER, 7, 18, 247, 92, WS_DISABLED | CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
141 - PUSHBUTTON "...", IDC_BROWSESHADER, 256, 17, 20, 14, WS_DISABLED, WS_EX_LEFT
142 - LTEXT "Primary buffer scaling", 0, 7, 34, 68, 8, SS_LEFT, WS_EX_LEFT
143 - COMBOBOX IDC_PRIMARYSCALE, 7, 44, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
144 - LTEXT "Custom scale", IDC_CUSTOMSCALELABEL, 7, 59, 43, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
145 - LTEXT "X", IDC_CUSTOMSCALELABELX, 7, 72, 8, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
146 - EDITTEXT IDC_CUSTOMSCALEX, 15, 69, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
147 - LTEXT "Y", IDC_CUSTOMSCALELABELY, 57, 72, 8, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
148 - EDITTEXT IDC_CUSTOMSCALEY, 65, 69, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
 135+ AUTOCHECKBOX "Use post-processing shader", IDC_USESHADER, 7, 34, 103, 8, 0, WS_EX_LEFT
 136+ COMBOBOX IDC_SHADER, 7, 44, 247, 92, WS_DISABLED | CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
 137+ PUSHBUTTON "...", IDC_BROWSESHADER, 256, 43, 20, 14, WS_DISABLED, WS_EX_LEFT
 138+ LTEXT "Primary buffer scaling", 0, 7, 60, 68, 8, SS_LEFT, WS_EX_LEFT
 139+ COMBOBOX IDC_PRIMARYSCALE, 7, 70, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 140+ LTEXT "Custom scale", IDC_CUSTOMSCALELABEL, 7, 85, 43, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
 141+ LTEXT "X", IDC_CUSTOMSCALELABELX, 7, 98, 8, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
 142+ EDITTEXT IDC_CUSTOMSCALEX, 15, 95, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
 143+ LTEXT "Y", IDC_CUSTOMSCALELABELY, 57, 98, 8, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
 144+ EDITTEXT IDC_CUSTOMSCALEY, 65, 95, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
 145+ COMBOBOX IDC_POSTSCALESIZE, 114, 15, 102, 30, CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
 146+ LTEXT "Postprocess input miultiplier", 0, 114, 5, 86, 9, SS_LEFT, WS_EX_LEFT
 147+ COMBOBOX IDC_POSTSCALE, 7, 15, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 148+ LTEXT "Postprocess scaler", IDC_STATIC, 7, 5, 60, 9, SS_LEFT, WS_EX_LEFT
149149 }
150150
151151
@@ -161,16 +161,6 @@
162162
163163
164164
165 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
166 -IDD_PATHS DIALOG 0, 0, 283, 173
167 -STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_CHILDWINDOW
168 -FONT 8, "Ms Shell Dlg"
169 -{
170 - LISTBOX IDC_PATHS, 7, 7, 269, 162, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT | LBS_SORT | LBS_NOTIFY, WS_EX_LEFT
171 -}
172 -
173 -
174 -
175165 //
176166 // Icon resources
177167 //
Index: dxglcfg2/resource.h
@@ -29,7 +29,6 @@
3030 #define IDD_EFFECTS 113
3131 #define IDD_ADVANCED 114
3232 #define IDD_DEBUG 115
33 -#define IDD_PATHS 116
3433 #define IDC_APPLY 1000
3534 #define IDC_APPS 1001
3635 #define IDC_ADD 1002
@@ -63,14 +62,13 @@
6463 #define IDC_USESHADER 1030
6564 #define IDC_PROGRESS 1031
6665 #define IDC_DISPLAYNAME 1032
67 -#define IDC_PATHS 1033
68 -#define IDC_FIXEDSCALELABEL 1034
69 -#define IDC_FIXEDSCALELABELX 1035
70 -#define IDC_FIXEDSCALEX 1036
71 -#define IDC_FIXEDSCALELABELY 1037
72 -#define IDC_FIXEDSCALEY 1038
73 -#define IDC_FIXEDSCALESQUARE 1039
74 -#define IDC_LOWCOLORRENDER 1040
75 -#define IDC_FULLMODE 1041
76 -#define IDC_POSTSCALE 1042
77 -#define IDC_POSTSCALESIZE 1043
 66+#define IDC_FIXEDSCALELABEL 1033
 67+#define IDC_FIXEDSCALELABELX 1034
 68+#define IDC_FIXEDSCALEX 1035
 69+#define IDC_FIXEDSCALELABELY 1036
 70+#define IDC_FIXEDSCALEY 1037
 71+#define IDC_FIXEDSCALESQUARE 1038
 72+#define IDC_LOWCOLORRENDER 1039
 73+#define IDC_FULLMODE 1040
 74+#define IDC_POSTSCALE 1041
 75+#define IDC_POSTSCALESIZE 1042