DXGL r625 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r624‎ | r625 | r626 >
Date:02:03, 7 November 2015
Author:admin
Status:new
Tags:
Comment:
Add config option for fullscreen modes to force windowed mode.
Remove deprecated tags from dxglcfg
Update help screenshot.
Fix versioning in dxglcfg2
Modified paths:
  • /Help/dxglcfg.png (modified) (history)
  • /cfgmgr/ReadMe.txt (modified) (history)
  • /cfgmgr/cfgmgr.c (modified) (history)
  • /cfgmgr/cfgmgr.h (modified) (history)
  • /dxglcfg/dxglcfg.c (modified) (history)
  • /dxglcfg/dxglcfg.rc (modified) (history)
  • /dxglcfg/resource.h (modified) (history)
  • /dxglcfg2/dxglcfg2.rc (modified) (history)
  • /dxglcfg2/resource.h (modified) (history)

Diff [purge]

Index: Help/dxglcfg.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: cfgmgr/ReadMe.txt
——@@ -12,6 +12,15 @@
1313 6 - Change display mode, center if matching mode not found
1414 7 - Crop output to desktop, preserving aspect ratio
1515
 16+Member fullmode
 17+REG_DWORD HKCU\DXGL\<app>\FullscreenWindowMode
 18+Determines how to handle fullscreen modes.
 19+Valid settings:
 20+0 - Use exclusive fullscreen
 21+1 - Use non-exclusive fullscreen aka borderless window
 22+2 - Use a non-resizable window
 23+3 - Use a resizable window, uses scaler mode, preferably 1, 2, 3, or 7
 24+
1625 Member colormode
1726 REG_DWORD HKCU\DXGL\<app>\ChangeColorDepth
1827 If nonzero, switches screen color depth if requested by the application.
Index: cfgmgr/cfgmgr.c
——@@ -441,6 +441,7 @@
442442 if (mask) cfgmask = mask;
443443 else cfgmask = &defaultmask;
444444 cfg->scaler = ReadDWORD(hKey, cfg->scaler, &cfgmask->scaler, _T("ScalingMode"));
 445+ cfg->fullmode = ReadDWORD(hKey, cfg->fullmode, &cfgmask->fullmode, _T("FullscreenWindowMode"));
445446 cfg->colormode = ReadBool(hKey,cfg->colormode,&cfgmask->colormode,_T("ChangeColorDepth"));
446447 cfg->scalingfilter = ReadDWORD(hKey,cfg->scalingfilter,&cfgmask->scalingfilter,_T("ScalingFilter"));
447448 cfg->texfilter = ReadDWORD(hKey,cfg->texfilter,&cfgmask->texfilter,_T("TextureFilter"));
——@@ -534,6 +535,7 @@
535536 memset(&defaultmask,1,sizeof(DXGLCFG));
536537 defaultmask.aspect = 1.0f;
537538 WriteDWORD(hKey,cfg->scaler,cfgmask->scaler,_T("ScalingMode"));
 539+ WriteDWORD(hKey, cfg->fullmode, cfgmask->fullmode, _T("FullscreenWindowMode"));
538540 WriteBool(hKey,cfg->colormode,cfgmask->colormode,_T("ChangeColorDepth"));
539541 WriteDWORD(hKey,cfg->scalingfilter,cfgmask->scalingfilter,_T("ScalingFilter"));
540542 WriteDWORD(hKey,cfg->texfilter,cfgmask->texfilter,_T("TextureFilter"));
Index: cfgmgr/cfgmgr.h
——@@ -26,6 +26,7 @@
2727 typedef struct
2828 {
2929 DWORD scaler;
 30+ DWORD fullmode;
3031 BOOL colormode;
3132 DWORD scalingfilter;
3233 DWORD texfilter;
Index: dxglcfg/dxglcfg.c
——@@ -552,6 +552,16 @@
553553 _tcscpy(buffer,_T("Crop to screen (experimental)"));
554554 SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,7,(LPARAM)buffer);
555555 SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_SETCURSEL,cfg->scaler,0);
 556+ // fullmode
 557+ _tcscpy(buffer, _T("Exclusive fullscreen"));
 558+ SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_ADDSTRING, 0, (LPARAM)buffer);
 559+ _tcscpy(buffer, _T("Non-exclusive fullscreen"));
 560+ SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_ADDSTRING, 1, (LPARAM)buffer);
 561+ _tcscpy(buffer, _T("Non-resizable window"));
 562+ SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_ADDSTRING, 2, (LPARAM)buffer);
 563+ _tcscpy(buffer, _T("Resizable window"));
 564+ SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_ADDSTRING, 3, (LPARAM)buffer);
 565+ SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_SETCURSEL, cfg->fullmode, 0);
