DXGL r405 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r404‎ | r405 | r406 >
Date:01:09, 10 November 2013
Author:admin
Status:new
Tags:
Comment:
Add aspect and DPI to dxglcfg GUI. Currently unimplemented.
Tweak dxglcfg control alignments.
Change name of aspect variable in source code.
Modified paths:
  • /cfgmgr/ReadMe.txt (modified) (history)
  • /cfgmgr/cfgmgr.cpp (modified) (history)
  • /cfgmgr/cfgmgr.h (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)
  • /dxglcfg/dxglcfg.rc (modified) (history)
  • /dxglcfg/resource.h (modified) (history)

Diff [purge]

Index: cfgmgr/ReadMe.txt
——@@ -65,7 +65,7 @@
6666 Coverage sample count + 4096 × Color sample count
6767 Example: 16 coverage, 8 color = 0x8010
6868
69 -Member aspect
 69+Member aspect3d
7070 REG_DWORD HKCU\DXGL\<app>\AdjustAspectRatio
7171 If the scaler is 1 or 4, adjust 3D projection to correct aspect ratio. Does
7272 not affect 2D blits or similar operations.
Index: cfgmgr/cfgmgr.cpp
——@@ -132,7 +132,7 @@
133133 cfg->texfilter = ReadDWORD(hKey,cfg->texfilter,cfgmask->texfilter,_T("TextureFilter"));
134134 cfg->anisotropic = ReadDWORD(hKey,cfg->anisotropic,cfgmask->anisotropic,_T("AnisotropicFiltering"));
135135 cfg->msaa = ReadDWORD(hKey,cfg->msaa,cfgmask->msaa,_T("Antialiasing"));
136 - cfg->aspect = ReadDWORD(hKey,cfg->aspect,cfgmask->aspect,_T("AdjustAspectRatio"));
 136+ cfg->aspect3d = ReadDWORD(hKey,cfg->aspect3d,cfgmask->aspect3d,_T("AdjustAspectRatio"));
137137 cfg->highres = ReadBool(hKey,cfg->highres,cfgmask->highres,_T("AdjustPrimaryResolution"));
138138 ReadPath(hKey,cfg->shaderfile,cfgmask->shaderfile,_T("ShaderFile"));
139139 cfg->SortModes = ReadDWORD(hKey,cfg->SortModes,cfgmask->SortModes,_T("SortModes"));
——@@ -212,7 +212,7 @@
213213 WriteDWORD(hKey,cfg->texfilter,cfgmask->texfilter,_T("TextureFilter"));
214214 WriteDWORD(hKey,cfg->anisotropic,cfgmask->anisotropic,_T("AnisotropicFiltering"));
215215 WriteDWORD(hKey,cfg->msaa,cfgmask->msaa,_T("Antialiasing"));
216 - WriteDWORD(hKey,cfg->aspect,cfgmask->aspect,_T("AdjustAspectRatio"));
 216+ WriteDWORD(hKey,cfg->aspect3d,cfgmask->aspect3d,_T("AdjustAspectRatio"));
217217 WriteBool(hKey,cfg->highres,cfgmask->highres,_T("AdjustPrimaryResolution"));
218218 WritePath(hKey,cfg->shaderfile,cfgmask->shaderfile,_T("ShaderFile"));
219219 WriteDWORD(hKey,cfg->SortModes,cfgmask->SortModes,_T("SortModes"));
Index: cfgmgr/cfgmgr.h
——@@ -28,7 +28,7 @@
2929 DWORD texfilter;
3030 DWORD anisotropic;
3131 DWORD msaa;
32 - DWORD aspect;
 32+ DWORD aspect3d;
3333 bool highres;
3434 DWORD vsync;
3535 TCHAR shaderfile[MAX_PATH+1];
Index: dxglcfg/dxglcfg.cpp
——@@ -538,12 +538,12 @@
539539 }
540540 // aspect
541541 _tcscpy(buffer,_T("Stretch to display"));
542 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 542+ SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_ADDSTRING,0,(LPARAM)buffer);
543543 _tcscpy(buffer,_T("Expand viewable area"));
544 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,1,(LPARAM)buffer);
 544+ SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_ADDSTRING,1,(LPARAM)buffer);
545545 _tcscpy(buffer,_T("Crop to display"));
546 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,2,(LPARAM)buffer);
547 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_SETCURSEL,cfg->aspect,0);
 546+ SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_ADDSTRING,2,(LPARAM)buffer);
 547+ SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_SETCURSEL,cfg->aspect3d,0);
