MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / UpdateProcView

Method UpdateProcView

editor/WaterProceduralDialog.cpp:167–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void CWaterProceduralDialog::UpdateProcView() {
168 int n = D3EditState.texdlg_texture;
169
170 FrameCount++;
171
172 CWnd *texwnd;
173 RECT rect;
174
175 texwnd = GetDlgItem(IDC_WATER_PROCEDURAL_VIEW);
176 texwnd->GetWindowRect(&rect);
177 ScreenToClient(&rect);
178
179 int w = rect.right - rect.left;
180 int h = rect.bottom - rect.top;
181
182 Desktop_surf->attach_to_window((unsigned)m_hWnd);
183
184 int bm_handle = GetTextureBitmap(n, 0, 1);
185
186 if (GameBitmaps[bm_handle].flags & BF_MIPMAPPED)
187 GameBitmaps[m_window_bitmap].flags |= BF_MIPMAPPED;
188
189 bm_ScaleBitmapToBitmap(m_window_bitmap, bm_handle);
190
191 m_TextureSurf.load(m_window_bitmap);
192
193 int x = rect.left + ((rect.right - rect.left) / 2) - m_TextureSurf.width() / 2;
194 int y = rect.top + ((rect.bottom - rect.top) / 2) - m_TextureSurf.height() / 2;
195
196 Desktop_surf->blt(x, y, &m_TextureSurf);
197
198 // Do slider values
199 m_frequency = 255 - m_frequency_slider.GetPos();
200 m_height = m_height_slider.GetPos();
201 m_size = m_size_slider.GetPos();
202
203 GameTextures[n].procedural->light = m_light_slider.GetPos();
204 GameTextures[n].procedural->thickness = m_thickness_slider.GetPos();
205
206 PrintValue(IDC_SIZE_TEXT, m_size);
207 PrintValue(IDC_HEIGHT_TEXT, m_height);
208 PrintValue(IDC_FREQ_TEXT, 255 - m_frequency);
209 PrintValue(IDC_LIGHT_TEXT, GameTextures[n].procedural->light);
210 PrintValue(IDC_THICKNESS_TEXT, GameTextures[n].procedural->thickness);
211}
212
213void CWaterProceduralDialog::OnTimer(UINT nIDEvent) {
214 // TODO: Add your message handler code here and/or call default

Callers

nothing calls this directly

Calls 8

GetTextureBitmapFunction · 0.85
bm_ScaleBitmapToBitmapFunction · 0.85
attach_to_windowMethod · 0.80
loadMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
bltMethod · 0.45
GetPosMethod · 0.45

Tested by

no test coverage detected