| 644 | } |
| 645 | |
| 646 | void CTextureDialog::DrawSwatch(int handle, float r, float g, float b) { |
| 647 | CWnd *texwnd; |
| 648 | RECT rect; |
| 649 | int w, h; |
| 650 | float rmax = std::max(r, g); |
| 651 | rmax = std::max(rmax, b); |
| 652 | |
| 653 | if (rmax >= .001) { |
| 654 | r /= rmax; |
| 655 | g /= rmax; |
| 656 | b /= rmax; |
| 657 | } |
| 658 | |
| 659 | texwnd = GetDlgItem(handle); |
| 660 | texwnd->GetWindowRect(&rect); |
| 661 | ScreenToClient(&rect); |
| 662 | |
| 663 | Desktop_surf->attach_to_window((unsigned)m_hWnd); |
| 664 | |
| 665 | w = rect.right - rect.left; |
| 666 | h = rect.bottom - rect.top; |
| 667 | |
| 668 | ddgr_color color = GR_RGB(r * 255, g * 255, b * 255); |
| 669 | |
| 670 | Desktop_surf->clear(rect.left, rect.top, w, h, color); |
| 671 | |
| 672 | Desktop_surf->attach_to_window(NULL); |
| 673 | } |
| 674 | |
| 675 | void CTextureDialog::OnKillfocusTexscaleEdit() { |
| 676 | CEdit *ebox; |
no test coverage detected