Index: dxgl-example.ini |
— | — | @@ -636,7 +636,10 @@ |
637 | 637 | ; This value is dependent on the color depth of the primary surface, and
|
638 | 638 | ; if using color comparison under 8-bit color uses the the 32-bit color of
|
639 | 639 | ; the pixel's palette lookup, or in value comparison uses the palette index
|
640 | | -; of the pixel.
|
| 640 | +; of the pixel. For 15 and 16 bit modes, value comparison uses the exact
|
| 641 | +; value in this option while color comparison uses the equivalent 24-bit
|
| 642 | +; color value. Color values should be specified as RRGGBB, for instance
|
| 643 | +; red would be 0xFF0000.
|
641 | 644 | ; Default is 0x0
|
642 | 645 | HackAutoExpandViewportValue=0x0
|
643 | 646 |
|
Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -643,6 +643,15 @@ |
644 | 644 | }
|
645 | 645 | }
|
646 | 646 |
|
| 647 | +void SetRGBHex(HWND hWnd, int DlgItem, DWORD value, DWORD mask)
|
| 648 | +{
|
| 649 | + TCHAR number[32];
|
| 650 | + if (mask) _sntprintf(number, 31, _T("%06X"), value);
|
| 651 | + else _tcscpy(number, strdefault);
|
| 652 | + EditInterlock = TRUE;
|
| 653 | + SendDlgItemMessage(hWnd, DlgItem, WM_SETTEXT, 0, (LPARAM)number);
|
| 654 | + EditInterlock = FALSE;
|
| 655 | +}
|
647 | 656 |
|
648 | 657 | void SetFloat3place(HWND hWnd, int DlgItem, float value, float mask)
|
649 | 658 | {
|
— | — | @@ -861,11 +870,35 @@ |
862 | 871 | }
|
863 | 872 | }
|
864 | 873 |
|
| 874 | +DWORD GetRGBHex(HWND hWnd, int dlgitem, DWORD *mask)
|
| 875 | +{
|
| 876 | + TCHAR buffer[32];
|
| 877 | + SendDlgItemMessage(hWnd, dlgitem, WM_GETTEXT, 32, (LPARAM)buffer);
|
| 878 | + if ((buffer[0] == 0) || (!_tcsicmp(buffer, strdefaultshort)) || (!_tcsicmp(buffer, strdefault)))
|
| 879 | + {
|
| 880 | + if (!current_app)
|
| 881 | + {
|
| 882 | + *mask = 1;
|
| 883 | + return 1;
|
| 884 | + }
|
| 885 | + else
|
| 886 | + {
|
| 887 | + *mask = 0;
|
| 888 | + return 0;
|
| 889 | + }
|
| 890 | + }
|
| 891 | + else
|
| 892 | + {
|
| 893 | + *mask = 1;
|
| 894 | + return _tcstol(buffer, NULL, 16) & 0xFFFFFF;
|
| 895 | + }
|
| 896 | +}
|
| 897 | +
|
865 | 898 | float GetFloat(HWND hWnd, int dlgitem, float *mask)
|
866 | 899 | {
|
867 | 900 | TCHAR buffer[32];
|
868 | 901 | SendDlgItemMessage(hWnd, dlgitem, WM_GETTEXT, 32, (LPARAM)buffer);
|
869 | | - if (buffer[0] == 0)
|
| 902 | + if ((buffer[0] == 0) || (!_tcsicmp(buffer, strdefaultshort)) || (!_tcsicmp(buffer, strdefault)))
|
870 | 903 | {
|
871 | 904 | if (!current_app)
|
872 | 905 | {
|
— | — | @@ -889,7 +922,7 @@ |
890 | 923 | {
|
891 | 924 | TCHAR buffer[32];
|
892 | 925 | SendDlgItemMessage(hWnd, dlgitem, WM_GETTEXT, 32, (LPARAM)buffer);
|
893 | | - if (buffer[0] == 0)
|
| 926 | + if ((buffer[0] == 0) || (!_tcsicmp(buffer, strdefaultshort)) || (!_tcsicmp(buffer, strdefault)))
|
894 | 927 | {
|
895 | 928 | if (!usemask)
|
896 | 929 | {
|
— | — | @@ -2382,7 +2415,6 @@ |
2383 | 2416 |
|
2384 | 2417 | void UpdateHacksControl(HWND hWnd, int DlgItem, int item)
|
2385 | 2418 | {
|
2386 | | - TCHAR buffer[64];
|
2387 | 2419 | switch (item)
|
2388 | 2420 | {
|
2389 | 2421 | case 0:
|
— | — | @@ -2435,6 +2467,7 @@ |
2436 | 2468 | void DrawHacksItemText(HDC hdc, RECT *r, int item)
|
2437 | 2469 | {
|
2438 | 2470 | LPCTSTR str = strUnknown;
|
| 2471 | + TCHAR buffer[33];
|
2439 | 2472 | switch (item)
|
2440 | 2473 | {
|
2441 | 2474 | case 0:
|
— | — | @@ -2462,6 +2495,14 @@ |
2463 | 2496 | else str = strViewportCompare[cfg->HackAutoExpandViewportCompare];
|
2464 | 2497 | }
|
2465 | 2498 | break;
|
| 2499 | + case 3:
|
| 2500 | + if (!cfgmask->HackAutoExpandViewportValue) str = strdefault;
|
| 2501 | + else
|
| 2502 | + {
|
| 2503 | + _sntprintf(buffer, 32, _T("%06X"), cfg->HackAutoExpandViewportValue);
|
| 2504 | + str = buffer;
|
| 2505 | + }
|
| 2506 | + break;
|
2466 | 2507 | case 4:
|
2467 | 2508 | if (!cfgmask->HackNoTVRefresh) str = strdefault;
|
2468 | 2509 | else
|
— | — | @@ -2517,6 +2558,21 @@ |
2518 | 2559 | case WM_COMMAND:
|
2519 | 2560 | switch (LOWORD(wParam))
|
2520 | 2561 | {
|
| 2562 | + case IDC_HACKSEDIT:
|
| 2563 | + if (HIWORD(wParam) == EN_CHANGE)
|
| 2564 | + {
|
| 2565 | + if (!EditInterlock)
|
| 2566 | + {
|
| 2567 | + cfg->HackAutoExpandViewportValue = GetRGBHex(GetDlgItem(hWnd,IDC_HACKSLIST), IDC_HACKSEDIT, &cfgmask->HackAutoExpandViewportValue);
|
| 2568 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 2569 | + *dirty = TRUE;
|
| 2570 | + }
|
| 2571 | + }
|
| 2572 | + if (HIWORD(wParam) == EN_KILLFOCUS)
|
| 2573 | + {
|
| 2574 | + SetRGBHex(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSEDIT, cfg->HackAutoExpandViewportValue, cfgmask->HackAutoExpandViewportValue);
|
| 2575 | + }
|
| 2576 | + break;
|
2521 | 2577 | case IDC_HACKSDROPDOWN:
|
2522 | 2578 | switch (hackstabitem)
|
2523 | 2579 | {
|
— | — | @@ -3408,6 +3464,8 @@ |
3409 | 3465 | SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
3410 | 3466 | _tcscpy(buffer, _T("SetCursor hide visibility"));
|
3411 | 3467 | SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
| 3468 | + // Auto expand viewport hack value
|
| 3469 | + SetRGBHex(GetDlgItem(hTabs[5], IDC_HACKSLIST), IDC_HACKSEDIT, cfg->HackAutoExpandViewportValue, cfgmask->HackAutoExpandViewportValue);
|
3412 | 3470 | // About text
|
3413 | 3471 | _tcscpy(abouttext, _T("DXGL\r\nVersion "));
|
3414 | 3472 | _tcscat(abouttext, _T(DXGLVERSTRING));
|
— | — | @@ -3910,6 +3968,7 @@ |
3911 | 3969 | &cfgmask->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMinor, tristate, hWnd);
|
3912 | 3970 | // Hacks tab
|
3913 | 3971 | UpdateHacksControl(GetDlgItem(hTabs[5], IDC_HACKSLIST), IDC_HACKSDROPDOWN, hackstabitem);
|
| 3972 | + SetRGBHex(GetDlgItem(hTabs[5], IDC_HACKSLIST), IDC_HACKSEDIT, cfg->HackAutoExpandViewportValue, cfgmask->HackAutoExpandViewportValue);
|
3914 | 3973 | RedrawWindow(GetDlgItem(hTabs[5], IDC_HACKSLIST), NULL, NULL, RDW_INVALIDATE);
|
3915 | 3974 | }
|
3916 | 3975 | break;
|