MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / OnSliderPosChanged

Method OnSliderPosChanged

engine/Poseidon/UI/OptionsUIImplVideo.cpp:317–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void DisplayOptionsVideo::OnSliderPosChanged(int idc, float pos)
318{
319 C3DStatic* ctrl;
320 char buffer[128];
321 switch (idc)
322 {
323 case IDC_OPTIONS_GAMMA_SLIDER:
324 GEngine->SetGamma(pos);
325 ctrl = dynamic_cast<C3DStatic*>(GetCtrl(IDC_OPTIONS_GAMMA_VALUE));
326 snprintf(buffer, sizeof(buffer), "%.1f", pos);
327 if (ctrl)
328 {
329 ctrl->SetText(buffer);
330 }
331 break;
332 case IDC_OPTIONS_BRIGHT_SLIDER:
333 GEngine->SetBrightness(pos);
334 ctrl = dynamic_cast<C3DStatic*>(GetCtrl(IDC_OPTIONS_BRIGHT_VALUE));
335 snprintf(buffer, sizeof(buffer), "%.1f", pos);
336 if (ctrl)
337 {
338 ctrl->SetText(buffer);
339 }
340 break;
341 case IDC_OPTIONS_RATE_SLIDER:
342 GScene->SetFrameRateSettings(pos);
343 ctrl = dynamic_cast<C3DStatic*>(GetCtrl(IDC_OPTIONS_RATE_VALUE));
344 if (ctrl)
345 {
346 ctrl->SetText(GScene->GetFrameRateText());
347 }
348 break;
349 case IDC_OPTIONS_QUALITY_SLIDER:
350 GScene->SetQualitySettings(exp(-pos));
351 ctrl = dynamic_cast<C3DStatic*>(GetCtrl(IDC_OPTIONS_QUALITY_VALUE));
352 if (ctrl)
353 {
354 ctrl->SetText(GScene->GetQualityText());
355 }
356 break;
357 case IDC_OPTIONS_VISIBILITY_SLIDER:
358 GScene->SetPreferredViewDistance(exp(pos));
359 ctrl = dynamic_cast<C3DStatic*>(GetCtrl(IDC_OPTIONS_VISIBILITY_VALUE));
360 char buffer[256];
361 snprintf(buffer, sizeof(buffer), "%.0f", GScene->GetPreferredViewDistance());
362 if (ctrl)
363 {
364 ctrl->SetText(buffer);
365 }
366 UpdateTerrainGrids();
367 break;
368 }
369}
370
371void DisplayOptionsVideo::OnButtonClicked(int idc)
372{

Callers

nothing calls this directly

Calls 14

GetCtrlFunction · 0.85
SetFrameRateSettingsMethod · 0.80
GetFrameRateTextMethod · 0.80
SetQualitySettingsMethod · 0.80
GetQualityTextMethod · 0.80
SetGammaMethod · 0.45
SetTextMethod · 0.45
SetBrightnessMethod · 0.45
SetCDVolumeMethod · 0.45
StartPreviewMethod · 0.45

Tested by

no test coverage detected