DXGL r563 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r562‎ | r563 | r564 >
Date:03:23, 10 November 2014
Author:admin
Status:new
Tags:
Comment:
Implement profile dropdown in new DXGLCFG.
Fix a missing break command in both DXGLCFG versions.
Modified paths:
  • /dxglcfg/dxglcfg.c (modified) (history)
  • /dxglcfg2 (modified) (history)
  • /dxglcfg2/dxglcfg2.c (modified) (history)
  • /dxglcfg2/dxglcfg2.rc (modified) (history)
  • /dxglcfg2/resource.h (modified) (history)

Diff [purge]

Index: dxglcfg/dxglcfg.c
@@ -1004,6 +1004,7 @@
10051005 SetCombo(hWnd, IDC_DPISCALE, cfg->DPIScale, cfgmask->DPIScale, tristate);
10061006 SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
10071007 }
 1008+ break;
10081009 case IDC_VIDMODE:
10091010 cfg->scaler = GetCombo(hWnd,IDC_VIDMODE,&cfgmask->scaler);
10101011 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
Index: dxglcfg2/dxglcfg2.c
@@ -451,7 +451,7 @@
452452 TCHAR verpath[64];
453453 WORD translation[2];
454454 DWORD cursel;
455 - DRAWITEMSTRUCT* drawitem = (DRAWITEMSTRUCT*)lParam;
 455+ DRAWITEMSTRUCT* drawitem;
456456 BOOL hasname;
457457 void *verinfo;
458458 COLORREF OldTextColor,OldBackColor;
@@ -463,6 +463,8 @@
464464 LPTSTR regpath;
465465 LPTSTR regkey;
466466 BOOL failed;
 467+ RECT r;
 468+ drawitem = (DRAWITEMSTRUCT*)lParam;
467469 switch (Msg)
468470 {
469471 case WM_INITDIALOG:
@@ -516,7 +518,7 @@
517519 ReleaseDC(hGLWnd,dc);
518520 DestroyWindow(hGLWnd);
519521 // Load global settings.
520 - // scaler
 522+/* // scaler
521523 _tcscpy(buffer,_T("Change desktop resolution"));
522524 SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,0,(LPARAM)buffer);
523525 _tcscpy(buffer,_T("Stretch to screen"));
@@ -711,7 +713,7 @@
712714 SendDlgItemMessage(hWnd,IDC_DPISCALE,CB_ADDSTRING,1,(LPARAM)buffer);
713715 _tcscpy(buffer, _T("Windows AppCompat"));
714716 SendDlgItemMessage(hWnd,IDC_DPISCALE,CB_ADDSTRING,2,(LPARAM)buffer);
715 - SendDlgItemMessage(hWnd,IDC_DPISCALE,CB_SETCURSEL,cfg->DPIScale,0);
 717+ SendDlgItemMessage(hWnd,IDC_DPISCALE,CB_SETCURSEL,cfg->DPIScale,0);*/
716718 // Add installed programs
717719 current_app = 1;
718720 appcount = 1;
@@ -831,10 +833,14 @@
832834 free(keyname);
833835 for(i = 0; i < appcount; i++)
834836 {
835 - SendDlgItemMessage(hWnd,IDC_APPS,LB_ADDSTRING,0,(LPARAM)apps[i].name);
 837+ SendDlgItemMessage(hWnd,IDC_APPS,CB_ADDSTRING,0,(LPARAM)apps[i].name);
836838 }
837839 current_app = 0;
838 - SendDlgItemMessage(hWnd,IDC_APPS,LB_SETCURSEL,0,0);
 840+ SendDlgItemMessage(hWnd,IDC_APPS,CB_SETCURSEL,0,0);
 841+ GetWindowRect(GetDlgItem(hWnd, IDC_APPS), &r);
 842+ SetWindowPos(GetDlgItem(hWnd, IDC_APPS), HWND_TOP, r.left, r.top, r.right - r.left,
 843+ (r.bottom - r.top) + (16 * (GetSystemMetrics(SM_CYSMICON) + 1)+(2*GetSystemMetrics(SM_CYBORDER))),
 844+ SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
839845 if(osver.dwMajorVersion >= 6)
840846 {
841847 if(OpenProcessToken(GetCurrentProcess(),TOKEN_QUERY,&token))
@@ -851,7 +857,7 @@
852858 }
853859 else
854860 {
855 - EnableWindow(GetDlgItem(hWnd, IDC_DPISCALE), FALSE);
 861+ //EnableWindow(GetDlgItem(hWnd, IDC_DPISCALE), FALSE);
856862 }
857863 if(token) CloseHandle(token);
858864 return TRUE;
@@ -932,7 +938,7 @@
933939 else EnableWindow(GetDlgItem(hWnd,IDC_REMOVE),TRUE);
934940 }
935941 else EnableWindow(GetDlgItem(hWnd,IDC_REMOVE),FALSE);
936 - // Set 3-state status
 942+/* // Set 3-state status
937943 if(current_app && !tristate)
938944 {
939945 tristate = TRUE;
@@ -1002,9 +1008,10 @@
10031009 SetCheck(hWnd,IDC_EXTRAMODES,cfg->ExtraModes,cfgmask->ExtraModes,tristate);
10041010 SetText(hWnd,IDC_SHADER,cfg->shaderfile,cfgmask->shaderfile,tristate);
10051011 SetCombo(hWnd, IDC_DPISCALE, cfg->DPIScale, cfgmask->DPIScale, tristate);
1006 - SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
 1012+ SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);*/
10071013 }
1008 - case IDC_VIDMODE:
 1014+ break;
 1015+/* case IDC_VIDMODE:
10091016 cfg->scaler = GetCombo(hWnd,IDC_VIDMODE,&cfgmask->scaler);
10101017 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
10111018 *dirty = TRUE;
@@ -1101,7 +1108,7 @@
11021109 EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
11031110 *dirty = TRUE;
11041111 }
1105 - break;
 1112+ break;*/
11061113 case IDC_ADD:
11071114 selectedfile[0] = 0;
11081115 ZeroMemory(&filename,OPENFILENAME_SIZE_VERSION_400);
Index: dxglcfg2/dxglcfg2.rc
@@ -28,55 +28,35 @@
2929 // Dialog resources
3030 //
3131 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
32 -IDD_DXGLCFG DIALOG 0, 0, 405, 265
 32+IDD_DXGLCFG DIALOG 0, 0, 405, 250
3333 STYLE DS_3DLOOK | DS_CONTEXTHELP | DS_SETFONT | WS_CAPTION | WS_SYSMENU
34 -CAPTION "DXGL Config"
 34+CAPTION "DXGL Config (Experimental)"
3535 FONT 8, "Ms Shell Dlg 2"
3636 {
37 - DEFPUSHBUTTON "OK", IDOK, 247, 247, 50, 14
38 - PUSHBUTTON "Cancel", IDCANCEL, 299, 247, 50, 14
39 - LTEXT "", IDC_STATIC, 4, 244, 397, 1, SS_LEFT | SS_SUNKEN
40 - PUSHBUTTON "&Apply", IDC_APPLY, 351, 247, 50, 14, WS_DISABLED
41 - LISTBOX IDC_APPS, 4, 14, 181, 212, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT | LBS_OWNERDRAWFIXED | LBS_NOTIFY
42 - LTEXT "Applications", IDC_STATIC, 4, 4, 39, 8, SS_LEFT
43 - PUSHBUTTON "A&dd...", IDC_ADD, 4, 228, 90, 14
44 - PUSHBUTTON "&Remove", IDC_REMOVE, 96, 228, 90, 14, WS_DISABLED
45 - GROUPBOX "Graphics", IDC_STATIC, 190, 4, 211, 238
46 - LTEXT "Video mode", IDC_STATIC, 195, 14, 38, 8, SS_LEFT
47 - COMBOBOX IDC_VIDMODE, 195, 24, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
48 - AUTOCHECKBOX "Change display color depth", IDC_COLOR, 299, 14, 100, 10
49 - LTEXT "Scaling method", IDC_STATIC, 195, 69, 49, 8, SS_LEFT
50 - 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
53 - LTEXT "Post-processing shader", IDC_STATIC, 195, 94, 90, 8, SS_LEFT
54 - EDITTEXT IDC_SHADER, 195, 104, 183, 14, ES_AUTOHSCROLL
55 - PUSHBUTTON "...", IDC_BROWSESHADER, 379, 104, 20, 14
56 - LTEXT "Screen aspect ratio", IDC_STATIC, 195, 120, 63, 8, SS_LEFT
57 - LTEXT "DPI scaling mode", IDC_STATIC, 299, 120, 55, 8, SS_LEFT
58 - COMBOBOX IDC_ASPECT, 195, 130, 102, 30, CBS_DROPDOWN | CBS_HASSTRINGS
59 - COMBOBOX IDC_DPISCALE, 299, 130, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
60 - LTEXT "Texture filter", IDC_STATIC, 195, 145, 43, 8, SS_LEFT
61 - COMBOBOX IDC_TEXFILTER, 195, 155, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
62 - LTEXT "Anisotropic filtering", IDC_STATIC, 299, 145, 62, 8, SS_LEFT
63 - COMBOBOX IDC_ANISO, 299, 155, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
64 - LTEXT "Antialiasing (MSAA)", IDC_STATIC, 195, 170, 63, 8, SS_LEFT
65 - COMBOBOX IDC_MSAA, 195, 180, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
66 - LTEXT "Renderer aspect ratio", IDC_STATIC, 299, 170, 71, 8, SS_LEFT
67 - COMBOBOX IDC_ASPECT3D, 299, 180, 100, 14, CBS_DROPDOWNLIST | CBS_HASSTRINGS
68 - AUTOCHECKBOX "Adjust primary resolution", IDC_HIGHRES, 299, 28, 96, 8
69 - AUTOCHECKBOX "Support all color depths", IDC_UNCOMMONCOLOR, 299, 55, 91, 8
70 - AUTOCHECKBOX "Add extra display modes", IDC_EXTRAMODES, 299, 42, 95, 8
71 - LTEXT "Sort video modes", IDC_STATIC, 195, 39, 56, 8, SS_LEFT
72 - COMBOBOX IDC_SORTMODES, 195, 49, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
73 - LTEXT "Texture format", IDC_STATIC, 195, 195, 50, 8, SS_LEFT
74 - COMBOBOX IDC_TEXTUREFORMAT, 195, 205, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
75 - LTEXT "Texture access method", IDC_STATIC, 299, 195, 76, 8, SS_LEFT
76 - COMBOBOX IDC_TEXUPLOAD, 299, 205, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
 37+ CONTROL "", IDC_TABS, WC_TABCONTROL, 0, 7, 35, 391, 192, WS_EX_LEFT
 38+ DEFPUSHBUTTON "OK", IDOK, 244, 229, 50, 14, 0, WS_EX_LEFT
 39+ PUSHBUTTON "Cancel", IDCANCEL, 296, 229, 50, 14, 0, WS_EX_LEFT
 40+ PUSHBUTTON "&Apply", IDC_APPLY, 348, 229, 50, 14, WS_DISABLED, WS_EX_LEFT
 41+ COMBOBOX IDC_APPS, 7, 17, 207, 195, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_NOINTEGRALHEIGHT | CBS_OWNERDRAWFIXED, WS_EX_LEFT
 42+ LTEXT "Application profile", IDC_STATIC, 7, 7, 58, 8, SS_LEFT, WS_EX_LEFT
 43+ PUSHBUTTON "A&dd...", IDC_ADD, 216, 17, 90, 14, 0, WS_EX_LEFT
 44+ PUSHBUTTON "&Remove", IDC_REMOVE, 308, 17, 90, 14, WS_DISABLED, WS_EX_LEFT
7745 }
7846
7947
8048
 49+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 50+IDD_LOADING DIALOG 0, 0, 246, 41
 51+STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_POPUP | WS_SYSMENU
 52+EXSTYLE WS_EX_WINDOWEDGE
 53+FONT 8, "Ms Shell Dlg"
 54+{
 55+ LTEXT "Loading profiles...", 0, 95, 10, 56, 8, SS_LEFT, WS_EX_LEFT
 56+ CONTROL "", 0, PROGRESS_CLASS, 0, 7, 20, 232, 14, WS_EX_LEFT
 57+}
 58+
 59+
 60+
