MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / HandleDisplaySettingsInput

Method HandleDisplaySettingsInput

TombEngine/Game/gui.cpp:480–677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478 }
479
480 void GuiController::HandleDisplaySettingsInput(bool fromPauseMenu)
481 {
482 enum DisplaySettingsOption
483 {
484 ScreenResolution,
485 Windowed,
486 ShadowType,
487 Caustics,
488 Decals,
489 Antialiasing,
490 AmbientOcclusion,
491 HighFramerate,
492 Save,
493 Cancel,
494
495 Count
496 };
497
498 OptionCount = (int)DisplaySettingsOption::Count - 1;
499
500 if (GuiIsPulsed(In::Left))
501 {
502 switch (SelectedOption)
503 {
504 case DisplaySettingsOption::ScreenResolution:
505 SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always);
506 if (CurrentSettings.SelectedScreenResolution > 0)
507 CurrentSettings.SelectedScreenResolution--;
508
509 break;
510
511 case DisplaySettingsOption::Windowed:
512 SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always);
513 CurrentSettings.Configuration.EnableWindowedMode = !CurrentSettings.Configuration.EnableWindowedMode;
514 break;
515
516 case DisplaySettingsOption::ShadowType:
517 SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always);
518
519 if (CurrentSettings.Configuration.ShadowType == ShadowMode::None)
520 CurrentSettings.Configuration.ShadowType = ShadowMode::All;
521 else
522 CurrentSettings.Configuration.ShadowType = ShadowMode(int(CurrentSettings.Configuration.ShadowType) - 1);
523
524 break;
525
526 case DisplaySettingsOption::Caustics:
527 SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always);
528 CurrentSettings.Configuration.EnableCaustics = !CurrentSettings.Configuration.EnableCaustics;
529 break;
530
531 case DisplaySettingsOption::Decals:
532 SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always);
533 CurrentSettings.Configuration.EnableDecals = !CurrentSettings.Configuration.EnableDecals;
534 break;
535
536 case DisplaySettingsOption::Antialiasing:
537 SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always);

Callers

nothing calls this directly

Calls 9

SoundEffectFunction · 0.85
ShadowModeEnum · 0.85
AntialiasingModeEnum · 0.85
SaveConfigurationFunction · 0.85
GetSettingsMethod · 0.80
ReloadShadersMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected