Index: cfgmgr/cfgmgr.c |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | #include "inih/ini.h"
|
37 | 37 |
|
38 | 38 | TCHAR regkeyglobal[] = _T("Software\\DXGL\\Global");
|
| 39 | +TCHAR regkeyprofiles[] = _T("Software\\DXGL\\Profiles\\");
|
39 | 40 | TCHAR regkeybase[] = _T("Software\\DXGL\\");
|
40 | 41 | TCHAR regkeydxgl[] = _T("Software\\DXGL");
|
41 | 42 |
|
— | — | @@ -674,8 +675,8 @@ |
675 | 676 | WriteBool(hKey, cfg->EnableShader, cfgmask->EnableShader, _T("EnableShader"));
|
676 | 677 | WritePath(hKey,cfg->shaderfile,cfgmask->shaderfile,_T("ShaderFile"));
|
677 | 678 | WriteDWORD(hKey,cfg->SortModes,cfgmask->SortModes,_T("SortModes"));
|
678 | | - WriteBool(hKey,cfg->AddColorDepths,cfgmask->AddColorDepths,_T("AddColorDepths"));
|
679 | | - WriteBool(hKey,cfg->AddModes,cfgmask->AddModes,_T("AddModes"));
|
| 679 | + WriteDWORD(hKey,cfg->AddColorDepths,cfgmask->AddColorDepths,_T("AddColorDepths"));
|
| 680 | + WriteDWORD(hKey,cfg->AddModes,cfgmask->AddModes,_T("AddModes"));
|
680 | 681 | WriteDWORD(hKey,cfg->vsync,cfgmask->vsync,_T("VSync"));
|
681 | 682 | WriteDWORD(hKey,cfg->TextureFormat,cfgmask->TextureFormat,_T("TextureFormat"));
|
682 | 683 | WriteDWORD(hKey,cfg->TexUpload,cfgmask->TexUpload,_T("TexUpload"));
|
— | — | @@ -1131,8 +1132,9 @@ |
1132 | 1133 | error = RegQueryValueEx(hKey, _T("Configuration Version"), NULL, ®type, &version, &sizeout);
|
1133 | 1134 | if (error != ERROR_SUCCESS) version = 0; // Version is 0 if not set (alpha didn't have version)
|
1134 | 1135 | if (regtype != REG_DWORD) version = 0; // Is the key the wrong type?
|
1135 | | - if (version >= 1) return; // If version is 1 no need to upgrade.
|
| 1136 | + if (version >= 1) goto ver1to2; // If version is 1 check for version 2.
|
1136 | 1137 | ver0to1:
|
| 1138 | + // Version 0 to 1: Convert old EXE checksum profiles to directory based profiles.
|
1137 | 1139 | // Count profiles
|
1138 | 1140 | keyindex = 0;
|
1139 | 1141 | numoldconfig = 0;
|
— | — | @@ -1374,7 +1376,67 @@ |
1375 | 1377 | if(oldvalue) free(oldvalue);
|
1376 | 1378 | sizeout = 1;
|
1377 | 1379 | RegSetValueEx(hKey, _T("Configuration Version"), 0, REG_DWORD, &sizeout, 4);
|
| 1380 | +ver1to2:
|
1378 | 1381 | RegCloseKey(hKey);
|
| 1382 | + // Version 1 to 2: Fix an incorrectly written AddColorDepths value
|
| 1383 | + if (version >= 2) return; // If version is 2 no need to upgrade.
|
| 1384 | + // Fix up the global Add color depths
|
| 1385 | + _tcscpy(regkey, regkeyglobal);
|
| 1386 | + error = RegCreateKeyEx(HKEY_CURRENT_USER, regkey, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, NULL);
|
| 1387 | + sizeout = 4;
|
| 1388 | + regtype = REG_DWORD;
|
| 1389 | + error = RegQueryValueEx(hKey,_T("AddColorDepths"),NULL,
|
| 1390 | + ®type, &numvalue, &sizeout);
|
| 1391 | + if (error == ERROR_SUCCESS)
|
| 1392 | + {
|
| 1393 | + if (numvalue == 1)
|
| 1394 | + {
|
| 1395 | + numvalue = 1 | 4 | 16;
|
| 1396 | + RegSetValueEx(hKey, _T("AddColorDepths"), 0, REG_DWORD, &numvalue, 4);
|
| 1397 | + }
|
| 1398 | + }
|
| 1399 | + RegCloseKey(hKey);
|
| 1400 | + // Enumerate profiles and fix up Add color depths
|
| 1401 | + _tcscpy(regkey, regkeyprofiles);
|
| 1402 | + error = RegOpenKeyEx(HKEY_CURRENT_USER, regkey, 0, KEY_ALL_ACCESS, &hKey);
|
| 1403 | + if (error == ERROR_SUCCESS)
|
| 1404 | + {
|
| 1405 | + keyindex = 0;
|
| 1406 | + do
|
| 1407 | + {
|
| 1408 | + sizeout = MAX_PATH;
|
| 1409 | + error = RegEnumKeyEx(hKey, keyindex, &subkey, &sizeout,
|
| 1410 | + NULL, NULL, NULL, NULL);
|
| 1411 | + keyindex++;
|
| 1412 | + if (error == ERROR_SUCCESS)
|
| 1413 | + {
|
| 1414 | + error2 = RegOpenKeyEx(hKey, subkey, 0, KEY_ALL_ACCESS, &hKeyProfile);
|
| 1415 | + if (error2 == ERROR_SUCCESS)
|
| 1416 | + {
|
| 1417 | + error2 = RegQueryValueEx(hKeyProfile, _T("AddColorDepths"), NULL,
|
| 1418 | + ®type, &numvalue, &sizeout);
|
| 1419 | + if (error2 == ERROR_SUCCESS)
|
| 1420 | + {
|
| 1421 | + if (numvalue == 1)
|
| 1422 | + {
|
| 1423 | + numvalue = 1 | 4 | 16;
|
| 1424 | + RegSetValueEx(hKeyProfile, _T("AddColorDepths"), 0, REG_DWORD, &numvalue, 4);
|
| 1425 | + }
|
| 1426 | + }
|
| 1427 | + RegCloseKey(hKeyProfile);
|
| 1428 | + }
|
| 1429 | + }
|
| 1430 | + } while (error == ERROR_SUCCESS);
|
| 1431 | + RegCloseKey(hKey);
|
| 1432 | + }
|
| 1433 | + _tcscpy(regkey, regkeybase);
|
| 1434 | + error = RegCreateKeyEx(HKEY_CURRENT_USER, regkey, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, NULL);
|
| 1435 | + if (error == ERROR_SUCCESS)
|
| 1436 | + {
|
| 1437 | + sizeout = 2;
|
| 1438 | + RegSetValueEx(hKey, _T("Configuration Version"), 0, REG_DWORD, &sizeout, 4);
|
| 1439 | + RegCloseKey(hKey);
|
| 1440 | + }
|
1379 | 1441 | }
|
1380 | 1442 |
|
1381 | 1443 | int ReadINIOptionsCallback(app_ini_options *options, const char *section, const char *name,
|
Index: dxglcfg2/dxglcfg2.c |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | _T("8/15-bit"),
|
105 | 105 | _T("16-bit"),
|
106 | 106 | _T("8/16-bit"),
|
107 | | - _T("8/15-bit"),
|
| 107 | + _T("15/16-bit"),
|
108 | 108 | _T("8/15/16-bit"),
|
109 | 109 | _T("24-bit"),
|
110 | 110 | _T("8/24-bit"),
|
— | — | @@ -111,7 +111,7 @@ |
112 | 112 | _T("8/15/24-bit"),
|
113 | 113 | _T("16/24-bit"),
|
114 | 114 | _T("8/16/24-bit"),
|
115 | | - _T("8/15/24-bit"),
|
| 115 | + _T("15/16/24-bit"),
|
116 | 116 | _T("8/15/16/24-bit"),
|
117 | 117 | _T("32-bit"),
|
118 | 118 | _T("8/32-bit"),
|
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | _T("8/15/32-bit"),
|
121 | 121 | _T("16/32-bit"),
|
122 | 122 | _T("8/16/32-bit"),
|
123 | | - _T("8/15/32-bit"),
|
| 123 | + _T("15/16/32-bit"),
|
124 | 124 | _T("8/15/16/32-bit"),
|
125 | 125 | _T("24/32-bit"),
|
126 | 126 | _T("8/24/32-bit"),
|
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | _T("8/15/24/32-bit"),
|
129 | 129 | _T("16/24/32-bit"),
|
130 | 130 | _T("8/16/24/32-bit"),
|
131 | | - _T("8/15/24/32-bit"),
|
| 131 | + _T("15/16/24/32-bit"),
|
132 | 132 | _T("8/15/16/24/32-bit")
|
133 | 133 | };
|
134 | 134 |
|
— | — | @@ -723,6 +723,77 @@ |
724 | 724 | if(str[0] == 0) mask[0] = 0;
|
725 | 725 | else mask[0] = 0xff;
|
726 | 726 | }
|
| 727 | +
|
| 728 | +void DrawCheck(HDC hdc, BOOL selected, BOOL checked, BOOL grayed, RECT *r)
|
| 729 | +{
|
| 730 | + if (grayed)
|
| 731 | + {
|
| 732 | + if (checked)
|
| 733 | + {
|
| 734 | + if (hThemeDisplay)
|
| 735 | + {
|
| 736 | + if (selected)
|
| 737 | + _DrawThemeBackground(hThemeDisplay, hdc, BS_AUTOCHECKBOX, CBS_CHECKEDHOT, r, NULL);
|
| 738 | + else _DrawThemeBackground(hThemeDisplay, hdc, BS_AUTOCHECKBOX, CBS_CHECKEDDISABLED, r, NULL);
|
| 739 | + }
|
| 740 | + else
|
| 741 | + {
|
| 742 | + if (selected)
|
| 743 | + DrawFrameControl(hdc, r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_INACTIVE | DFCS_HOT);
|
| 744 | + else DrawFrameControl(hdc, r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_INACTIVE);
|
| 745 | + }
|
| 746 | + }
|
| 747 | + else
|
| 748 | + {
|
| 749 | + if (hThemeDisplay)
|
| 750 | + {
|
| 751 | + if (selected)
|
| 752 | + _DrawThemeBackground(hThemeDisplay, hdc, BS_AUTOCHECKBOX, CBS_UNCHECKEDHOT, r, NULL);
|
| 753 | + else _DrawThemeBackground(hThemeDisplay, hdc, BS_AUTOCHECKBOX, CBS_UNCHECKEDDISABLED, r, NULL);
|
| 754 | + }
|
| 755 | + else
|
| 756 | + {
|
| 757 | + if (selected)
|
| 758 | + DrawFrameControl(hdc, r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_INACTIVE | DFCS_HOT);
|
| 759 | + else DrawFrameControl(hdc, r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_INACTIVE);
|
| 760 | + }
|
| 761 | + }
|
| 762 | + }
|
| 763 | + else
|
| 764 | + {
|
| 765 | + if (checked)
|
| 766 | + {
|
| 767 | + if (hThemeDisplay)
|
| 768 | + {
|
| 769 | + if (selected)
|
| 770 | + _DrawThemeBackground(hThemeDisplay, hdc, BS_AUTOCHECKBOX, CBS_CHECKEDHOT, r, NULL);
|
| 771 | + else _DrawThemeBackground(hThemeDisplay, hdc, BS_AUTOCHECKBOX, CBS_CHECKEDNORMAL, r, NULL);
|
| 772 | + }
|
| 773 | + else
|
| 774 | + {
|
| 775 | + if (selected)
|
| 776 | + DrawFrameControl(hdc, r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_HOT);
|
| 777 | + else DrawFrameControl(hdc, r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED);
|
| 778 | + }
|
| 779 | + }
|
| 780 | + else
|
| 781 | + {
|
| 782 | + if (hThemeDisplay)
|
| 783 | + {
|
| 784 | + if (selected)
|
| 785 | + _DrawThemeBackground(hThemeDisplay, hdc, BS_AUTOCHECKBOX, CBS_UNCHECKEDHOT, r, NULL);
|
| 786 | + else _DrawThemeBackground(hThemeDisplay, hdc, BS_AUTOCHECKBOX, CBS_UNCHECKEDNORMAL, r, NULL);
|
| 787 | + }
|
| 788 | + else
|
| 789 | + {
|
| 790 | + if (selected)
|
| 791 | + DrawFrameControl(hdc, r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_HOT);
|
| 792 | + else DrawFrameControl(hdc, r, DFC_BUTTON, DFCS_BUTTONCHECK);
|
| 793 | + }
|
| 794 | + }
|
| 795 | + }
|
| 796 | +}
|
| 797 | +
|
727 | 798 | LRESULT CALLBACK DisplayTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
728 | 799 | {
|
729 | 800 | DRAWITEMSTRUCT* drawitem;
|
— | — | @@ -730,6 +801,9 @@ |
731 | 802 | RECT r;
|
732 | 803 | TCHAR combotext[64];
|
733 | 804 | DWORD cursel;
|
| 805 | + HDC hdc;
|
| 806 | + HFONT font1, font2;
|
| 807 | + SIZE size;
|
734 | 808 | int i;
|
735 | 809 | switch (Msg)
|
736 | 810 | {
|
— | — | @@ -743,8 +817,21 @@ |
744 | 818 | {
|
745 | 819 | case IDC_COLORDEPTH:
|
746 | 820 | case IDC_EXTRAMODES:
|
747 | | - ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = GetSystemMetrics(SM_CYMENUCHECK);
|
748 | | - ((LPMEASUREITEMSTRUCT)lParam)->itemWidth = GetSystemMetrics(SM_CXMENUCHECK);
|
| 821 | + if (((LPMEASUREITEMSTRUCT)lParam)->itemID == -1)
|
| 822 | + {
|
| 823 | + hdc = GetDC(hWnd);
|
| 824 | + font1 = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);
|
| 825 | + font2 = SelectObject(hdc, font1);
|
| 826 | + GetTextExtentPoint(hdc, _T(" "), 1, &size);
|
| 827 | + SelectObject(hdc, font2);
|
| 828 | + ReleaseDC(hWnd, hdc);
|
| 829 | + ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = size.cy + 2;
|
| 830 | + }
|
| 831 | + else
|
| 832 | + {
|
| 833 | + ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = GetSystemMetrics(SM_CYMENUCHECK);
|
| 834 | + ((LPMEASUREITEMSTRUCT)lParam)->itemWidth = GetSystemMetrics(SM_CXMENUCHECK);
|
| 835 | + }
|
749 | 836 | break;
|
750 | 837 | default:
|
751 | 838 | break;
|
— | — | @@ -768,35 +855,17 @@ |
769 | 856 | {
|
770 | 857 | r.left = r.left + 2;
|
771 | 858 | r.right = r.left + GetSystemMetrics(SM_CXMENUCHECK);
|
772 | | - if ((cfg->AddColorDepths >> drawitem->itemID) & 1)
|
| 859 | + if (drawitem->itemID == 5)
|
773 | 860 | {
|
774 | | - if (hThemeDisplay)
|
775 | | - {
|
776 | | - if (drawitem->itemState & ODS_SELECTED)
|
777 | | - _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_CHECKEDHOT, &r, NULL);
|
778 | | - else _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_CHECKEDNORMAL, &r, NULL);
|
779 | | - }
|
780 | | - else
|
781 | | - {
|
782 | | - if (drawitem->itemState & ODS_SELECTED)
|
783 | | - DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_HOT);
|
784 | | - else DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED);
|
785 | | - }
|
| 861 | + if(!cfgmask->AddColorDepths)
|
| 862 | + DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, TRUE, FALSE, &r);
|
| 863 | + else DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, FALSE, FALSE, &r);
|
786 | 864 | }
|
787 | 865 | else
|
788 | 866 | {
|
789 | | - if (hThemeDisplay)
|
790 | | - {
|
791 | | - if (drawitem->itemState & ODS_SELECTED)
|
792 | | - _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_UNCHECKEDHOT, &r, NULL);
|
793 | | - else _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_UNCHECKEDNORMAL, &r, NULL);
|
794 | | - }
|
795 | | - else
|
796 | | - {
|
797 | | - if (drawitem->itemState & ODS_SELECTED)
|
798 | | - DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_HOT);
|
799 | | - else DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK);
|
800 | | - }
|
| 867 | + if ((cfg->AddColorDepths >> drawitem->itemID) & 1)
|
| 868 | + DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, TRUE, !cfgmask->AddColorDepths, &r);
|
| 869 | + else DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, FALSE, !cfgmask->AddColorDepths, &r);
|
801 | 870 | }
|
802 | 871 | drawitem->rcItem.left += GetSystemMetrics(SM_CXMENUCHECK) + 5;
|
803 | 872 | }
|
— | — | @@ -803,7 +872,11 @@ |
804 | 873 | combotext[0] = 0;
|
805 | 874 | if (drawitem->itemID != -1 && !(drawitem->itemState & ODS_COMBOBOXEDIT))
|
806 | 875 | SendDlgItemMessage(hWnd, IDC_COLORDEPTH, CB_GETLBTEXT, drawitem->itemID, combotext);
|
807 | | - else _tcscpy(combotext, colormodes[cfg->AddColorDepths & 31]);
|
| 876 | + else
|
| 877 | + {
|
| 878 | + if(!cfgmask->AddColorDepths) _tcscpy(combotext, strdefault);
|
| 879 | + else _tcscpy(combotext, colormodes[cfg->AddColorDepths & 31]);
|
| 880 | + }
|
808 | 881 | DrawText(drawitem->hDC, combotext, _tcslen(combotext), &drawitem->rcItem,
|
809 | 882 | DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
810 | 883 | SetTextColor(drawitem->hDC, OldTextColor);
|
— | — | @@ -828,35 +901,17 @@ |
829 | 902 | {
|
830 | 903 | r.left = r.left + 2;
|
831 | 904 | r.right = r.left + GetSystemMetrics(SM_CXMENUCHECK);
|
832 | | - if ((cfg->AddModes >> drawitem->itemID) & 1)
|
| 905 | + if (drawitem->itemID == 7)
|
833 | 906 | {
|
834 | | - if (hThemeDisplay)
|
835 | | - {
|
836 | | - if (drawitem->itemState & ODS_SELECTED)
|
837 | | - _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_CHECKEDHOT, &r, NULL);
|
838 | | - else _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_CHECKEDNORMAL, &r, NULL);
|
839 | | - }
|
840 | | - else
|
841 | | - {
|
842 | | - if (drawitem->itemState & ODS_SELECTED)
|
843 | | - DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_HOT);
|
844 | | - else DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED);
|
845 | | - }
|
| 907 | + if (!cfgmask->AddModes)
|
| 908 | + DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, TRUE, FALSE, &r);
|
| 909 | + else DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, FALSE, FALSE, &r);
|
846 | 910 | }
|
847 | 911 | else
|
848 | 912 | {
|
849 | | - if (hThemeDisplay)
|
850 | | - {
|
851 | | - if (drawitem->itemState & ODS_SELECTED)
|
852 | | - _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_UNCHECKEDHOT, &r, NULL);
|
853 | | - else _DrawThemeBackground(hThemeDisplay, drawitem->hDC, BS_AUTOCHECKBOX, CBS_UNCHECKEDNORMAL, &r, NULL);
|
854 | | - }
|
855 | | - else
|
856 | | - {
|
857 | | - if (drawitem->itemState & ODS_SELECTED)
|
858 | | - DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_HOT);
|
859 | | - else DrawFrameControl(drawitem->hDC, &r, DFC_BUTTON, DFCS_BUTTONCHECK);
|
860 | | - }
|
| 913 | + if ((cfg->AddModes >> drawitem->itemID) & 1)
|
| 914 | + DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, TRUE, !cfgmask->AddModes, &r);
|
| 915 | + else DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, FALSE, !cfgmask->AddModes, &r);
|
861 | 916 | }
|
862 | 917 | drawitem->rcItem.left += GetSystemMetrics(SM_CXMENUCHECK) + 5;
|
863 | 918 | }
|
— | — | @@ -865,34 +920,38 @@ |
866 | 921 | SendDlgItemMessage(hWnd, IDC_EXTRAMODES, CB_GETLBTEXT, drawitem->itemID, combotext);
|
867 | 922 | else
|
868 | 923 | {
|
869 | | - switch (cfg->AddModes)
|
| 924 | + if (!cfgmask->AddModes) _tcscpy(combotext, strdefault);
|
| 925 | + else
|
870 | 926 | {
|
871 | | - case 0:
|
872 | | - _tcscpy(combotext, _T("None"));
|
873 | | - break;
|
874 | | - case 1:
|
875 | | - _tcscpy(combotext, extramodes[0]);
|
876 | | - break;
|
877 | | - case 2:
|
878 | | - _tcscpy(combotext, extramodes[1]);
|
879 | | - break;
|
880 | | - case 4:
|
881 | | - _tcscpy(combotext, extramodes[2]);
|
882 | | - break;
|
883 | | - case 8:
|
884 | | - _tcscpy(combotext, extramodes[3]);
|
885 | | - break;
|
886 | | - case 16:
|
887 | | - _tcscpy(combotext, extramodes[4]);
|
888 | | - break;
|
889 | | - case 32:
|
890 | | - _tcscpy(combotext, extramodes[5]);
|
891 | | - break;
|
892 | | - case 64:
|
893 | | - _tcscpy(combotext, extramodes[6]);
|
894 | | - break;
|
895 | | - default:
|
896 | | - _tcscpy(combotext, _T("Multiple selections"));
|
| 927 | + switch (cfg->AddModes)
|
| 928 | + {
|
| 929 | + case 0:
|
| 930 | + _tcscpy(combotext, _T("None"));
|
| 931 | + break;
|
| 932 | + case 1:
|
| 933 | + _tcscpy(combotext, extramodes[0]);
|
| 934 | + break;
|
| 935 | + case 2:
|
| 936 | + _tcscpy(combotext, extramodes[1]);
|
| 937 | + break;
|
| 938 | + case 4:
|
| 939 | + _tcscpy(combotext, extramodes[2]);
|
| 940 | + break;
|
| 941 | + case 8:
|
| 942 | + _tcscpy(combotext, extramodes[3]);
|
| 943 | + break;
|
| 944 | + case 16:
|
| 945 | + _tcscpy(combotext, extramodes[4]);
|
| 946 | + break;
|
| 947 | + case 32:
|
| 948 | + _tcscpy(combotext, extramodes[5]);
|
| 949 | + break;
|
| 950 | + case 64:
|
| 951 | + _tcscpy(combotext, extramodes[6]);
|
| 952 | + break;
|
| 953 | + default:
|
| 954 | + _tcscpy(combotext, _T("Multiple selections"));
|
| 955 | + }
|
897 | 956 | }
|
898 | 957 | }
|
899 | 958 | DrawText(drawitem->hDC, combotext, _tcslen(combotext), &drawitem->rcItem,
|
— | — | @@ -923,9 +982,18 @@ |
924 | 983 | if (ColorDepth_Dropdown)
|
925 | 984 | {
|
926 | 985 | cursel = SendDlgItemMessage(hWnd, IDC_COLORDEPTH, CB_GETCURSEL, 0, 0);
|
927 | | - i = ((cfg->AddColorDepths >> cursel) & 1);
|
928 | | - if (i) cfg->AddColorDepths &= ~(1 << cursel);
|
929 | | - else cfg->AddColorDepths |= 1 << cursel;
|
| 986 | + if (cursel == 5)
|
| 987 | + {
|
| 988 | + if (cfgmask->AddColorDepths) cfgmask->AddColorDepths = 0;
|
| 989 | + else cfgmask->AddColorDepths = 1;
|
| 990 | + }
|
| 991 | + else
|
| 992 | + {
|
| 993 | + if (!cfgmask->AddColorDepths) cfgmask->AddColorDepths = 1;
|
| 994 | + i = ((cfg->AddColorDepths >> cursel) & 1);
|
| 995 | + if (i) cfg->AddColorDepths &= ~(1 << cursel);
|
| 996 | + else cfg->AddColorDepths |= 1 << cursel;
|
| 997 | + }
|
930 | 998 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
931 | 999 | *dirty = TRUE;
|
932 | 1000 | }
|
— | — | @@ -945,9 +1013,18 @@ |
946 | 1014 | if (ExtraModes_Dropdown)
|
947 | 1015 | {
|
948 | 1016 | cursel = SendDlgItemMessage(hWnd, IDC_EXTRAMODES, CB_GETCURSEL, 0, 0);
|
949 | | - i = ((cfg->AddModes >> cursel) & 1);
|
950 | | - if (i) cfg->AddModes &= ~(1 << cursel);
|
951 | | - else cfg->AddModes |= 1 << cursel;
|
| 1017 | + if (cursel == 7)
|
| 1018 | + {
|
| 1019 | + if (cfgmask->AddModes) cfgmask->AddModes = 0;
|
| 1020 | + else cfgmask->AddModes = 1;
|
| 1021 | + }
|
| 1022 | + else
|
| 1023 | + {
|
| 1024 | + if (!cfgmask->AddModes) cfgmask->AddModes = 1;
|
| 1025 | + i = ((cfg->AddModes >> cursel) & 1);
|
| 1026 | + if (i) cfg->AddModes &= ~(1 << cursel);
|
| 1027 | + else cfg->AddModes |= 1 << cursel;
|
| 1028 | + }
|
952 | 1029 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
953 | 1030 | *dirty = TRUE;
|
954 | 1031 | }
|