Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -214,8 +214,8 @@ configuration::configuration(xr::system & system)
|
||||
if (auto val = root["resolution_scale"]; val.is_double())
|
||||
resolution_scale = val.get_double();
|
||||
|
||||
if (auto val = root["sgsr"]; val.is_object())
|
||||
parse_sgsr_options(val.get_object());
|
||||
if (auto val = root["enable_stream_gui"]; val.is_bool())
|
||||
enable_stream_gui = val.get_bool();
|
||||
|
||||
if (auto val = root["openxr_post_processing"]; val.is_object())
|
||||
parse_openxr_post_processing_options(val.get_object());
|
||||
@@ -254,6 +254,9 @@ configuration::configuration(xr::system & system)
|
||||
|
||||
if (auto val = root["first_run"]; val.is_bool())
|
||||
first_run = val.get_bool();
|
||||
|
||||
if (auto val = root["locale"]; val.is_string())
|
||||
locale = val.get_string().value();
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
@@ -264,31 +267,11 @@ configuration::configuration(xr::system & system)
|
||||
preferred_refresh_rate.reset();
|
||||
minimum_refresh_rate.reset();
|
||||
resolution_scale = 1.4;
|
||||
sgsr = {};
|
||||
openxr_post_processing = {};
|
||||
passthrough_enabled = system.passthrough_supported() == xr::system::passthrough_type::color;
|
||||
}
|
||||
}
|
||||
|
||||
void configuration::parse_sgsr_options(simdjson::simdjson_result<simdjson::dom::object> sgsr_root)
|
||||
{
|
||||
sgsr = {};
|
||||
if (auto val = sgsr_root["enabled"]; val.is_bool())
|
||||
sgsr.enabled = val.get_bool();
|
||||
|
||||
if (auto val = sgsr_root["upscaling_factor"]; val.is_double())
|
||||
sgsr.upscaling_factor = val.get_double();
|
||||
|
||||
if (auto val = sgsr_root["use_edge_direction"]; val.is_bool())
|
||||
sgsr.use_edge_direction = val.get_bool();
|
||||
|
||||
if (auto val = sgsr_root["edge_threshold"]; val.is_double())
|
||||
sgsr.edge_threshold = val.get_double();
|
||||
|
||||
if (auto val = sgsr_root["edge_sharpness"]; val.is_double())
|
||||
sgsr.edge_sharpness = val.get_double();
|
||||
}
|
||||
|
||||
void configuration::parse_openxr_post_processing_options(simdjson::simdjson_result<simdjson::dom::object> openxr_post_processing_root)
|
||||
{
|
||||
openxr_post_processing = {};
|
||||
@@ -304,17 +287,6 @@ static std::ostream & operator<<(std::ostream & stream, feature f)
|
||||
return stream << "\"" << magic_enum::enum_name(f) << "\"";
|
||||
}
|
||||
|
||||
static std::ostream & write_sgsr(std::ofstream & stream, const configuration::sgsr_settings & sgsr)
|
||||
{
|
||||
stream << "{\"enabled\":" << std::boolalpha << sgsr.enabled;
|
||||
stream << ",\"upscaling_factor\":" << sgsr.upscaling_factor;
|
||||
stream << ",\"use_edge_direction\":" << std::boolalpha << sgsr.use_edge_direction;
|
||||
stream << ",\"edge_threshold\":" << sgsr.edge_threshold;
|
||||
stream << ",\"edge_sharpness\":" << sgsr.edge_sharpness;
|
||||
stream << "}";
|
||||
return stream;
|
||||
}
|
||||
|
||||
static std::ostream & write_openxr_post_processing(std::ofstream & stream, const configuration::openxr_post_processing_settings & openxr_post_processing)
|
||||
{
|
||||
stream << "{\"super_sampling\":" << openxr_post_processing.super_sampling;
|
||||
@@ -357,8 +329,6 @@ void configuration::save()
|
||||
if (minimum_refresh_rate)
|
||||
json << ",\"minimum_refresh_rate\":" << *minimum_refresh_rate;
|
||||
json << ",\"resolution_scale\":" << resolution_scale;
|
||||
json << ",\"sgsr\":";
|
||||
write_sgsr(json, sgsr);
|
||||
json << ",\"openxr_post_processing\":";
|
||||
write_openxr_post_processing(json, openxr_post_processing);
|
||||
json << ",\"passthrough_enabled\":" << std::boolalpha << passthrough_enabled;
|
||||
@@ -372,5 +342,6 @@ void configuration::save()
|
||||
json << ",\"override_foveation_pitch\":" << override_foveation_pitch;
|
||||
json << ",\"override_foveation_distance\":" << override_foveation_distance;
|
||||
json << ",\"first_run\":" << std::boolalpha << first_run;
|
||||
json << ",\"locale\":" << json_string(locale);
|
||||
json << "}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user