Index: buildtool/buildtool.c |
— | — | @@ -230,7 +230,7 @@ |
231 | 231 | ZeroMemory(&startinfo,sizeof(STARTUPINFOA));
|
232 | 232 | startinfo.cb = sizeof(STARTUPINFOA);
|
233 | 233 | strcat(hhcpath," ");
|
234 | | - strcat(hhcpath,path);
|
| 234 | + strncat(hhcpath,path,MAX_PATH);
|
235 | 235 | if(CreateProcessA(NULL,hhcpath,NULL,NULL,FALSE,0,NULL,NULL,&startinfo,&process))
|
236 | 236 | {
|
237 | 237 | foundhhc = TRUE;
|
— | — | @@ -269,7 +269,7 @@ |
270 | 270 | ZeroMemory(&startinfo,sizeof(STARTUPINFOA));
|
271 | 271 | startinfo.cb = sizeof(STARTUPINFOA);
|
272 | 272 | strcat(nsispath," ");
|
273 | | - strcat(nsispath,path);
|
| 273 | + strncat(nsispath,path,MAX_PATH);
|
274 | 274 | if(CreateProcessA(NULL,nsispath,NULL,NULL,FALSE,0,NULL,NULL,&startinfo,&process))
|
275 | 275 | {
|
276 | 276 | foundnsis = TRUE;
|
Index: cfgmgr/cfgmgr.c |
— | — | @@ -677,7 +677,7 @@ |
678 | 678 | HKEY hKey;
|
679 | 679 | TCHAR regkey[MAX_PATH + 24];
|
680 | 680 | _tcscpy(regkey,regkeybase);
|
681 | | - _tcscat(regkey,name);
|
| 681 | + _tcsncat(regkey, name, MAX_PATH);
|
682 | 682 | ZeroMemory(cfg,sizeof(DXGLCFG));
|
683 | 683 | cfg->DPIScale = 1;
|
684 | 684 | RegCreateKeyEx(HKEY_CURRENT_USER,regkey,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,NULL);
|
— | — | @@ -697,7 +697,7 @@ |
698 | 698 | HKEY hKey;
|
699 | 699 | TCHAR regkey[MAX_PATH + 24];
|
700 | 700 | _tcscpy(regkey, regkeybase);
|
701 | | - _tcscat(regkey, name);
|
| 701 | + _tcsncat(regkey, name, MAX_PATH);
|
702 | 702 | RegCreateKeyEx(HKEY_CURRENT_USER, regkey, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, NULL);
|
703 | 703 | WriteSettings(hKey,cfg,mask,FALSE);
|
704 | 704 | RegCloseKey(hKey);
|
Index: dxglcfg2/dxglcfg2.c |
— | — | @@ -75,6 +75,9 @@ |
76 | 76 | DWORD current_app;
|
77 | 77 | BOOL tristate;
|
78 | 78 | TCHAR strdefault[] = _T("(global default)");
|
| 79 | +HWND hTab;
|
| 80 | +HWND hTabs[5];
|
| 81 | +int tabopen;
|
79 | 82 |
|
80 | 83 | DWORD AddApp(LPCTSTR path, BOOL copyfile, BOOL admin)
|
81 | 84 | {
|
— | — | @@ -385,11 +388,11 @@ |
386 | 389 | if (ptr)
|
387 | 390 | {
|
388 | 391 | *ptr = 0;
|
389 | | - numerator = _ttof(buffer);
|
390 | | - denominator = _ttof(ptr + 1);
|
| 392 | + numerator = (float)_ttof(buffer);
|
| 393 | + denominator = (float)_ttof(ptr + 1);
|
391 | 394 | return numerator / denominator;
|
392 | 395 | }
|
393 | | - else return _ttof(buffer);
|
| 396 | + else return (float)_ttof(buffer);
|
394 | 397 | }
|
395 | 398 | }
|
396 | 399 | }
|
— | — | @@ -400,7 +403,61 @@ |
401 | 404 | if(str[0] == 0) mask[0] = 0;
|
402 | 405 | else mask[0] = 0xff;
|
403 | 406 | }
|
404 | | -
|
| 407 | +LRESULT CALLBACK DisplayTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
| 408 | +{
|
| 409 | + switch (Msg)
|
| 410 | + {
|
| 411 | + case WM_INITDIALOG:
|
| 412 | + return TRUE;
|
| 413 | + default:
|
| 414 | + return FALSE;
|
| 415 | + }
|
| 416 | + return TRUE;
|
| 417 | +}
|
| 418 | +LRESULT CALLBACK Tab3DCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
| 419 | +{
|
| 420 | + switch (Msg)
|
| 421 | + {
|
| 422 | + case WM_INITDIALOG:
|
| 423 | + return TRUE;
|
| 424 | + default:
|
| 425 | + return FALSE;
|
| 426 | + }
|
| 427 | + return TRUE;
|
| 428 | +}
|
| 429 | +LRESULT CALLBACK EffectsTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
| 430 | +{
|
| 431 | + switch (Msg)
|
| 432 | + {
|
| 433 | + case WM_INITDIALOG:
|
| 434 | + return TRUE;
|
| 435 | + default:
|
| 436 | + return FALSE;
|
| 437 | + }
|
| 438 | + return TRUE;
|
| 439 | +}
|
| 440 | +LRESULT CALLBACK AdvancedTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
| 441 | +{
|
| 442 | + switch (Msg)
|
| 443 | + {
|
| 444 | + case WM_INITDIALOG:
|
| 445 | + return TRUE;
|
| 446 | + default:
|
| 447 | + return FALSE;
|
| 448 | + }
|
| 449 | + return TRUE;
|
| 450 | +}
|
| 451 | +LRESULT CALLBACK DebugTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
| 452 | +{
|
| 453 | + switch (Msg)
|
| 454 | + {
|
| 455 | + case WM_INITDIALOG:
|
| 456 | + return TRUE;
|
| 457 | + default:
|
| 458 | + return FALSE;
|
| 459 | + }
|
| 460 | + return TRUE;
|
| 461 | +}
|
405 | 462 | LRESULT CALLBACK DXGLCfgCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
406 | 463 | {
|
407 | 464 | PIXELFORMATDESCRIPTOR pfd =
|
— | — | @@ -464,6 +521,8 @@ |
465 | 522 | LPTSTR regkey;
|
466 | 523 | BOOL failed;
|
467 | 524 | RECT r;
|
| 525 | + NMHDR *nm;
|
| 526 | + int newtab;
|
468 | 527 | TCITEM tab;
|
469 | 528 | drawitem = (DRAWITEMSTRUCT*)lParam;
|
470 | 529 | switch (Msg)
|
— | — | @@ -531,8 +590,20 @@ |
532 | 591 | SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 3, (LPARAM)&tab);
|
533 | 592 | tab.pszText = _T("Debug");
|
534 | 593 | SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 4, (LPARAM)&tab);
|
| 594 | + hTab = GetDlgItem(hWnd, IDC_TABS);
|
| 595 | + hTabs[0] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_DISPLAY), hTab, DisplayTabCallback);
|
| 596 | + hTabs[1] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_3DGRAPHICS), hTab, Tab3DCallback);
|
| 597 | + hTabs[2] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_EFFECTS), hTab, EffectsTabCallback);
|
| 598 | + hTabs[3] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_ADVANCED), hTab, AdvancedTabCallback);
|
| 599 | + hTabs[4] = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_DEBUG), hTab, DebugTabCallback);
|
| 600 | + SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETITEMRECT, 0, (LPARAM)&r);
|
| 601 | + SetWindowPos(hTabs[0], NULL, r.left, r.bottom + 3, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
|
| 602 | + ShowWindow(hTabs[1], SW_HIDE);
|
| 603 | + ShowWindow(hTabs[2], SW_HIDE);
|
| 604 | + ShowWindow(hTabs[3], SW_HIDE);
|
| 605 | + ShowWindow(hTabs[4], SW_HIDE);
|
| 606 | + tabopen = 0;
|
535 | 607 |
|
536 | | -
|
537 | 608 | // Load global settings.
|
538 | 609 | /* // scaler
|
539 | 610 | _tcscpy(buffer,_T("Change desktop resolution"));
|
— | — | @@ -887,6 +958,20 @@ |
888 | 959 | break;
|
889 | 960 | }
|
890 | 961 | break;
|
| 962 | + case WM_NOTIFY:
|
| 963 | + nm = (LPNMHDR)lParam;
|
| 964 | + if (nm->code == TCN_SELCHANGE)
|
| 965 | + {
|
| 966 | + newtab = SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETCURSEL, 0, 0);
|
| 967 | + if (newtab != tabopen)
|
| 968 | + {
|
| 969 | + ShowWindow(hTabs[tabopen], SW_HIDE);
|
| 970 | + tabopen = newtab;
|
| 971 | + SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETITEMRECT, 0, (LPARAM)&r);
|
| 972 | + SetWindowPos(hTabs[tabopen], NULL, r.left, r.bottom + 3, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
|
| 973 | + }
|
| 974 | + }
|
| 975 | + break;
|
891 | 976 | case WM_DRAWITEM:
|
892 | 977 | switch(wParam)
|
893 | 978 | {
|
Index: dxglcfg2/dxglcfg2.rc |
— | — | @@ -28,11 +28,11 @@ |
29 | 29 | // Dialog resources
|
30 | 30 | //
|
31 | 31 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
32 | | -IDD_DISPLAY DIALOG 0, 0, 283, 176
|
33 | | -STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
|
| 32 | +IDD_DISPLAY DIALOG 0, 0, 283, 173
|
| 33 | +STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_CHILDWINDOW
|
34 | 34 | FONT 8, "Ms Shell Dlg"
|
35 | 35 | {
|
36 | | - COMBOBOX IDC_VSYNC, 114, 92, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
| 36 | + COMBOBOX IDC_VSYNC, 114, 92, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
37 | 37 | LTEXT "Vertical sync", IDC_STATIC, 114, 82, 41, 8, SS_LEFT, WS_EX_LEFT
|
38 | 38 | COMBOBOX IDC_EXTRAMODES, 114, 42, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
39 | 39 | LTEXT "Additional display modes", 0, 114, 32, 78, 8, SS_LEFT, WS_EX_LEFT
|
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | COMBOBOX IDC_ASPECT, 7, 67, 102, 30, CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
|
46 | 46 | COMBOBOX IDC_SCALE, 7, 42, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
47 | 47 | LTEXT "Scaling method", IDC_STATIC, 7, 32, 49, 8, SS_LEFT, WS_EX_LEFT
|
48 | | - COMBOBOX IDC_SORTMODES, 114, 67, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
| 48 | + COMBOBOX IDC_SORTMODES, 114, 67, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
49 | 49 | LTEXT "Sort video modes", IDC_STATIC, 114, 57, 56, 8, SS_LEFT, WS_EX_LEFT
|
50 | 50 | COMBOBOX IDC_VIDMODE, 7, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
51 | 51 | LTEXT "Video mode", IDC_STATIC, 7, 7, 38, 8, SS_LEFT, WS_EX_LEFT
|
— | — | @@ -54,25 +54,25 @@ |
55 | 55 |
|
56 | 56 |
|
57 | 57 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
58 | | -IDD_3DGRAPHICS DIALOG 0, 0, 283, 176
|
59 | | -STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
|
| 58 | +IDD_3DGRAPHICS DIALOG 0, 0, 283, 173
|
| 59 | +STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_CHILDWINDOW
|
60 | 60 | FONT 8, "Ms Shell Dlg"
|
61 | 61 | {
|
62 | 62 | LTEXT "Texture filter", IDC_STATIC, 7, 7, 43, 8, SS_LEFT, WS_EX_LEFT
|
63 | 63 | COMBOBOX IDC_TEXFILTER, 7, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
64 | 64 | LTEXT "Anisotropic filtering", IDC_STATIC, 114, 7, 62, 8, SS_LEFT, WS_EX_LEFT
|
65 | | - COMBOBOX IDC_ANISO, 114, 17, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
| 65 | + COMBOBOX IDC_ANISO, 114, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
66 | 66 | LTEXT "Antialiasing (MSAA)", IDC_STATIC, 7, 32, 63, 8, SS_LEFT, WS_EX_LEFT
|
67 | 67 | COMBOBOX IDC_MSAA, 7, 42, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
68 | 68 | LTEXT "Renderer aspect ratio", IDC_STATIC, 114, 32, 71, 8, SS_LEFT, WS_EX_LEFT
|
69 | | - COMBOBOX IDC_ASPECT3D, 114, 42, 100, 14, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
| 69 | + COMBOBOX IDC_ASPECT3D, 114, 42, 102, 14, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
70 | 70 | }
|
71 | 71 |
|
72 | 72 |
|
73 | 73 |
|
74 | 74 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
75 | | -IDD_DEBUG DIALOG 0, 0, 283, 176
|
76 | | -STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
|
| 75 | +IDD_DEBUG DIALOG 0, 0, 283, 173
|
| 76 | +STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_CHILDWINDOW
|
77 | 77 | FONT 8, "Ms Shell Dlg"
|
78 | 78 | {
|
79 | 79 | LISTBOX IDC_DEBUGLIST, 7, 7, 269, 162, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT | LBS_OWNERDRAWFIXED | LBS_SORT | LBS_NOTIFY, WS_EX_LEFT
|
— | — | @@ -81,8 +81,8 @@ |
82 | 82 |
|
83 | 83 |
|
84 | 84 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
85 | | -IDD_EFFECTS DIALOG 0, 0, 283, 176
|
86 | | -STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
|
| 85 | +IDD_EFFECTS DIALOG 0, 0, 283, 173
|
| 86 | +STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_CHILDWINDOW
|
87 | 87 | FONT 8, "Ms Shell Dlg"
|
88 | 88 | {
|
89 | 89 | LTEXT "Y", IDC_CUSTOMSCALELABELY, 57, 72, 6, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
|
— | — | @@ -118,15 +118,15 @@ |
119 | 119 |
|
120 | 120 |
|
121 | 121 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
122 | | -IDD_ADVANCED DIALOG 0, 0, 283, 176
|
123 | | -STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
|
| 122 | +IDD_ADVANCED DIALOG 0, 0, 283, 173
|
| 123 | +STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_CHILDWINDOW
|
124 | 124 | FONT 8, "Ms Shell Dlg"
|
125 | 125 | {
|
126 | 126 | PUSHBUTTON "Write INI file...", IDC_WRITEINI, 203, 155, 73, 14, 0, WS_EX_LEFT
|
127 | 127 | COMBOBOX IDC_TEXTUREFORMAT, 7, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
128 | 128 | LTEXT "Texture format", IDC_STATIC, 7, 7, 50, 8, SS_LEFT, WS_EX_LEFT
|
129 | | - LTEXT "Texture access method", IDC_STATIC, 111, 7, 76, 8, SS_LEFT, WS_EX_LEFT
|
130 | | - COMBOBOX IDC_TEXUPLOAD, 111, 17, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
| 129 | + LTEXT "Texture access method", IDC_STATIC, 114, 7, 76, 8, SS_LEFT, WS_EX_LEFT
|
| 130 | + COMBOBOX IDC_TEXUPLOAD, 114, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
|
131 | 131 | }
|
132 | 132 |
|
133 | 133 |
|
Index: dxgltest/dxgltest.cpp |
— | — | @@ -777,7 +777,6 @@ |
778 | 778 | }
|
779 | 779 | }
|
780 | 780 | break;
|
781 | | - break;
|
782 | 781 | default:
|
783 | 782 | return FALSE;
|
784 | 783 | }
|