Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -95,6 +95,7 @@ |
96 | 96 | HWND hTab;
|
97 | 97 | HWND hTabs[8];
|
98 | 98 | static int tabopen;
|
| 99 | +BOOL modelistdirty = FALSE;
|
99 | 100 |
|
100 | 101 | static const TCHAR *colormodes[32] = {
|
101 | 102 | _T("None"),
|
— | — | @@ -1562,6 +1563,7 @@ |
1563 | 1564 | }
|
1564 | 1565 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
1565 | 1566 | *dirty = TRUE;
|
| 1567 | + modelistdirty = TRUE;
|
1566 | 1568 | }
|
1567 | 1569 | }
|
1568 | 1570 | if (HIWORD(wParam) == CBN_DROPDOWN)
|
— | — | @@ -1593,6 +1595,7 @@ |
1594 | 1596 | }
|
1595 | 1597 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
1596 | 1598 | *dirty = TRUE;
|
| 1599 | + modelistdirty = TRUE;
|
1597 | 1600 | }
|
1598 | 1601 | }
|
1599 | 1602 | if (HIWORD(wParam) == CBN_DROPDOWN)
|
— | — | @@ -1608,6 +1611,7 @@ |
1609 | 1612 | cfg->scaler = GetCombo(hWnd, IDC_VIDMODE, &cfgmask->scaler);
|
1610 | 1613 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
1611 | 1614 | *dirty = TRUE;
|
| 1615 | + modelistdirty = TRUE;
|
1612 | 1616 | if (cfg->scaler == 8)
|
1613 | 1617 | {
|
1614 | 1618 | EnableWindow(GetDlgItem(hWnd, IDC_FIXEDSCALELABEL), TRUE);
|
— | — | @@ -1711,6 +1715,7 @@ |
1712 | 1716 | cfg->SortModes = GetCombo(hWnd, IDC_SORTMODES, &cfgmask->SortModes);
|
1713 | 1717 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
1714 | 1718 | *dirty = TRUE;
|
| 1719 | + modelistdirty = TRUE;
|
1715 | 1720 | break;
|
1716 | 1721 | case IDC_DPISCALE:
|
1717 | 1722 | cfg->DPIScale = GetCombo(hWnd, IDC_DPISCALE, &cfgmask->DPIScale);
|
— | — | @@ -1771,6 +1776,7 @@ |
1772 | 1777 | cfgmask->postsizex, cfgmask->postsizey, tristate);
|
1773 | 1778 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
1774 | 1779 | *dirty = TRUE;
|
| 1780 | + modelistdirty = TRUE;
|
1775 | 1781 | }
|
1776 | 1782 | else if (HIWORD(wParam) == CBN_SELCHANGE)
|
1777 | 1783 | {
|
— | — | @@ -1778,6 +1784,7 @@ |
1779 | 1785 | &cfgmask->postsizex, &cfgmask->postsizey);
|
1780 | 1786 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
1781 | 1787 | *dirty = TRUE;
|
| 1788 | + modelistdirty = TRUE;
|
1782 | 1789 | }
|
1783 | 1790 | break;
|
1784 | 1791 | case IDC_PRIMARYSCALE:
|
— | — | @@ -2375,6 +2382,7 @@ |
2376 | 2383 | RedrawWindow(GetDlgItem(hWnd, IDC_HACKSLIST), NULL, NULL, RDW_INVALIDATE);
|
2377 | 2384 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
2378 | 2385 | *dirty = TRUE;
|
| 2386 | + if(item == 2) modelistdirty = TRUE;
|
2379 | 2387 | }
|
2380 | 2388 | break;
|
2381 | 2389 | default:
|
— | — | @@ -3349,6 +3357,7 @@ |
3350 | 3358 | return TRUE;
|
3351 | 3359 | case IDC_APPLY:
|
3352 | 3360 | SaveChanges(hWnd);
|
| 3361 | + if(modelistdirty) ResetModeList(hTabs[6]);
|
3353 | 3362 | return TRUE;
|
3354 | 3363 | case IDC_APPS:
|
3355 | 3364 | if(HIWORD(wParam) == CBN_SELCHANGE)
|
Index: dxglcfg/dxgltest.cpp |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | static HINSTANCE hinstance;
|
25 | 25 | bool gradientavailable;
|
26 | 26 | BOOL (WINAPI *_GradientFill)(HDC hdc, TRIVERTEX* pVertices, ULONG nVertices, void* pMesh, ULONG nMeshElements, DWORD dwMode) = NULL;
|
| 27 | +extern BOOL modelistdirty;
|
27 | 28 |
|
28 | 29 | void GetFileVersion(tstring &version, LPCTSTR filename)
|
29 | 30 | {
|
— | — | @@ -242,6 +243,20 @@ |
243 | 244 |
|
244 | 245 | TCHAR tmpstring[33];
|
245 | 246 |
|
| 247 | +void ResetModeList(HWND hWnd)
|
| 248 | +{
|
| 249 | + LPDIRECTDRAW lpdd;
|
| 250 | + HRESULT error;
|
| 251 | + SendDlgItemMessage(hWnd, IDC_VIDMODES, LB_RESETCONTENT, 0, 0);
|
| 252 | + error = DirectDrawCreate(NULL, &lpdd, NULL);
|
| 253 | + if (error == DD_OK)
|
| 254 | + {
|
| 255 | + error = lpdd->EnumDisplayModes(DDEDM_REFRESHRATES, NULL, GetDlgItem(hWnd, IDC_VIDMODES), EnumModesCallback8);
|
| 256 | + IDirectDraw_Release(lpdd);
|
| 257 | + }
|
| 258 | + SendDlgItemMessage(hWnd, IDC_VIDMODES, LB_SETCURSEL, modenum, 0);
|
| 259 | +}
|
| 260 | +
|
246 | 261 | INT_PTR CALLBACK TestTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
247 | 262 | {
|
248 | 263 | int i;
|
— | — | @@ -261,7 +276,7 @@ |
262 | 277 | if(error == DD_OK)
|
263 | 278 | {
|
264 | 279 | error = lpdd->EnumDisplayModes(DDEDM_REFRESHRATES,NULL,GetDlgItem(hWnd,IDC_VIDMODES),EnumModesCallback8);
|
265 | | - lpdd->Release();
|
| 280 | + IDirectDraw_Release(lpdd);
|
266 | 281 | }
|
267 | 282 | SendDlgItemMessage(hWnd,IDC_VIDMODES,LB_SETCURSEL,modenum,0);
|
268 | 283 | break;
|
— | — | @@ -335,6 +350,7 @@ |
336 | 351 | Do you want to apply them before running this test?"),
|
337 | 352 | _T("Notice"), MB_YESNO | MB_ICONQUESTION) == IDYES)
|
338 | 353 | SaveChanges(hDialog);
|
| 354 | + if (modelistdirty) ResetModeList(hWnd);
|
339 | 355 | }
|
340 | 356 | if (SendDlgItemMessage(hWnd, IDC_RESIZABLE, BM_GETCHECK, 0, 0)) resizable = true;
|
341 | 357 | else resizable = false;
|
Index: dxglcfg/dxgltest.h |
— | — | @@ -19,5 +19,6 @@ |
20 | 20 |
|
21 | 21 | #include "resource.h"
|
22 | 22 |
|
| 23 | +void ResetModeList(HWND hWnd);
|
23 | 24 | INT_PTR CALLBACK TestTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
24 | 25 | INT_PTR CALLBACK AboutTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|