548548 // sort modes
549549 _tcscpy(buffer,_T("Use system order"));
550550 SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_ADDSTRING,0,(LPARAM)buffer);
——@@ -780,7 +780,7 @@
781781 SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,0,(LPARAM)strdefault);
782782 SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,0,(LPARAM)strdefault);
783783 SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,0,(LPARAM)strdefault);
784 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)strdefault);
 784+ SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_ADDSTRING,0,(LPARAM)strdefault);
785785 SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
786786 SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
787787 SendDlgItemMessage(hWnd,IDC_UNCOMMONCOLOR,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
——@@ -805,16 +805,16 @@
806806 SendDlgItemMessage(hWnd,IDC_ANISO,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
807807 SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_DELETESTRING,
808808 SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
809 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_DELETESTRING,
810 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
 809+ SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_DELETESTRING,
 810+ SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
811811 SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
812812 SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
813813 SendDlgItemMessage(hWnd,IDC_UNCOMMONCOLOR,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
814814 SendDlgItemMessage(hWnd,IDC_EXTRAMODES,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
815815 SendDlgItemMessage(hWnd,IDC_TEXTUREFORMAT,CB_DELETESTRING,
816 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
 816+ SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
817817 SendDlgItemMessage(hWnd,IDC_TEXUPLOAD,CB_DELETESTRING,
818 - SendDlgItemMessage(hWnd,IDC_ASPECT,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
 818+ SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
819819 }
820820 // Read settings into controls
821821 SetCombo(hWnd,IDC_VIDMODE,cfg->scaler,cfgmask->scaler,tristate);
——@@ -824,7 +824,7 @@
825825 SetCombo(hWnd,IDC_MSAA,cfg->msaa,cfgmask->msaa,tristate);
826826 SetCombo(hWnd,IDC_ANISO,cfg->anisotropic,cfgmask->anisotropic,tristate);
827827 SetCombo(hWnd,IDC_TEXFILTER,cfg->texfilter,cfgmask->texfilter,tristate);
828 - SetCombo(hWnd,IDC_ASPECT,cfg->aspect,cfgmask->aspect,tristate);
 828+ SetCombo(hWnd,IDC_ASPECT3D,cfg->aspect3d,cfgmask->aspect3d,tristate);
829829 SetCheck(hWnd,IDC_COLOR,cfg->colormode,cfgmask->colormode,tristate);
830830 SetCheck(hWnd,IDC_HIGHRES,cfg->highres,cfgmask->highres,tristate);
831831 SetCheck(hWnd,IDC_UNCOMMONCOLOR,cfg->AllColorDepths,cfgmask->AllColorDepths,tristate);
——@@ -868,8 +868,8 @@
869869 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),true);
870870 *dirty = true;
871871 break;
872 - case IDC_ASPECT:
873 - cfg->aspect = GetCombo(hWnd,IDC_ASPECT,cfgmask->aspect);
 872+ case IDC_ASPECT3D:
 873+ cfg->aspect3d = GetCombo(hWnd,IDC_ASPECT3D,cfgmask->aspect3d);
874874 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),true);
875875 *dirty = true;
876876 break;
Index: dxglcfg/dxglcfg.rc
——@@ -44,7 +44,7 @@
4545 GROUPBOX "Graphics", IDC_STATIC, 190, 4, 211, 238
4646 LTEXT "Video mode", IDC_STATIC, 195, 14, 38, 8, SS_LEFT
4747 COMBOBOX IDC_VIDMODE, 195, 24, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
48 - AUTOCHECKBOX "Change color depth", IDC_COLOR, 299, 14, 79, 10
 48+ AUTOCHECKBOX "Change display color depth", IDC_COLOR, 299, 14, 100, 8
4949 LTEXT "Scaling method", IDC_STATIC, 195, 69, 49, 8, SS_LEFT
5050 COMBOBOX IDC_SCALE, 195, 79, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
5151 LTEXT "Vertical sync", IDC_STATIC, 299, 69, 41, 8, SS_LEFT
——@@ -52,23 +52,27 @@
5353 LTEXT "Scaling shader", IDC_STATIC, 195, 94, 47, 8, SS_LEFT
5454 EDITTEXT IDC_SHADER, 195, 104, 183, 14, ES_AUTOHSCROLL
5555 PUSHBUTTON "...", IDC_BROWSESHADER, 379, 104, 20, 14
56 - LTEXT "Texture filter", IDC_STATIC, 195, 120, 43, 8, SS_LEFT
57 - COMBOBOX IDC_TEXFILTER, 195, 130, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
58 - LTEXT "Anisotropic filtering", IDC_STATIC, 299, 120, 62, 8, SS_LEFT
59 - COMBOBOX IDC_ANISO, 299, 130, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
60 - LTEXT "Antialiasing (MSAA)", IDC_STATIC, 195, 145, 63, 8, SS_LEFT
61 - COMBOBOX IDC_MSAA, 196, 155, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
62 - LTEXT "Aspect ratio", IDC_STATIC, 300, 145, 40, 8, SS_LEFT
63 - COMBOBOX IDC_ASPECT, 299, 155, 100, 14, CBS_DROPDOWNLIST | CBS_HASSTRINGS
64 - AUTOCHECKBOX "Adjust Primary resolution", IDC_HIGHRES, 299, 28, 96, 8
65 - AUTOCHECKBOX "Support All Color Depths", IDC_UNCOMMONCOLOR, 299, 55, 94, 8
66 - AUTOCHECKBOX "Add Extra Display Modes", IDC_EXTRAMODES, 299, 42, 100, 8
 56+ LTEXT "Texture filter", IDC_STATIC, 195, 145, 43, 8, SS_LEFT
 57+ COMBOBOX IDC_TEXFILTER, 195, 155, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 58+ LTEXT "Anisotropic filtering", IDC_STATIC, 299, 145, 62, 8, SS_LEFT
 59+ COMBOBOX IDC_ANISO, 299, 155, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 60+ LTEXT "Antialiasing (MSAA)", IDC_STATIC, 195, 170, 63, 8, SS_LEFT
 61+ COMBOBOX IDC_MSAA, 195, 180, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 62+ LTEXT "Renderer aspect ratio", IDC_STATIC, 299, 170, 71, 8, SS_LEFT
 63+ COMBOBOX IDC_ASPECT3D, 299, 180, 100, 14, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 64+ AUTOCHECKBOX "Adjust primary resolution", IDC_HIGHRES, 299, 28, 96, 8
 65+ AUTOCHECKBOX "Support all color depths", IDC_UNCOMMONCOLOR, 299, 55, 91, 8
 66+ AUTOCHECKBOX "Add extra display modes", IDC_EXTRAMODES, 299, 42, 95, 8
6767 LTEXT "Sort video modes", IDC_STATIC, 195, 39, 56, 8, SS_LEFT
6868 COMBOBOX IDC_SORTMODES, 195, 49, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
69 - LTEXT "Texture format", IDC_STATIC, 196, 170, 50, 8, SS_LEFT
70 - COMBOBOX IDC_TEXTUREFORMAT, 196, 180, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
71 - LTEXT "Texture access method", IDC_STATIC, 300, 170, 76, 8, SS_LEFT
72 - COMBOBOX IDC_TEXUPLOAD, 299, 180, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 69+ LTEXT "Texture format", IDC_STATIC, 195, 195, 50, 8, SS_LEFT
 70+ COMBOBOX IDC_TEXTUREFORMAT, 195, 205, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 71+ LTEXT "Texture access method", IDC_STATIC, 299, 195, 76, 8, SS_LEFT
 72+ COMBOBOX IDC_TEXUPLOAD, 299, 205, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 73+ LTEXT "Screen aspect ratio", IDC_STATIC, 195, 120, 63, 8, SS_LEFT
 74+ LTEXT "DPI scaling mode", IDC_STATIC, 299, 120, 55, 8, SS_LEFT
 75+ COMBOBOX IDC_ASPECT, 195, 130, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 76+ COMBOBOX IDC_DPISCALE, 299, 130, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
7377 }
7478
7579
Index: dxglcfg/resource.h
——@@ -23,6 +23,7 @@
2424 #define IDI_DXGL 107
2525 #define IDI_DXGLSM 109
2626 #define IDI_STAR 111
 27+#define IDC_ASPECT3D 1000
2728 #define IDC_HIGHRES 1002
2829 #define IDC_SORTMODES 1003
2930 #define IDC_UNCOMMONCOLOR 1004
——@@ -39,7 +40,8 @@
4041 #define IDC_ANISO 1047
4142 #define IDC_MSAA 1048
4243 #define IDC_COLOR 1049
43 -#define IDC_ASPECT 1050
4444 #define IDC_EXTRAMODES 1055
4545 #define IDC_TEXTUREFORMAT 1058
4646 #define IDC_TEXUPLOAD 1059
 47+#define IDC_ASPECT 1061
 48+#define IDC_DPISCALE 1063