| 2131 | } |
| 2132 | |
| 2133 | void CWorldTexturesDialog::DrawSwatch(int handle, float r, float g, float b) { |
| 2134 | CWnd *texwnd; |
| 2135 | RECT rect; |
| 2136 | int w, h; |
| 2137 | float rmax = std::max(r, g); |
| 2138 | rmax = std::max(rmax, b); |
| 2139 | |
| 2140 | if (rmax >= .001) { |
| 2141 | r /= rmax; |
| 2142 | g /= rmax; |
| 2143 | b /= rmax; |
| 2144 | } |
| 2145 | |
| 2146 | texwnd = GetDlgItem(handle); |
| 2147 | texwnd->GetWindowRect(&rect); |
| 2148 | ScreenToClient(&rect); |
| 2149 | |
| 2150 | Desktop_surf->attach_to_window((unsigned)m_hWnd); |
| 2151 | |
| 2152 | w = rect.right - rect.left; |
| 2153 | h = rect.bottom - rect.top; |
| 2154 | |
| 2155 | ddgr_color color = GR_RGB(r * 255, g * 255, b * 255); |
| 2156 | |
| 2157 | Desktop_surf->clear(rect.left, rect.top, w, h, color); |
| 2158 | |
| 2159 | Desktop_surf->attach_to_window(NULL); |
| 2160 | } |
| 2161 | |
| 2162 | void CWorldTexturesDialog::ChangeSize(int w, int h) { |
| 2163 | int n = D3EditState.texdlg_texture; |
nothing calls this directly
no test coverage detected