Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -549,6 +549,16 @@ |
550 | 550 | EditInterlock = FALSE;
|
551 | 551 | }
|
552 | 552 |
|
| 553 | +void SetInteger(HWND hWnd, int DlgItem, int value, int mask)
|
| 554 | +{
|
| 555 | + TCHAR number[32];
|
| 556 | + if (mask) _itot(value, number, 10);
|
| 557 | + else number[0] = 0;
|
| 558 | + EditInterlock = TRUE;
|
| 559 | + SendDlgItemMessage(hWnd, DlgItem, WM_SETTEXT, 0, (LPARAM)number);
|
| 560 | + EditInterlock = FALSE;
|
| 561 | +}
|
| 562 | +
|
553 | 563 | void SetResolution(HWND hWnd, int DlgItem, const DXGLCFG *cfg, const DXGLCFG *cfgmask)
|
554 | 564 | {
|
555 | 565 | TCHAR output[104];
|
— | — | @@ -692,6 +702,30 @@ |
693 | 703 | }
|
694 | 704 | }
|
695 | 705 |
|
| 706 | +int GetInteger(HWND hWnd, int dlgitem, int *mask, int defaultnum)
|
| 707 | +{
|
| 708 | + TCHAR buffer[32];
|
| 709 | + SendDlgItemMessage(hWnd, dlgitem, WM_GETTEXT, 32, (LPARAM)buffer);
|
| 710 | + if (buffer[0] == 0)
|
| 711 | + {
|
| 712 | + if (!current_app)
|
| 713 | + {
|
| 714 | + *mask = 1;
|
| 715 | + return defaultnum;
|
| 716 | + }
|
| 717 | + else
|
| 718 | + {
|
| 719 | + *mask = 0;
|
| 720 | + return defaultnum;
|
| 721 | + }
|
| 722 | + }
|
| 723 | + else
|
| 724 | + {
|
| 725 | + *mask = 1;
|
| 726 | + return _ttoi(buffer);
|
| 727 | + }
|
| 728 | +}
|
| 729 | +
|
696 | 730 | void ProcessResolutionString(LPTSTR input)
|
697 | 731 | {
|
698 | 732 | DWORD x, y, refresh;
|
— | — | @@ -1618,6 +1652,23 @@ |
1619 | 1653 | SetFloat3place(hWnd, IDC_CUSTOMSCALEY, cfg->primaryscaley, cfgmask->primaryscaley);
|
1620 | 1654 | }
|
1621 | 1655 | break;
|
| 1656 | + case IDC_BLTTHRESHOLD:
|
| 1657 | + if (HIWORD(wParam) == EN_CHANGE)
|
| 1658 | + {
|
| 1659 | + if (!EditInterlock)
|
| 1660 | + {
|
| 1661 | + cfg->BltThreshold = GetInteger(hWnd, IDC_BLTTHRESHOLD, (int*)&cfgmask->BltThreshold, 127);
|
| 1662 | + if (cfg->BltThreshold > 255) cfg->BltThreshold = 255;
|
| 1663 | + SendDlgItemMessage(hWnd, IDC_BLTTHRESHOLDSLIDER, TBM_SETPOS, TRUE, cfg->BltThreshold);
|
| 1664 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 1665 | + *dirty = TRUE;
|
| 1666 | + }
|
| 1667 | + }
|
| 1668 | + if (HIWORD(wParam) == EN_KILLFOCUS)
|
| 1669 | + {
|
| 1670 | + SetInteger(hWnd, IDC_BLTTHRESHOLD, cfg->BltThreshold, cfgmask->BltThreshold);
|
| 1671 | + }
|
| 1672 | + break;
|
1622 | 1673 | case IDC_SHADER:
|
1623 | 1674 | if (HIWORD(wParam) == EN_CHANGE)
|
1624 | 1675 | {
|
— | — | @@ -1634,6 +1685,28 @@ |
1635 | 1686 | default:
|
1636 | 1687 | break;
|
1637 | 1688 | }
|
| 1689 | + case WM_HSCROLL:
|
| 1690 | + switch (LOWORD(wParam))
|
| 1691 | + {
|
| 1692 | + case TB_ENDTRACK:
|
| 1693 | + case TB_THUMBTRACK:
|
| 1694 | + case TB_THUMBPOSITION:
|
| 1695 | + case TB_BOTTOM:
|
| 1696 | + case TB_TOP:
|
| 1697 | + case TB_LINEDOWN:
|
| 1698 | + case TB_LINEUP:
|
| 1699 | + case TB_PAGEDOWN:
|
| 1700 | + case TB_PAGEUP:
|
| 1701 | + cfgmask->BltThreshold = 1;
|
| 1702 | + cfg->BltThreshold = SendDlgItemMessage(hWnd, IDC_BLTTHRESHOLDSLIDER, TBM_GETPOS, 0, 0);
|
| 1703 | + SetInteger(hWnd, IDC_BLTTHRESHOLD, cfg->BltThreshold, cfgmask->BltThreshold);
|
| 1704 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 1705 | + *dirty = TRUE;
|
| 1706 | + break;
|
| 1707 | + default:
|
| 1708 | + break;
|
| 1709 | + }
|
| 1710 | + break;
|
1638 | 1711 | default:
|
1639 | 1712 | return FALSE;
|
1640 | 1713 | }
|
— | — | @@ -2412,6 +2485,8 @@ |
2413 | 2486 | // Blt scaling threshold
|
2414 | 2487 | SendDlgItemMessage(hTabs[1], IDC_BLTTHRESHOLDSLIDER, TBM_SETRANGE, 0, 0xFE0000);
|
2415 | 2488 | SendDlgItemMessage(hTabs[1], IDC_BLTTHRESHOLDSLIDER, TBM_SETPOS, TRUE, cfg->BltThreshold);
|
| 2489 | + SendDlgItemMessage(hTabs[1], IDC_BLTTHRESHOLD, EM_SETLIMITTEXT, 3, 0);
|
| 2490 | + SetInteger(hTabs[1], IDC_BLTTHRESHOLD, cfg->BltThreshold, cfgmask->BltThreshold);
|
2416 | 2491 | // aspect
|
2417 | 2492 | _tcscpy(buffer,_T("Default"));
|
2418 | 2493 | SendDlgItemMessage(hTabs[0], IDC_ASPECT, CB_ADDSTRING, 0, (LPARAM)buffer);
|
— | — | @@ -3045,6 +3120,7 @@ |
3046 | 3121 | SetFloat3place(hTabs[0], IDC_FIXEDSCALEX, cfg->DisplayMultiplierX, cfgmask->DisplayMultiplierX);
|
3047 | 3122 | SetFloat3place(hTabs[0], IDC_FIXEDSCALEY, cfg->DisplayMultiplierY, cfgmask->DisplayMultiplierY);
|
3048 | 3123 | SetResolution(hTabs[0], IDC_CUSTOMMODE, cfg, cfgmask);
|
| 3124 | + // Effects tab
|
3049 | 3125 | SetCombo(hTabs[1], IDC_POSTSCALE, cfg->postfilter, cfgmask->postfilter, tristate);
|
3050 | 3126 | SetPostScaleCombo(hTabs[1], IDC_POSTSCALESIZE, cfg->postsizex, cfg->postsizey,
|
3051 | 3127 | cfgmask->postsizex , cfgmask->postsizey, tristate);
|
— | — | @@ -3069,6 +3145,13 @@ |
3070 | 3146 | SetFloat3place(hTabs[1], IDC_CUSTOMSCALEY, cfg->primaryscaley, cfgmask->primaryscaley);
|
3071 | 3147 | SetText(hTabs[1], IDC_SHADER, cfg->shaderfile, cfgmask->shaderfile, tristate);
|
3072 | 3148 | SetCombo(hTabs[1], IDC_BLTFILTER, cfg->BltScale, cfgmask->BltScale, tristate);
|
| 3149 | + SetInteger(hTabs[1], IDC_BLTTHRESHOLD, cfg->BltThreshold, cfgmask->BltThreshold);
|
| 3150 | + if (cfgmask->BltThreshold)
|
| 3151 | + {
|
| 3152 | + SendDlgItemMessage(hTabs[1], IDC_BLTTHRESHOLDSLIDER, TBM_SETPOS, TRUE, cfg->BltThreshold);
|
| 3153 | + }
|
| 3154 | + else SendDlgItemMessage(hTabs[1], IDC_BLTTHRESHOLDSLIDER, TBM_SETPOS, TRUE, 127);
|
| 3155 | + // 3D tab
|
3073 | 3156 | SetCombo(hTabs[2], IDC_TEXFILTER, cfg->texfilter, cfgmask->texfilter, tristate);
|
3074 | 3157 | SetCombo(hTabs[2], IDC_ANISO, cfg->anisotropic, cfgmask->anisotropic, tristate);
|
3075 | 3158 | SetCombo(hTabs[2], IDC_MSAA, cfg->msaa, cfgmask->msaa, tristate);
|
— | — | @@ -3075,9 +3158,13 @@ |
3076 | 3159 | SetCombo(hTabs[2], IDC_ASPECT3D, cfg->aspect3d, cfgmask->aspect3d, tristate);
|
3077 | 3160 | SetCombo(hTabs[2], IDC_LOWCOLORRENDER, cfg->LowColorRendering, cfgmask->LowColorRendering, tristate);
|
3078 | 3161 | SetCombo(hTabs[2], IDC_DITHERING, cfg->EnableDithering, cfgmask->EnableDithering, tristate);
|
| 3162 | + // Advanced tab
|
3079 | 3163 | SetCombo(hTabs[3],IDC_TEXTUREFORMAT,cfg->TextureFormat,cfgmask->TextureFormat,tristate);
|
3080 | 3164 | SetCombo(hTabs[3],IDC_TEXUPLOAD,cfg->TexUpload,cfgmask->TexUpload,tristate);
|
| 3165 | + // Debug tab
|
3081 | 3166 | RedrawWindow(GetDlgItem(hTabs[4], IDC_DEBUGLIST), NULL, NULL, RDW_INVALIDATE);
|
| 3167 | + // Hacks tab
|
| 3168 | + RedrawWindow(GetDlgItem(hTabs[5], IDC_HACKSLIST), NULL, NULL, RDW_INVALIDATE);
|
3082 | 3169 | }
|
3083 | 3170 | break;
|
3084 | 3171 | case IDC_ADD:
|
Index: dxglcfg/dxglcfg.rc |
— | — | @@ -220,7 +220,7 @@ |
221 | 221 | LTEXT "Y", IDC_CUSTOMSCALELABELY, 57, 97, 8, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
|
222 | 222 | EDITTEXT IDC_CUSTOMSCALEY, 65, 94, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
|
223 | 223 | CONTROL "", IDC_BLTTHRESHOLDSLIDER, TRACKBAR_CLASS, WS_TABSTOP | TBS_BOTH | TBS_NOTICKS, 114, 93, 79, 15, WS_EX_LEFT
|
224 | | - EDITTEXT IDC_BLTTHRESHOLD, 195, 94, 21, 14, ES_AUTOHSCROLL, WS_EX_LEFT
|
| 224 | + EDITTEXT IDC_BLTTHRESHOLD, 195, 94, 21, 14, ES_AUTOHSCROLL | ES_NUMBER, WS_EX_LEFT
|
225 | 225 | }
|
226 | 226 |
|
227 | 227 |
|
Index: dxglcfg/dxgltest.cpp |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | // DXGL
|
3 | | -// Copyright (C) 2011-2013 William Feely
|
| 3 | +// Copyright (C) 2011-2017 William Feely
|
4 | 4 |
|
5 | 5 | // This library is free software; you can redistribute it and/or
|
6 | 6 | // modify it under the terms of the GNU Lesser General Public
|