| 315 | } |
| 316 | |
| 317 | void 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 | |
| 371 | void DisplayOptionsVideo::OnButtonClicked(int idc) |
| 372 | { |
nothing calls this directly
no test coverage detected