556566 // colormode
557567 if(cfg->colormode) SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETCHECK,BST_CHECKED,0);
558568 else SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETCHECK,BST_UNCHECKED,0);
——@@ -957,7 +967,8 @@
958968 SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,0,(LPARAM)strdefault);
959969 SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_ADDSTRING,0,(LPARAM)strdefault);
960970 SendDlgItemMessage(hWnd,IDC_SCALE,CB_ADDSTRING,0,(LPARAM)strdefault);
961 - SendDlgItemMessage(hWnd,IDC_VSYNC,CB_ADDSTRING,0,(LPARAM)strdefault);
 971+ //SendDlgItemMessage(hWnd,IDC_VSYNC,CB_ADDSTRING,0,(LPARAM)strdefault);
 972+ SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_ADDSTRING, 0, (LPARAM)strdefault);
962973 SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,0,(LPARAM)strdefault);
963974 SendDlgItemMessage(hWnd,IDC_ANISO,CB_ADDSTRING,0,(LPARAM)strdefault);
964975 SendDlgItemMessage(hWnd,IDC_TEXFILTER,CB_ADDSTRING,0,(LPARAM)strdefault);
——@@ -980,8 +991,10 @@
981992 SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
982993 SendDlgItemMessage(hWnd,IDC_SCALE,CB_DELETESTRING,
983994 SendDlgItemMessage(hWnd,IDC_SCALE,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
984 - SendDlgItemMessage(hWnd,IDC_VSYNC,CB_DELETESTRING,
985 - SendDlgItemMessage(hWnd,IDC_VSYNC,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
 995+/* SendDlgItemMessage(hWnd,IDC_VSYNC,CB_DELETESTRING,
 996+ SendDlgItemMessage(hWnd,IDC_VSYNC,CB_FINDSTRING,-1,(LPARAM)strdefault),0);*/
 997+ SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_DELETESTRING,
 998+ SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
986999 SendDlgItemMessage(hWnd,IDC_MSAA,CB_DELETESTRING,
9871000 SendDlgItemMessage(hWnd,IDC_MSAA,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
9881001 SendDlgItemMessage(hWnd,IDC_ANISO,CB_DELETESTRING,
——@@ -1007,7 +1020,8 @@
10081021 SetCombo(hWnd,IDC_VIDMODE,cfg->scaler,cfgmask->scaler,tristate);
10091022 SetCombo(hWnd,IDC_SORTMODES,cfg->SortModes,cfgmask->SortModes,tristate);
10101023 SetCombo(hWnd,IDC_SCALE,cfg->scalingfilter,cfgmask->scalingfilter,tristate);
1011 - SetCombo(hWnd,IDC_VSYNC,cfg->vsync,cfgmask->vsync,tristate);
 1024+ //SetCombo(hWnd,IDC_VSYNC,cfg->vsync,cfgmask->vsync,tristate);
 1025+ SetCombo(hWnd,IDC_FULLMODE,cfg->fullmode,cfgmask->fullmode,tristate);
10121026 SetCombo(hWnd,IDC_MSAA,cfg->msaa,cfgmask->msaa,tristate);
10131027 SetCombo(hWnd,IDC_ANISO,cfg->anisotropic,cfgmask->anisotropic,tristate);
10141028 SetCombo(hWnd,IDC_TEXFILTER,cfg->texfilter,cfgmask->texfilter,tristate);
——@@ -1038,10 +1052,15 @@
10391053 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
10401054 *dirty = TRUE;
10411055 break;
1042 - case IDC_VSYNC:
 1056+/* case IDC_VSYNC:
10431057 cfg->vsync = GetCombo(hWnd,IDC_VSYNC,&cfgmask->vsync);
10441058 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
10451059 *dirty = TRUE;
 1060+ break;*/
 1061+ case IDC_FULLMODE:
 1062+ cfg->fullmode = GetCombo(hWnd, IDC_FULLMODE, &cfgmask->fullmode);
 1063+ EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
 1064+ *dirty = TRUE;
10461065 break;
10471066 case IDC_MSAA:
10481067 cfg->msaa = GetCombo(hWnd,IDC_MSAA,&cfgmask->msaa);
Index: dxglcfg/dxglcfg.rc
——@@ -30,7 +30,7 @@
3131 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
3232 IDD_DXGLCFG DIALOG 0, 0, 405, 265
3333 STYLE DS_3DLOOK | DS_CONTEXTHELP | DS_SETFONT | WS_CAPTION | WS_SYSMENU
34 -CAPTION "DXGL Config (DEPRECATED)"
 34+CAPTION "DXGL Config"
3535 FONT 8, "Ms Shell Dlg 2"
3636 {
3737 DEFPUSHBUTTON "OK", IDOK, 247, 247, 50, 14
——@@ -47,8 +47,8 @@
4848 AUTOCHECKBOX "Change display color depth", IDC_COLOR, 299, 14, 100, 10
4949 LTEXT "Scaling method", IDC_STATIC, 195, 69, 49, 8, SS_LEFT
5050 COMBOBOX IDC_SCALE, 195, 79, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
51 - LTEXT "Vertical sync", IDC_STATIC, 299, 69, 41, 8, SS_LEFT
52 - COMBOBOX IDC_VSYNC, 299, 79, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 51+ LTEXT "Fullscreen mode", IDC_STATIC, 299, 69, 41, 8, SS_LEFT
 52+ COMBOBOX IDC_FULLMODE, 299, 79, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
5353 LTEXT "Post-processing shader", IDC_STATIC, 195, 94, 90, 8, SS_LEFT
5454 EDITTEXT IDC_SHADER, 195, 104, 183, 14, ES_AUTOHSCROLL
5555 PUSHBUTTON "...", IDC_BROWSESHADER, 379, 104, 20, 14
——@@ -110,7 +110,7 @@
111111 {
112112 BLOCK "08000352"
113113 {
114 - VALUE "FileDescription", "DXGL Configuration Program (DEPRECATED VERSION)"
 114+ VALUE "FileDescription", "DXGL Configuration Program"
115115 VALUE "FileVersion", DXGLVERSTRING
116116 VALUE "InternalName", "DXGL"
117117 VALUE "LegalCopyright", "Copyright © 2011-2014 William Feely"
Index: dxglcfg/resource.h
——@@ -33,7 +33,7 @@
3434 #define IDC_REMOVE 1039
3535 #define IDC_VIDMODE 1041
3636 #define IDC_SCALE 1042
37 -#define IDC_VSYNC 1043
 37+#define IDC_FULLMODE 1043
3838 #define IDC_SHADER 1044
3939 #define IDC_BROWSESHADER 1045
4040 #define IDC_TEXFILTER 1046
Index: dxglcfg2/dxglcfg2.rc
——@@ -57,6 +57,8 @@
5858 LTEXT "DPI scaling mode", IDC_STATIC, 7, 107, 55, 8, SS_LEFT, WS_EX_LEFT
5959 COMBOBOX IDC_DPISCALE, 7, 117, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
6060 AUTOCHECKBOX "Change display color depth", IDC_COLOR, 114, 118, 100, 10, 0, WS_EX_LEFT
 61+ LTEXT "Fullscreen mode", IDC_STATIC, 7, 132, 78, 9, SS_LEFT, WS_EX_LEFT
 62+ COMBOBOX IDC_FULLMODE, 8, 143, 101, 30, CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
6163 }
6264
6365
——@@ -186,8 +188,8 @@
187189 //
188190 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
189191 1 VERSIONINFO
190 - FILEVERSION 0,5,7,609
191 - PRODUCTVERSION 0,5,7,609
 192+ FILEVERSION DXGLVERNUMBER
 193+ PRODUCTVERSION DXGLVERNUMBER
192194 FILEOS VOS__WINDOWS32
193195 FILETYPE VFT_APP
194196 FILESUBTYPE VFT2_UNKNOWN
——@@ -199,12 +201,12 @@
200202 BLOCK "08000352"
201203 {
202204 VALUE "FileDescription", "DXGL Configuration Program"
203 - VALUE "FileVersion", "0.5.7 r609"
 205+ VALUE "FileVersion", "DXGLVERSTRING"
204206 VALUE "InternalName", "DXGL"
205207 VALUE "LegalCopyright", "Copyright © 2011-2015 William Feely"
206208 VALUE "OriginalFilename", "dxglcfg.exe"
207209 VALUE "ProductName", "DXGL"
208 - VALUE "ProductVersion", "0.5.7 r609"
 210+ VALUE "ProductVersion", "DXGLVERSTRING"
209211 }
210212 }
211213 BLOCK "VarFileInfo"
Index: dxglcfg2/resource.h
——@@ -54,3 +54,4 @@
5555 #define IDC_FIXEDSCALEY 1038
5656 #define IDC_FIXEDSCALESQUARE 1039
5757 #define IDC_LOWCOLORRENDER 1040
 58+#define IDC_FULLMODE 1041