|
@@ -35,6 +35,10 @@ constexpr Range<std::int8_t> kAudioVolume{0, 10};
|
|
|
|
|
|
|
|
/** Brightness stores the 7 menu choices, 0 to 6. */
|
|
/** Brightness stores the 7 menu choices, 0 to 6. */
|
|
|
constexpr Range<std::int8_t> kBrightness{0, 6};
|
|
constexpr Range<std::int8_t> kBrightness{0, 6};
|
|
|
|
|
+/** VSync stores the DXGI presentation interval from 0 to 4. */
|
|
|
|
|
+constexpr Range<std::uint8_t> kVerticalSyncInterval{0, 4};
|
|
|
|
|
+/** Field of view exposes the 55 through 105 degree range. */
|
|
|
|
|
+constexpr Range<std::int32_t> kFieldOfView{55, 105};
|
|
|
/** The first unidentified calibration field uses the working renderer fallback. */
|
|
/** The first unidentified calibration field uses the working renderer fallback. */
|
|
|
constexpr float kCalibrationPrimary = 10000.0F;
|
|
constexpr float kCalibrationPrimary = 10000.0F;
|
|
|
/** The second unidentified calibration field uses the working renderer alpha. */
|
|
/** The second unidentified calibration field uses the working renderer alpha. */
|
|
@@ -116,6 +120,8 @@ template <typename Value, std::size_t Count>
|
|
|
*/
|
|
*/
|
|
|
[[nodiscard]] bool valid_display(const Display& value) noexcept {
|
|
[[nodiscard]] bool valid_display(const Display& value) noexcept {
|
|
|
return within(value.brightness, kBrightness) && within(value.hdrMode, kTwoChoiceSelector)
|
|
return within(value.brightness, kBrightness) && within(value.hdrMode, kTwoChoiceSelector)
|
|
|
|
|
+ && within(value.verticalSyncInterval, kVerticalSyncInterval)
|
|
|
|
|
+ && within(value.fieldOfView, kFieldOfView)
|
|
|
&& value.calibrationPrimary == kCalibrationPrimary
|
|
&& value.calibrationPrimary == kCalibrationPrimary
|
|
|
&& value.calibrationAlpha == kCalibrationAlpha;
|
|
&& value.calibrationAlpha == kCalibrationAlpha;
|
|
|
}
|
|
}
|
|
@@ -155,9 +161,12 @@ template <typename Value, std::size_t Count>
|
|
|
|
|
|
|
|
/** Checks a whole account-settings object against the supported menu domains. */
|
|
/** Checks a whole account-settings object against the supported menu domains. */
|
|
|
bool valid(const AccountSettings& value) noexcept {
|
|
bool valid(const AccountSettings& value) noexcept {
|
|
|
- return value.configured && value.keyBindings.configured && valid_controls(value.controls)
|
|
|
|
|
- && valid_audio(value.audio) && valid_display(value.display)
|
|
|
|
|
- && valid_interface(value.interface) && valid_social(value.social);
|
|
|
|
|
|
|
+ const bool validBindingSource = value.keyBindingSource == KeyBindingSource::account
|
|
|
|
|
+ || value.keyBindingSource == KeyBindingSource::computer;
|
|
|
|
|
+ return value.configured && value.keyBindings.configured && validBindingSource
|
|
|
|
|
+ && valid_controls(value.controls) && valid_audio(value.audio)
|
|
|
|
|
+ && valid_display(value.display) && valid_interface(value.interface)
|
|
|
|
|
+ && valid_social(value.social);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} // namespace sunrise::state::account::settings
|
|
} // namespace sunrise::state::account::settings
|