Index: cfgmgr/cfgmgr.c |
— | — | @@ -696,7 +696,7 @@ |
697 | 697 | WriteDWORD(hKey, cfg->CustomResolutionY, cfgmask->CustomResolutionY, _T("CustomResolutionY"));
|
698 | 698 | WriteDWORD(hKey, cfg->CustomRefresh, cfgmask->CustomRefresh, _T("CustomRefresh"));
|
699 | 699 | WriteFloat(hKey, cfg->DisplayMultiplierX, cfgmask->DisplayMultiplierX, _T("DisplayMultiplierX"));
|
700 | | - WriteFloat(hKey, cfg->DisplayMultiplierY, cfgmask->DisplayMultiplierX, _T("DisplayMultiplierY"));
|
| 700 | + WriteFloat(hKey, cfg->DisplayMultiplierY, cfgmask->DisplayMultiplierY, _T("DisplayMultiplierY"));
|
701 | 701 | WriteDWORD(hKey,cfg->vsync,cfgmask->vsync,_T("VSync"));
|
702 | 702 | WriteDWORD(hKey,cfg->TextureFormat,cfgmask->TextureFormat,_T("TextureFormat"));
|
703 | 703 | WriteDWORD(hKey,cfg->TexUpload,cfgmask->TexUpload,_T("TexUpload"));
|
Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -537,6 +537,14 @@ |
538 | 538 | SendDlgItemMessage(hWnd,DlgItem,CB_SETCURSEL,value,0);
|
539 | 539 | }
|
540 | 540 |
|
| 541 | +void SetFloat3place(HWND hWnd, int DlgItem, float value, float mask)
|
| 542 | +{
|
| 543 | + TCHAR number[32];
|
| 544 | + if(mask) _sntprintf(number, 31, _T("%.4g"), value);
|
| 545 | + else number[0] = 0;
|
| 546 | + SendDlgItemMessage(hWnd, DlgItem, WM_SETTEXT, 0, (LPARAM)number);
|
| 547 | +}
|
| 548 | +
|
541 | 549 | __inline DWORD EncodePrimaryScale(DWORD scale)
|
542 | 550 | {
|
543 | 551 | switch (scale)
|
— | — | @@ -631,6 +639,30 @@ |
632 | 640 | }
|
633 | 641 | }
|
634 | 642 |
|
| 643 | +float GetFloat(HWND hWnd, int dlgitem, float *mask)
|
| 644 | +{
|
| 645 | + TCHAR buffer[32];
|
| 646 | + SendDlgItemMessage(hWnd, dlgitem, WM_GETTEXT, 32, (LPARAM)buffer);
|
| 647 | + if (buffer[0] == 0)
|
| 648 | + {
|
| 649 | + if (!current_app)
|
| 650 | + {
|
| 651 | + *mask = 1.0f;
|
| 652 | + return 1.0f;
|
| 653 | + }
|
| 654 | + else
|
| 655 | + {
|
| 656 | + *mask = 0.0f;
|
| 657 | + return 0.0f;
|
| 658 | + }
|
| 659 | + }
|
| 660 | + else
|
| 661 | + {
|
| 662 | + *mask = 1.0f;
|
| 663 | + return _ttof(buffer);
|
| 664 | + }
|
| 665 | +}
|
| 666 | +
|
635 | 667 | void GetPostScaleCombo(HWND hWnd, int DlgItem, float *x, float *y, float *maskx, float *masky)
|
636 | 668 | {
|
637 | 669 | TCHAR buffer[32];
|
— | — | @@ -1069,7 +1101,59 @@ |
1070 | 1102 | cfg->scaler = GetCombo(hWnd, IDC_VIDMODE, &cfgmask->scaler);
|
1071 | 1103 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
1072 | 1104 | *dirty = TRUE;
|
| 1105 | + if (cfg->scaler == 8)
|
| 1106 | + {
|
| 1107 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALELABEL), TRUE);
|
| 1108 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALELABELX), TRUE);
|
| 1109 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALELABELY), TRUE);
|
| 1110 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALEX), TRUE);
|
| 1111 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALEY), TRUE);
|
| 1112 | + }
|
| 1113 | + else
|
| 1114 | + {
|
| 1115 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALELABEL), FALSE);
|
| 1116 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALELABELX), FALSE);
|
| 1117 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALELABELY), FALSE);
|
| 1118 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALEX), FALSE);
|
| 1119 | + EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALEY), FALSE);
|
| 1120 | + }
|
| 1121 | + if ((cfg->scaler == 9) || (cfg->scaler == 10))
|
| 1122 | + {
|
| 1123 | + EnableWindow(GetDlgItem(hWnd, IDC_CUSTOMMODELABEL), TRUE);
|
| 1124 | + EnableWindow(GetDlgItem(hWnd, IDC_CUSTOMMODE), TRUE);
|
| 1125 | + EnableWindow(GetDlgItem(hWnd, IDC_SETMODE), TRUE);
|
| 1126 | + }
|
| 1127 | + else
|
| 1128 | + {
|
| 1129 | + EnableWindow(GetDlgItem(hWnd, IDC_CUSTOMMODELABEL), FALSE);
|
| 1130 | + EnableWindow(GetDlgItem(hWnd, IDC_CUSTOMMODE), FALSE);
|
| 1131 | + EnableWindow(GetDlgItem(hWnd, IDC_SETMODE), FALSE);
|
| 1132 | + }
|
1073 | 1133 | break;
|
| 1134 | + case IDC_FIXEDSCALEX:
|
| 1135 | + if (HIWORD(wParam) == EN_CHANGE)
|
| 1136 | + {
|
| 1137 | + cfg->DisplayMultiplierX = GetFloat(hWnd, IDC_FIXEDSCALEX, &cfgmask->DisplayMultiplierX);
|
| 1138 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 1139 | + *dirty = TRUE;
|
| 1140 | + }
|
| 1141 | + if (HIWORD(wParam) == EN_KILLFOCUS)
|
| 1142 | + {
|
| 1143 | + SetFloat3place(hWnd, IDC_FIXEDSCALEX, cfg->DisplayMultiplierX, cfgmask->DisplayMultiplierX);
|
| 1144 | + }
|
| 1145 | + break;
|
| 1146 | + case IDC_FIXEDSCALEY:
|
| 1147 | + if (HIWORD(wParam) == EN_CHANGE)
|
| 1148 | + {
|
| 1149 | + cfg->DisplayMultiplierY = GetFloat(hWnd, IDC_FIXEDSCALEY, &cfgmask->DisplayMultiplierY);
|
| 1150 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 1151 | + *dirty = TRUE;
|
| 1152 | + }
|
| 1153 | + if (HIWORD(wParam) == EN_KILLFOCUS)
|
| 1154 | + {
|
| 1155 | + SetFloat3place(hWnd, IDC_FIXEDSCALEY, cfg->DisplayMultiplierY, cfgmask->DisplayMultiplierY);
|
| 1156 | + }
|
| 1157 | + break;
|
1074 | 1158 | case IDC_SCALE:
|
1075 | 1159 | cfg->scalingfilter = GetCombo(hWnd, IDC_SCALE, &cfgmask->scalingfilter);
|
1076 | 1160 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
— | — | @@ -1799,6 +1883,37 @@ |
1800 | 1884 | _tcscpy(buffer, _T("Custom size, centered"));
|
1801 | 1885 | SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 10, (LPARAM)buffer);
|
1802 | 1886 | SendDlgItemMessage(hTabs[0],IDC_VIDMODE,CB_SETCURSEL,cfg->scaler,0);
|
| 1887 | + if (cfg->scaler == 8)
|
| 1888 | + {
|
| 1889 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABEL), TRUE);
|
| 1890 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELX), TRUE);
|
| 1891 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELY), TRUE);
|
| 1892 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEX), TRUE);
|
| 1893 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEY), TRUE);
|
| 1894 | + }
|
| 1895 | + else
|
| 1896 | + {
|
| 1897 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABEL), FALSE);
|
| 1898 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELX), FALSE);
|
| 1899 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELY), FALSE);
|
| 1900 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEX), FALSE);
|
| 1901 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEY), FALSE);
|
| 1902 | + }
|
| 1903 | + if ((cfg->scaler == 9) || (cfg->scaler == 10))
|
| 1904 | + {
|
| 1905 | + EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODELABEL), TRUE);
|
| 1906 | + EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODE), TRUE);
|
| 1907 | + EnableWindow(GetDlgItem(hTabs[0], IDC_SETMODE), TRUE);
|
| 1908 | + }
|
| 1909 | + else
|
| 1910 | + {
|
| 1911 | + EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODELABEL), FALSE);
|
| 1912 | + EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODE), FALSE);
|
| 1913 | + EnableWindow(GetDlgItem(hTabs[0], IDC_SETMODE), FALSE);
|
| 1914 | + }
|
| 1915 | + // custom scale
|
| 1916 | + SetFloat3place(hTabs[0], IDC_FIXEDSCALEX, cfg->DisplayMultiplierX, cfgmask->DisplayMultiplierX);
|
| 1917 | + SetFloat3place(hTabs[0], IDC_FIXEDSCALEY, cfg->DisplayMultiplierY, cfgmask->DisplayMultiplierY);
|
1803 | 1918 | // fullscreen window mode
|
1804 | 1919 | _tcscpy(buffer, _T("Exclusive fullscreen"));
|
1805 | 1920 | SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
— | — | @@ -2079,6 +2194,8 @@ |
2080 | 2195 | /*_tcscpy(buffer, _T("Disable OpenGL errors (OpenGL 4.6+)"));
|
2081 | 2196 | SendDlgItemMessage(hTabs[4], IDC_DEBUGLIST, LB_ADDSTRING, 0, (LPARAM)buffer);*/
|
2082 | 2197 |
|
| 2198 | + EnableWindow(GetDlgItem(hWnd, IDC_APPLY), FALSE);
|
| 2199 | +
|
2083 | 2200 | // Check install path
|
2084 | 2201 | installpath = NULL;
|
2085 | 2202 | error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\DXGL"), 0, KEY_READ, &hKey);
|
— | — | @@ -2436,6 +2553,36 @@ |
2437 | 2554 | SetCheck(hTabs[0], IDC_COLOR, cfg->colormode, cfgmask->colormode, tristate);
|
2438 | 2555 | SetCheck(hTabs[0], IDC_SINGLEBUFFER, cfg->SingleBufferDevice, cfgmask->SingleBufferDevice, tristate);
|
2439 | 2556 | SetCombo(hTabs[1], IDC_POSTSCALE, cfg->postfilter, cfgmask->postfilter, tristate);
|
| 2557 | + if (cfg->scaler == 8)
|
| 2558 | + {
|
| 2559 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABEL), TRUE);
|
| 2560 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELX), TRUE);
|
| 2561 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELY), TRUE);
|
| 2562 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEX), TRUE);
|
| 2563 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEY), TRUE);
|
| 2564 | + }
|
| 2565 | + else
|
| 2566 | + {
|
| 2567 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABEL), FALSE);
|
| 2568 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELX), FALSE);
|
| 2569 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALELABELY), FALSE);
|
| 2570 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEX), FALSE);
|
| 2571 | + EnableWindow(GetDlgItem(hTabs[0], IDC_FIXEDSCALEY), FALSE);
|
| 2572 | + }
|
| 2573 | + if ((cfg->scaler == 9) || (cfg->scaler == 10))
|
| 2574 | + {
|
| 2575 | + EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODELABEL), TRUE);
|
| 2576 | + EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODE), TRUE);
|
| 2577 | + EnableWindow(GetDlgItem(hTabs[0], IDC_SETMODE), TRUE);
|
| 2578 | + }
|
| 2579 | + else
|
| 2580 | + {
|
| 2581 | + EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODELABEL), FALSE);
|
| 2582 | + EnableWindow(GetDlgItem(hTabs[0], IDC_CUSTOMMODE), FALSE);
|
| 2583 | + EnableWindow(GetDlgItem(hTabs[0], IDC_SETMODE), FALSE);
|
| 2584 | + }
|
| 2585 | + SetFloat3place(hTabs[0], IDC_FIXEDSCALEX, cfg->DisplayMultiplierX, cfgmask->DisplayMultiplierX);
|
| 2586 | + SetFloat3place(hTabs[0], IDC_FIXEDSCALEY, cfg->DisplayMultiplierY, cfgmask->DisplayMultiplierY);
|
2440 | 2587 | SetPostScaleCombo(hTabs[1], IDC_POSTSCALESIZE, cfg->postsizex, cfg->postsizey,
|
2441 | 2588 | cfgmask->postsizex , cfgmask->postsizey, tristate);
|
2442 | 2589 | SetCombo(hTabs[1], IDC_PRIMARYSCALE, cfg->primaryscale, cfgmask->primaryscale, tristate);
|
Index: dxglcfg/dxglcfg.rc |
— | — | @@ -70,14 +70,14 @@ |
71 | 71 | COMBOBOX IDC_VSYNC, 114, 68, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
72 | 72 | LTEXT "Fullscreen window mode", IDC_STATIC, 221, 57, 79, 9, SS_LEFT, WS_EX_LEFT
|
73 | 73 | COMBOBOX IDC_FULLMODE, 221, 68, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
74 | | - LTEXT "Fixed scaling", IDC_FIXEDSCALELABEL, 7, 83, 47, 9, WS_DISABLED | SS_LEFT, WS_EX_LEFT
|
75 | | - LTEXT "X", IDC_FIXEDSCALELABELX, 7, 97, 8, 9, WS_DISABLED | SS_LEFT, WS_EX_LEFT
|
76 | | - EDITTEXT IDC_FIXEDSCALEX, 15, 94, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
|
77 | | - LTEXT "Y", IDC_FIXEDSCALELABELY, 57, 97, 8, 9, WS_DISABLED | SS_LEFT, WS_EX_LEFT
|
78 | | - EDITTEXT IDC_FIXEDSCALEY, 65, 94, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
|
79 | | - LTEXT "Custom resolution", 0, 114, 83, 58, 9, SS_LEFT, WS_EX_LEFT
|
80 | | - EDITTEXT IDC_CUSTOMMODE, 114, 94, 71, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
|
81 | | - PUSHBUTTON "Select", IDC_SETMODE, 187, 94, 29, 14, WS_DISABLED, WS_EX_LEFT
|
| 74 | + LTEXT "Fixed scaling", IDC_FIXEDSCALELABEL, 7, 83, 47, 9, SS_LEFT, WS_EX_LEFT
|
| 75 | + LTEXT "X", IDC_FIXEDSCALELABELX, 7, 97, 8, 9, SS_LEFT, WS_EX_LEFT
|
| 76 | + EDITTEXT IDC_FIXEDSCALEX, 15, 94, 40, 14, ES_AUTOHSCROLL, WS_EX_LEFT
|
| 77 | + LTEXT "Y", IDC_FIXEDSCALELABELY, 57, 97, 8, 9, SS_LEFT, WS_EX_LEFT
|
| 78 | + EDITTEXT IDC_FIXEDSCALEY, 65, 94, 40, 14, ES_AUTOHSCROLL, WS_EX_LEFT
|
| 79 | + LTEXT "Custom resolution", IDC_CUSTOMMODELABEL, 114, 83, 58, 9, SS_LEFT, WS_EX_LEFT
|
| 80 | + EDITTEXT IDC_CUSTOMMODE, 114, 94, 71, 14, ES_AUTOHSCROLL, WS_EX_LEFT
|
| 81 | + PUSHBUTTON "Select", IDC_SETMODE, 187, 94, 29, 14, 0, WS_EX_LEFT
|
82 | 82 | AUTOCHECKBOX "Change display color depth", IDC_COLOR, 7, 113, 100, 10, 0, WS_EX_LEFT
|
83 | 83 | AUTOCHECKBOX "Single buffered display", IDC_SINGLEBUFFER, 114, 114, 87, 8, 0, WS_EX_LEFT
|
84 | 84 | }
|
Index: dxglcfg/resource.h |
— | — | @@ -71,10 +71,11 @@ |
72 | 72 | #define IDC_FIXEDSCALEX 2012
|
73 | 73 | #define IDC_FIXEDSCALELABELY 2013
|
74 | 74 | #define IDC_FIXEDSCALEY 2014
|
75 | | -#define IDC_CUSTOMMODE 2015
|
76 | | -#define IDC_SETMODE 2016
|
77 | | -#define IDC_COLOR 2017
|
78 | | -#define IDC_SINGLEBUFFER 2018
|
| 75 | +#define IDC_CUSTOMMODELABEL 2015
|
| 76 | +#define IDC_CUSTOMMODE 2016
|
| 77 | +#define IDC_SETMODE 2017
|
| 78 | +#define IDC_COLOR 2018
|
| 79 | +#define IDC_SINGLEBUFFER 2019
|
79 | 80 |
|
80 | 81 | // Controls - Effects Tab
|
81 | 82 | #define IDC_POSTSCALE 2101
|