fixed naming bug in QML and formatted/cleaned up
This commit is contained in:
@@ -239,75 +239,6 @@ MyStackViewPage {
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
RowLayout {
|
||||
spacing: 16
|
||||
|
||||
MyText {
|
||||
text: "Compositor Render Target Multiplier*:"
|
||||
Layout.preferredWidth: 450
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
|
||||
MyPushButton2 {
|
||||
text: "-"
|
||||
Layout.preferredWidth: 40
|
||||
onClicked: {
|
||||
steamvrCompositorSupersamplingSlider.decrease()
|
||||
}
|
||||
}
|
||||
|
||||
MySlider {
|
||||
id: steamvrCompositorSupersamplingSlider
|
||||
from: 0.1
|
||||
to: 2
|
||||
stepSize: 0.1
|
||||
value: 1.0
|
||||
snapMode: Slider.SnapAlways
|
||||
Layout.fillWidth: true
|
||||
onPositionChanged: {
|
||||
var val = this.from + ( this.position * (this.to - this.from))
|
||||
steamvrCompositorSupersamplingText.text = val.toFixed(1)
|
||||
}
|
||||
onValueChanged: {
|
||||
SteamVRTabController.setCompositorSuperSampling(this.value.toFixed(1), false)
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton2 {
|
||||
text: "+"
|
||||
Layout.preferredWidth: 40
|
||||
onClicked: {
|
||||
steamvrCompositorSupersamplingSlider.increase()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MyTextField {
|
||||
id: steamvrCompositorSupersamplingText
|
||||
text: "0.0"
|
||||
keyBoardUID: 402
|
||||
Layout.preferredWidth: 100
|
||||
Layout.leftMargin: 10
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
function onInputEvent(input) {
|
||||
var val = parseFloat(input)
|
||||
if (!isNaN(val)) {
|
||||
if (val < 0.1) {
|
||||
val = 0.1
|
||||
}
|
||||
var v = val.toFixed(1)
|
||||
if (v <= steamvrCompositorSupersamplingSlider.to) {
|
||||
steamvrCompositorSupersamplingSlider.value = v
|
||||
} else {
|
||||
SteamVRTabController.setCompositorSuperSampling(v, false)
|
||||
}
|
||||
}
|
||||
text = SteamVRTabController.compositorSuperSampling.toFixed(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
MyToggleButton {
|
||||
id: steamvrAllowSupersampleFilteringToggle
|
||||
text: "Enable Advanced Supersample Filtering"
|
||||
@@ -362,12 +293,6 @@ MyStackViewPage {
|
||||
if (s1 <= steamvrSupersamplingSlider.to) {
|
||||
steamvrSupersamplingSlider.value = s1
|
||||
}
|
||||
steamvrSupersamplingText.text = s1
|
||||
var s2 = SteamVRTabController.compositorSuperSampling.toFixed(1)
|
||||
if (s2 <= steamvrCompositorSupersamplingSlider.to) {
|
||||
steamvrCompositorSupersamplingSlider.value = s2
|
||||
}
|
||||
steamvrCompositorSupersamplingText.text = s2
|
||||
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
|
||||
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
|
||||
reloadSteamVRProfiles()
|
||||
@@ -382,32 +307,12 @@ MyStackViewPage {
|
||||
}
|
||||
steamvrSupersamplingText.text = s1
|
||||
}
|
||||
/*
|
||||
onCompositorSuperSamplingChanged: {
|
||||
var s2 = SteamVRTabController.compositorSuperSampling.toFixed(1)
|
||||
if (s2 <= steamvrCompositorSupersamplingSlider.to && Math.abs(steamvrCompositorSupersamplingSlider.value-s2) > 0.08) {
|
||||
steamvrCompositorSupersamplingSlider.value = s2
|
||||
}
|
||||
steamvrCompositorSupersamplingText.text = s2
|
||||
}
|
||||
*/
|
||||
onAllowSupersampleFilteringChanged: {
|
||||
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
|
||||
}
|
||||
/*
|
||||
onAllowInterleavedReprojectionChanged: {
|
||||
steamvrAllowInterleavedReprojectionToggle.checked = SteamVRTabController.allowInterleavedReprojection
|
||||
}
|
||||
onAllowAsyncReprojectionChanged: {
|
||||
steamvrAllowAsyncReprojectionToggle.checked = SteamVRTabController.allowAsyncReprojection
|
||||
}
|
||||
onForceReprojectionChanged: {
|
||||
steamvrForceReprojectionToggle.checked = SteamVRTabController.forceReprojection
|
||||
}
|
||||
*/
|
||||
|
||||
onMotionSmoothingChanged: {
|
||||
steamvrMotionSmoothingToggle.checked = SteamVRTabController.allowMotionSmoothing
|
||||
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
|
||||
}
|
||||
|
||||
onSteamVRProfilesUpdated: {
|
||||
|
||||
@@ -30,8 +30,9 @@ namespace advsettings
|
||||
// "allowInterleavedReprojection";
|
||||
|
||||
// static const char* vrsettings_steamvr_supersampleScale = "supersampleScale";
|
||||
//static const char* vrsettings_steamvr_allowSupersampleFiltering = "allowSupersampleFiltering";
|
||||
//static const char* vrsettings_compositor_category = "compositor";
|
||||
// static const char* vrsettings_steamvr_allowSupersampleFiltering =
|
||||
// "allowSupersampleFiltering"; static const char*
|
||||
// vrsettings_compositor_category = "compositor";
|
||||
|
||||
void SteamVRTabController::initStage1()
|
||||
{
|
||||
@@ -139,14 +140,17 @@ Q_INVOKABLE QString
|
||||
return QString::fromStdString( steamvrProfiles[index].profileName );
|
||||
}
|
||||
}
|
||||
//TODO DISC does it make any sense to check these settings once every ~ 1second?
|
||||
// TODO DISC does it make any sense to check these settings once every ~
|
||||
// 1second. primary purpose seems to be to re-sync settings if changed via other
|
||||
// means?
|
||||
void SteamVRTabController::eventLoopTick()
|
||||
{
|
||||
if ( settingsUpdateCounter >= 50 )
|
||||
{
|
||||
vr::EVRSettingsError vrSettingsError;
|
||||
auto ss
|
||||
= vr::VRSettings()->GetFloat( vr::k_pch_SteamVR_Section,
|
||||
// checks supersampling and re-synchs if necessary
|
||||
auto ss = vr::VRSettings()->GetFloat(
|
||||
vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_SupersampleScale_Float,
|
||||
&vrSettingsError );
|
||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||
@@ -170,7 +174,8 @@ void SteamVRTabController::eventLoopTick()
|
||||
<< m_superSampling << " => " << ss;
|
||||
setSuperSampling( ss );
|
||||
}
|
||||
|
||||
// checks if Supersampling filter is on and changes if it has been
|
||||
// changed elsewhere
|
||||
auto sf = vr::VRSettings()->GetBool(
|
||||
vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
||||
@@ -185,9 +190,10 @@ void SteamVRTabController::eventLoopTick()
|
||||
}
|
||||
setAllowSupersampleFiltering( sf );
|
||||
|
||||
//Checks if Motion smoothing setting can be read
|
||||
auto ms = vr::VRSettings()->GetBool(
|
||||
vr::k_pch_SteamVR_Section,
|
||||
// Checks if Motion smoothing setting can be read and synchs adv
|
||||
// settings to steamvr/openvr
|
||||
auto ms
|
||||
= vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_MotionSmoothing_Bool,
|
||||
&vrSettingsError );
|
||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||
@@ -201,7 +207,6 @@ void SteamVRTabController::eventLoopTick()
|
||||
setMotionSmoothing( ms );
|
||||
|
||||
settingsUpdateCounter = 0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -234,46 +239,11 @@ void SteamVRTabController::setSuperSampling( float value, bool notify )
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
void SteamVRTabController::setCompositorSuperSampling( float value,
|
||||
bool notify )
|
||||
{
|
||||
bool override = false;
|
||||
if ( value <= 0.01f )
|
||||
{
|
||||
LOG( WARNING ) << "Encountered a compositor supersampling value <= "
|
||||
"0.01, setting supersampling to 1.0";
|
||||
value = 1.0f;
|
||||
override = true;
|
||||
}
|
||||
if ( override || m_compositorSuperSampling != value )
|
||||
{
|
||||
LOG( DEBUG ) << "Compositor supersampling value changed: "
|
||||
<< m_compositorSuperSampling << " => " << value;
|
||||
m_compositorSuperSampling = value;
|
||||
vr::VRSettings()->SetFloat(
|
||||
vrsettings_compositor_category,
|
||||
vr::k_pch_SteamVR_RenderTargetMultiplier_Float,
|
||||
m_compositorSuperSampling );
|
||||
vr::VRSettings()->Sync();
|
||||
if ( notify )
|
||||
{
|
||||
emit compositorSuperSamplingChanged( m_compositorSuperSampling );
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
float SteamVRTabController::superSampling() const
|
||||
{
|
||||
return m_superSampling;
|
||||
}
|
||||
/*
|
||||
float SteamVRTabController::compositorSuperSampling() const
|
||||
{
|
||||
return m_compositorSuperSampling;
|
||||
}
|
||||
*/
|
||||
|
||||
bool SteamVRTabController::motionSmoothing() const
|
||||
{
|
||||
@@ -355,7 +325,8 @@ void SteamVRTabController::setAllowSupersampleFiltering( bool value,
|
||||
if ( m_allowSupersampleFiltering != value )
|
||||
{
|
||||
m_allowSupersampleFiltering = value;
|
||||
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
|
||||
vr::VRSettings()->SetBool(
|
||||
vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
||||
m_allowSupersampleFiltering );
|
||||
vr::VRSettings()->Sync();
|
||||
@@ -371,33 +342,18 @@ void SteamVRTabController::reset()
|
||||
{
|
||||
vr::EVRSettingsError vrSettingsError;
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection( vr::k_pch_SteamVR_Section,
|
||||
vr::VRSettings()->RemoveKeyInSection(
|
||||
vr::k_pch_SteamVR_Section,
|
||||
vr::k_pch_SteamVR_SupersampleScale_Float,
|
||||
&vrSettingsError );
|
||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||
{
|
||||
LOG( WARNING ) << "Could not remove \""
|
||||
<< vr::k_pch_SteamVR_SupersampleScale_Float << "\" setting: "
|
||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||
vrSettingsError );
|
||||
}
|
||||
|
||||
/*
|
||||
setCompositorSuperSampling( 1.0f ); // Is not in default.vrsettings yet
|
||||
vr::VRSettings()->RemoveKeyInSection(
|
||||
vrsettings_compositor_category,
|
||||
vr::k_pch_SteamVR_RenderTargetMultiplier_Float,
|
||||
&vrSettingsError );
|
||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||
{
|
||||
LOG( WARNING ) << "Could not remove \""
|
||||
<< vrsettings_compositor_category
|
||||
<< "::" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float
|
||||
<< vr::k_pch_SteamVR_SupersampleScale_Float
|
||||
<< "\" setting: "
|
||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||
vrSettingsError );
|
||||
}
|
||||
*/
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(
|
||||
vr::k_pch_SteamVR_Section,
|
||||
|
||||
Reference in New Issue
Block a user