8161 //
8262 // Icon resources
8363 //
Index: dxglcfg2/resource.h
@@ -23,25 +23,9 @@
2424 #define IDI_DXGL 107
2525 #define IDI_DXGLSM 109
2626 #define IDI_STAR 111
27 -#define IDC_ASPECT3D 1000
28 -#define IDC_HIGHRES 1002
29 -#define IDC_SORTMODES 1003
30 -#define IDC_UNCOMMONCOLOR 1004
31 -#define IDC_APPLY 1015
32 -#define IDC_APPS 1037
33 -#define IDC_ADD 1038
34 -#define IDC_REMOVE 1039
35 -#define IDC_VIDMODE 1041
36 -#define IDC_SCALE 1042
37 -#define IDC_VSYNC 1043
38 -#define IDC_SHADER 1044
39 -#define IDC_BROWSESHADER 1045
40 -#define IDC_TEXFILTER 1046
41 -#define IDC_ANISO 1047
42 -#define IDC_MSAA 1048
43 -#define IDC_COLOR 1049
44 -#define IDC_EXTRAMODES 1055
45 -#define IDC_TEXTUREFORMAT 1058
46 -#define IDC_TEXUPLOAD 1059
47 -#define IDC_ASPECT 1061
48 -#define IDC_DPISCALE 1063
 27+#define IDD_LOADING 113
 28+#define IDC_APPLY 1000
 29+#define IDC_APPS 1001
 30+#define IDC_ADD 1002
 31+#define IDC_REMOVE 1003
 32+#define IDC_TABS 1004
Index: dxglcfg2
Property changes on: dxglcfg2
___________________________________________________________________
Modified: svn:ignore
## -1,2 +1,3 ##
4933 dxglcfg2.vcxproj.user
5034 Release
 35+Debug