Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -2362,6 +2362,24 @@ |
2363 | 2363 | return TRUE;
|
2364 | 2364 | }
|
2365 | 2365 |
|
| 2366 | +LPCTSTR strDisabled = _T("Disabled");
|
| 2367 | +LPCTSTR strEnabled = _T("Enabled");
|
| 2368 | +LPCTSTR strExpandViewport[] =
|
| 2369 | +{
|
| 2370 | + _T("512x448 to 640x480"),
|
| 2371 | + _T("512x480 to 640x480")
|
| 2372 | +};
|
| 2373 | +LPCTSTR strViewportCompare[] =
|
| 2374 | +{
|
| 2375 | + _T("Match color"),
|
| 2376 | + _T("Color less than or equal"),
|
| 2377 | + _T("Color greater than or equal"),
|
| 2378 | + _T("Match palette entry"),
|
| 2379 | + _T("Palette less than or equal"),
|
| 2380 | + _T("Palette greater than or equal")
|
| 2381 | +};
|
| 2382 | +LPCTSTR strUnknown = _T("Unknown");
|
| 2383 | +
|
2366 | 2384 | void UpdateHacksControl(HWND hWnd, int DlgItem, int item)
|
2367 | 2385 | {
|
2368 | 2386 | TCHAR buffer[64];
|
— | — | @@ -2369,38 +2387,27 @@ |
2370 | 2388 | {
|
2371 | 2389 | case 0:
|
2372 | 2390 | SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
2373 | | - _tcscpy(buffer, _T("Disabled"));
|
2374 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2375 | | - _tcscpy(buffer, _T("Enabled"));
|
2376 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2391 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strDisabled);
|
| 2392 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strEnabled);
|
2377 | 2393 | if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
2378 | 2394 | SetCombo(hWnd, DlgItem, cfg->HackCrop640480to640400, cfgmask->HackCrop640480to640400, tristate);
|
2379 | 2395 | break;
|
2380 | 2396 | case 1:
|
2381 | 2397 | SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
2382 | | - _tcscpy(buffer, _T("Disabled"));
|
2383 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2384 | | - _tcscpy(buffer, _T("512x448 to 640x480"));
|
2385 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2386 | | - _tcscpy(buffer, _T("512x480 to 640x480"));
|
2387 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2398 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strDisabled);
|
| 2399 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strExpandViewport[0]);
|
| 2400 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strExpandViewport[1]);
|
2388 | 2401 | if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
2389 | 2402 | SetCombo(hWnd, DlgItem, cfg->HackAutoExpandViewport, cfgmask->HackAutoExpandViewport, tristate);
|
2390 | 2403 | break;
|
2391 | 2404 | case 2:
|
2392 | 2405 | SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
2393 | | - _tcscpy(buffer, _T("Match color"));
|
2394 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2395 | | - _tcscpy(buffer, _T("Color less than or equal"));
|
2396 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2397 | | - _tcscpy(buffer, _T("Color greater than or equal"));
|
2398 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2399 | | - _tcscpy(buffer, _T("Match palette entry"));
|
2400 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2401 | | - _tcscpy(buffer, _T("Palette less than or equal"));
|
2402 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2403 | | - _tcscpy(buffer, _T("Palette greater than or equal"));
|
2404 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2406 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strViewportCompare[0]);
|
| 2407 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strViewportCompare[1]);
|
| 2408 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strViewportCompare[2]);
|
| 2409 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strViewportCompare[3]);
|
| 2410 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strViewportCompare[4]);
|
| 2411 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strViewportCompare[5]);
|
2405 | 2412 | if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
2406 | 2413 | SetCombo(hWnd, DlgItem, cfg->HackAutoExpandViewportCompare, cfgmask->HackAutoExpandViewportCompare, tristate);
|
2407 | 2414 | break;
|
— | — | @@ -2408,19 +2415,15 @@ |
2409 | 2416 | break;
|
2410 | 2417 | case 4:
|
2411 | 2418 | SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
2412 | | - _tcscpy(buffer, _T("Disabled"));
|
2413 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2414 | | - _tcscpy(buffer, _T("Enabled"));
|
2415 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2419 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strDisabled);
|
| 2420 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strEnabled);
|
2416 | 2421 | if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
2417 | 2422 | SetCombo(hWnd, DlgItem, cfg->HackNoTVRefresh, cfgmask->HackNoTVRefresh, tristate);
|
2418 | 2423 | break;
|
2419 | 2424 | case 5:
|
2420 | 2425 | SendDlgItemMessage(hWnd, DlgItem, CB_RESETCONTENT, 0, 0);
|
2421 | | - _tcscpy(buffer, _T("Disabled"));
|
2422 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
2423 | | - _tcscpy(buffer, _T("Enabled"));
|
2424 | | - SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2426 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strDisabled);
|
| 2427 | + SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strEnabled);
|
2425 | 2428 | if (tristate) SendDlgItemMessage(hWnd, DlgItem, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
2426 | 2429 | SetCombo(hWnd, DlgItem, cfg->HackSetCursor, cfgmask->HackSetCursor, tristate);
|
2427 | 2430 | break;
|
— | — | @@ -2428,6 +2431,59 @@ |
2429 | 2432 | break;
|
2430 | 2433 | }
|
2431 | 2434 | }
|
| 2435 | +
|
| 2436 | +void DrawHacksItemText(HDC hdc, RECT *r, int item)
|
| 2437 | +{
|
| 2438 | + LPCTSTR str = strUnknown;
|
| 2439 | + switch (item)
|
| 2440 | + {
|
| 2441 | + case 0:
|
| 2442 | + if (!cfgmask->HackCrop640480to640400) str = strdefault;
|
| 2443 | + else
|
| 2444 | + {
|
| 2445 | + if (cfg->HackCrop640480to640400) str = strEnabled;
|
| 2446 | + else str = strDisabled;
|
| 2447 | + }
|
| 2448 | + break;
|
| 2449 | + case 1:
|
| 2450 | + if (!cfgmask->HackAutoExpandViewport) str = strdefault;
|
| 2451 | + else
|
| 2452 | + {
|
| 2453 | + if (cfg->HackAutoExpandViewport > 2) str = strUnknown;
|
| 2454 | + else if (cfg->HackAutoExpandViewport == 0) str = strDisabled;
|
| 2455 | + else str = strExpandViewport[cfg->HackAutoExpandViewport-1];
|
| 2456 | + }
|
| 2457 | + break;
|
| 2458 | + case 2:
|
| 2459 | + if (!cfgmask->HackAutoExpandViewportCompare) str = strdefault;
|
| 2460 | + else
|
| 2461 | + {
|
| 2462 | + if (cfg->HackAutoExpandViewportCompare > 5) str = strUnknown;
|
| 2463 | + else str = strViewportCompare[cfg->HackAutoExpandViewportCompare];
|
| 2464 | + }
|
| 2465 | + break;
|
| 2466 | + case 4:
|
| 2467 | + if (!cfgmask->HackNoTVRefresh) str = strdefault;
|
| 2468 | + else
|
| 2469 | + {
|
| 2470 | + if (cfg->HackNoTVRefresh) str = strEnabled;
|
| 2471 | + else str = strDisabled;
|
| 2472 | + }
|
| 2473 | + break;
|
| 2474 | + case 5:
|
| 2475 | + if (!cfgmask->HackSetCursor) str = strdefault;
|
| 2476 | + else
|
| 2477 | + {
|
| 2478 | + if (cfg->HackSetCursor) str = strEnabled;
|
| 2479 | + else str = strDisabled;
|
| 2480 | + }
|
| 2481 | + break;
|
| 2482 | + default:
|
| 2483 | + str = strUnknown;
|
| 2484 | + }
|
| 2485 | + DrawText(hdc, str, _tcslen(str), r, DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
| 2486 | +}
|
| 2487 | +
|
2432 | 2488 | LRESULT CALLBACK HacksTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
2433 | 2489 | {
|
2434 | 2490 | TCHAR str[64];
|
— | — | @@ -2557,6 +2613,11 @@ |
2558 | 2614 | DrawText(drawitem->hDC, str, _tcslen(str), &drawitem->rcItem,
|
2559 | 2615 | DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
2560 | 2616 | drawitem->rcItem.left -= 1;
|
| 2617 | + if (hackstabitem == 3) GetWindowRect(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSEDIT), &r);
|
| 2618 | + else GetWindowRect(GetDlgItem(GetDlgItem(hWnd, IDC_HACKSLIST), IDC_HACKSDROPDOWN), &r);
|
| 2619 | + memcpy(&r2, &drawitem->rcItem, sizeof(RECT));
|
| 2620 | + r2.left = r2.right - (r.right - r.left);
|
| 2621 | + DrawHacksItemText(drawitem->hDC, &r2, drawitem->itemID);
|
2561 | 2622 | if (drawitem->itemState & ODS_FOCUS) DrawFocusRect(drawitem->hDC, &drawitem->rcItem);
|
2562 | 2623 | SetTextColor(drawitem->hDC, OldTextColor);
|
2563 | 2624 | SetBkColor(drawitem->hDC, OldBackColor);
|