mirror of
https://github.com/mitch030504/Wiicompiled_VR_Frame.git
synced 2026-10-06 10:00:27 +02:00
Added Desktop view selector
This commit is contained in:
1 parent
a138670b37
commit
4cf9f60ee7
7 files changed
+260
-16
No files matched your search
@@ -56,6 +56,7 @@ struct RuntimeUserConfig {
|
||||
std::optional<bool> vrHudVirtualScreen;
|
||||
std::optional<bool> vrStopAtDisplayCopy;
|
||||
std::optional<bool> vrSkipCopyClears;
|
||||
std::optional<std::string> vrMirrorView;
|
||||
std::optional<bool> vrFirstPerson;
|
||||
std::optional<float> vrFirstPersonUnitsPerMeter;
|
||||
std::optional<float> vrFirstPersonHeadUpMeters;
|
||||
@@ -158,6 +159,15 @@ inline constexpr const char* kVrFirstPersonRotationDefault = "yaw";
|
||||
inline bool IsSupportedVrFirstPersonRotation(std::string_view value) {
|
||||
return value == "yaw" || value == "yaw_pitch" || value == "full";
|
||||
}
|
||||
// What the desktop window shows while the headset is running: "normal" leaves
|
||||
// the ordinary desktop view alone, "both", "left" and "right" mirror the
|
||||
// headset's eyes, and "none" blacks the window out. Matches
|
||||
// AuroraStereoMirrorView.
|
||||
inline constexpr const char* kVrMirrorViewDefault = "normal";
|
||||
|
||||
inline bool IsSupportedVrMirrorView(std::string_view value) {
|
||||
return value == "normal" || value == "both" || value == "left" || value == "right" || value == "none";
|
||||
}
|
||||
// SDL scancode name, spelled the way SDL_GetScancodeName produces it. An
|
||||
// empty string leaves the recenter hotkey unbound, menu button only.
|
||||
inline constexpr std::string_view kVrRecenterKeyDefault = "F9";
|
||||
@@ -360,6 +370,11 @@ inline void EnsureConfigFile() {
|
||||
"# to the ordinary desktop renderer. These values are read at launch.\n"
|
||||
"enabled = false\n"
|
||||
"required = false\n"
|
||||
"# What the desktop window shows while the headset is running:\n"
|
||||
"# \"normal\" keeps the ordinary desktop view, \"both\", \"left\" and\n"
|
||||
"# \"right\" mirror the headset's eyes, and \"none\" blacks the window\n"
|
||||
"# out. Changeable live from the F10 menu.\n"
|
||||
"mirror_view = \"normal\"\n"
|
||||
"render_scale = 1.0\n"
|
||||
"world_units_per_meter = 500.0\n"
|
||||
"hud_distance_meters = 2.0\n"
|
||||
@@ -616,6 +631,10 @@ inline RuntimeUserConfig ParseConfigDocument(const toml::value& document) {
|
||||
value && IsSupportedVrFirstPersonRotation(*value)) {
|
||||
config.vrFirstPersonRotation = *value;
|
||||
}
|
||||
if (auto value = FindConfigValue<std::string>(document, "vr", "mirror_view");
|
||||
value && IsSupportedVrMirrorView(*value)) {
|
||||
config.vrMirrorView = *value;
|
||||
}
|
||||
if (auto value = FindConfigInt(document, "vr", "first_person_hidden_model");
|
||||
value && *value >= -1 && *value <= 31) {
|
||||
config.vrFirstPersonHiddenModel = static_cast<int32_t>(*value);
|
||||
@@ -909,6 +928,14 @@ inline bool SetVrFirstPersonHideDriver(bool value) {
|
||||
return WriteSetting("vr", "first_person_hide_driver", value ? "true" : "false");
|
||||
}
|
||||
|
||||
inline bool SetVrMirrorView(std::string value) {
|
||||
if (!IsSupportedVrMirrorView(value)) {
|
||||
return false;
|
||||
}
|
||||
Mutable().vrMirrorView = value;
|
||||
return WriteSetting("vr", "mirror_view", FormatString(value));
|
||||
}
|
||||
|
||||
inline bool SetVrFirstPersonRotation(std::string value) {
|
||||
if (!IsSupportedVrFirstPersonRotation(value)) {
|
||||
return false;
|
||||
@@ -1236,6 +1263,11 @@ inline bool VrFirstPersonHideDriver(bool fallback = kVrFirstPersonHideDriverDefa
|
||||
return Get().vrFirstPersonHideDriver.value_or(fallback);
|
||||
}
|
||||
|
||||
inline std::string VrMirrorView(std::string fallback = kVrMirrorViewDefault) {
|
||||
const auto& value = Get().vrMirrorView;
|
||||
return value && IsSupportedVrMirrorView(*value) ? *value : std::move(fallback);
|
||||
}
|
||||
|
||||
inline std::string VrFirstPersonRotation(std::string fallback = kVrFirstPersonRotationDefault) {
|
||||
const auto& value = Get().vrFirstPersonRotation;
|
||||
return value && IsSupportedVrFirstPersonRotation(*value) ? *value : std::move(fallback);
|
||||
|
||||
Reference in new issue
Block a user