cleaned up dead code

This commit is contained in:
ykeara
2019-01-08 22:46:30 -06:00
parent 123c38c586
commit b374ff42f5
3 changed files with 74 additions and 303 deletions
+9 -39
View File
@@ -68,11 +68,11 @@ MyStackViewPage {
Layout.leftMargin: 32
text: "Supersample Filtering"
}
//MyToggleButton {
// id: steamvrNewProfileIncludeReprojectionSettingsg
// Layout.leftMargin: 32
// text: "Reprojection Settings"
//}
MyToggleButton {
id: steamvrNewProfileIncludeMotionSmoothing
Layout.leftMargin: 32
text: "Motion Smoothing Setting"
}
}
onClosed: {
if (okClicked) {
@@ -80,13 +80,13 @@ MyStackViewPage {
steamvrMessageDialog.showMessage("Create New Profile", "ERROR: Empty profile name.")
} else if (!steamvrNewProfileIncludeSupersampling.checked
&& !steamvrNewProfileIncludeSupersampleFiltering.checked
) {
&& !steamvrNewProfileIncludeMotionSmoothing.checked) {
steamvrMessageDialog.showMessage("Create New Profile", "ERROR: Nothing included.")
} else {
SteamVRTabController.addSteamVRProfile(steamvrNewProfileName.text,
steamvrNewProfileIncludeSupersampling.checked,
steamvrNewProfileIncludeSupersampleFiltering.checked
// steamvrNewProfileIncludeReprojectionSettingsg.checked
steamvrNewProfileIncludeSupersampleFiltering.checked,
steamvrNewProfileIncludeMotionSmoothing.checked
)
}
@@ -96,7 +96,7 @@ MyStackViewPage {
steamvrNewProfileName.text = ""
steamvrNewProfileIncludeSupersampling.checked = false
steamvrNewProfileIncludeSupersampleFiltering.checked = false
//steamvrNewProfileIncludeReprojectionSettingsg.checked = false
steamvrNewProfileIncludeMotionSmoothing.checked = false
open()
}
}
@@ -142,7 +142,6 @@ MyStackViewPage {
onClicked: {
if (steamvrProfileComboBox.currentIndex > 0) {
SteamVRTabController.applySteamVRProfile(steamvrProfileComboBox.currentIndex - 1)
//steamvrProfileComboBox.currentIndex = 0
}
}
}
@@ -324,32 +323,6 @@ MyStackViewPage {
}
}
//No longer Valid
/*
MyToggleButton {
id: steamvrAllowAsyncReprojectionToggle
text: "Allow Asynchronous Reprojection"
onCheckedChanged: {
SteamVRTabController.setAllowAsyncReprojection(this.checked, false)
}
}
MyToggleButton {
id: steamvrAllowInterleavedReprojectionToggle
text: "Allow Interleaved Reprojection"
onCheckedChanged: {
SteamVRTabController.setAllowInterleavedReprojection(this.checked, false)
}
}
MyToggleButton {
id: steamvrForceReprojectionToggle
text: "Enable Always-on Reprojection"
onCheckedChanged: {
SteamVRTabController.setForceReprojection(this.checked, false)
}
}
*/
Item { Layout.fillHeight: true; Layout.fillWidth: true}
MyText {
@@ -395,9 +368,6 @@ MyStackViewPage {
}
steamvrCompositorSupersamplingText.text = s2
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
//steamvrAllowInterleavedReprojectionToggle.checked = SteamVRTabController.allowInterleavedReprojection
//steamvrAllowAsyncReprojectionToggle.checked = SteamVRTabController.allowAsyncReprojection
//steamvrForceReprojectionToggle.checked = SteamVRTabController.forceReprojection
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
reloadSteamVRProfiles()
}
+30 -202
View File
@@ -75,20 +75,13 @@ void SteamVRTabController::reloadSteamVRProfiles()
entry.supersampleFiltering
= settings->value( "supersampleFiltering", true ).toBool();
}
entry.motionSmooth = settings->value("motionSmooth", true).toBool();
/*
entry.includesReprojectionSettings
= settings->value( "includesReprojectionSettings", false ).toBool();
if ( entry.includesReprojectionSettings )
entry.includesMotionSmoothing
= settings->value( "includesMotionSmoothing", false ).toBool();
if ( entry.includesMotionSmoothing )
{
entry.asynchronousReprojection
= settings->value( "asynchronousReprojection", true ).toBool();
entry.interleavedReprojection
= settings->value( "interleavedReprojection", true ).toBool();
entry.alwaysOnReprojection
= settings->value( "alwaysOnReprojection", true ).toBool();
entry.motionSmooth
= settings->value( "motionSmooth", true ).toBool();
}
*/
}
settings->endArray();
settings->endGroup();
@@ -117,20 +110,13 @@ void SteamVRTabController::saveSteamVRProfiles()
settings->setValue( "supersampleFiltering",
p.supersampleFiltering );
}
settings->setValue("motionSmooth", p.motionSmooth);
/*
settings->setValue( "includesReprojectionSettings",
p.includesReprojectionSettings );
if ( p.includesReprojectionSettings )
settings->setValue( "includesMotionSmoothing",
p.includesMotionSmoothing );
if ( p.includesMotionSmoothing )
{
settings->setValue( "asynchronousReprojection",
p.asynchronousReprojection );
settings->setValue( "interleavedReprojection",
p.interleavedReprojection );
settings->setValue( "alwaysOnReprojection",
p.alwaysOnReprojection );
settings->setValue( "motionSmooth", p.motionSmooth );
}
*/
i++;
}
settings->endArray();
@@ -217,47 +203,6 @@ void SteamVRTabController::eventLoopTick()
<< m_compositorSuperSampling << " => " << css;
setCompositorSuperSampling( css );
}
/*
auto air = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowReprojection_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_AllowReprojection_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowInterleavedReprojection( air );
auto aar = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowAsyncReprojection_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_AllowAsyncReprojection_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowAsyncReprojection( aar );
auto fr = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_ForceReprojection_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_ForceReprojection_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setForceReprojection( fr );
*/
auto sf = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vrsettings_steamvr_allowSupersampleFiltering,
@@ -343,9 +288,8 @@ float SteamVRTabController::compositorSuperSampling() const
return m_compositorSuperSampling;
}
bool SteamVRTabController::motionSmoothing() const {
bool SteamVRTabController::motionSmoothing() const
{
return m_motionSmoothing;
}
@@ -362,8 +306,7 @@ Description:
sets value of m_motionSmoothing AND applies changes in Steam/OpenVr
*/
void SteamVRTabController::setMotionSmoothing(bool value,
bool notify)
void SteamVRTabController::setMotionSmoothing( bool value, bool notify )
{
if ( m_motionSmoothing != value )
{
@@ -374,8 +317,7 @@ void SteamVRTabController::setMotionSmoothing(bool value,
vr::VRSettings()->Sync();
if ( notify )
{
emit motionSmoothingChanged(
m_motionSmoothing);
emit motionSmoothingChanged( m_motionSmoothing );
}
}
}
@@ -391,95 +333,30 @@ Sets the member variable of motion smoothing for UI
Adds error to log if unable to find variable.
OnError:
default value of true for motion smoothing is initialized, if user has disabled motion smoothing on their end,
they will have to toggle the variable twice to get it to re-sync.
default value of true for motion smoothing is initialized, if user has disabled
motion smoothing on their end, they will have to toggle the variable twice to
get it to re-sync.
*/
void SteamVRTabController::initMotionSmoothing() {
void SteamVRTabController::initMotionSmoothing()
{
bool temporary = false;
vr::EVRSettingsError vrSettingsError;
temporary = vr::VRSettings()->GetBool(vr::k_pch_SteamVR_Section,
temporary
= vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_MotionSmoothing_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not get MotionSmoothing State \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool << "\" setting: "
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->Sync();
setMotionSmoothing( temporary, true );
}
/*
bool SteamVRTabController::allowInterleavedReprojection() const
{
return m_allowInterleavedReprojection;
}
bool SteamVRTabController::allowAsyncReprojection() const
{
return m_allowAsyncReprojection;
}
void SteamVRTabController::setAllowInterleavedReprojection( bool value,
bool notify )
{
if ( m_allowInterleavedReprojection != value )
{
m_allowInterleavedReprojection = value;
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowReprojection_Bool,
m_allowInterleavedReprojection );
vr::VRSettings()->Sync();
if ( notify )
{
emit allowInterleavedReprojectionChanged(
m_allowInterleavedReprojection );
}
}
}
void SteamVRTabController::setAllowAsyncReprojection( bool value, bool notify )
{
if ( m_allowAsyncReprojection != value )
{
m_allowAsyncReprojection = value;
vr::VRSettings()->SetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowAsyncReprojection_Bool,
m_allowAsyncReprojection );
vr::VRSettings()->Sync();
if ( notify )
{
emit allowAsyncReprojectionChanged( m_allowAsyncReprojection );
}
}
}
bool SteamVRTabController::forceReprojection() const
{
return m_forceReprojection;
}
void SteamVRTabController::setForceReprojection( bool value, bool notify )
{
if ( m_forceReprojection != value )
{
m_forceReprojection = value;
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_ForceReprojection_Bool,
m_forceReprojection );
vr::VRSettings()->Sync();
if ( notify )
{
emit forceReprojectionChanged( m_forceReprojection );
}
}
}
*/
bool SteamVRTabController::allowSupersampleFiltering() const
{
return m_allowSupersampleFiltering;
@@ -532,47 +409,7 @@ void SteamVRTabController::reset()
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
/*
vr::VRSettings()->RemoveKeyInSection(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowReprojection_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_SteamVR_AllowReprojection_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->RemoveKeyInSection(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_AllowAsyncReprojection_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_SteamVR_AllowAsyncReprojection_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
vr::VRSettings()->RemoveKeyInSection(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_ForceReprojection_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not remove \""
<< vr::k_pch_SteamVR_ForceReprojection_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
*/
vr::VRSettings()->RemoveKeyInSection(
vr::k_pch_SteamVR_Section,
vrsettings_steamvr_allowSupersampleFiltering,
@@ -601,7 +438,8 @@ void SteamVRTabController::restartSteamVR()
void SteamVRTabController::addSteamVRProfile( QString name,
bool includeSupersampling,
bool includeSupersampleFiltering)
bool includeSupersampleFiltering,
bool includeMotionSmoothing )
{
SteamVRProfile* profile = nullptr;
for ( auto& p : steamvrProfiles )
@@ -629,16 +467,11 @@ void SteamVRTabController::addSteamVRProfile( QString name,
{
profile->supersampleFiltering = m_allowSupersampleFiltering;
}
profile->motionSmooth = m_motionSmoothing;
/*
profile->includesReprojectionSettings = includeReprojectionSettings;
if ( includeReprojectionSettings )
profile->includesMotionSmoothing = includeMotionSmoothing;
if ( includeMotionSmoothing )
{
profile->asynchronousReprojection = m_allowAsyncReprojection;
profile->interleavedReprojection = m_allowInterleavedReprojection;
profile->alwaysOnReprojection = m_forceReprojection;
profile->motionSmooth = m_motionSmoothing;
}
*/
saveSteamVRProfiles();
OverlayController::appSettings()->sync();
emit steamVRProfilesUpdated();
@@ -658,15 +491,10 @@ void SteamVRTabController::applySteamVRProfile( unsigned index )
{
setAllowSupersampleFiltering( profile.supersampleFiltering );
}
setMotionSmoothing(profile.motionSmooth);
/*
if ( profile.includesReprojectionSettings )
if ( profile.includesMotionSmoothing )
{
setAllowAsyncReprojection( profile.asynchronousReprojection );
setAllowInterleavedReprojection( profile.interleavedReprojection );
setForceReprojection( profile.alwaysOnReprojection );
setMotionSmoothing( profile.motionSmooth );
}
*/
vr::VRSettings()->Sync( true );
}
}
+5 -32
View File
@@ -20,11 +20,7 @@ struct SteamVRProfile
bool includesSupersampleFiltering = false;
bool supersampleFiltering = false;
bool motionSmooth = false;
//bool includesReprojectionSettings = false;
//bool asynchronousReprojection = true;
//bool interleavedReprojection = true;
//bool alwaysOnReprojection = true;
bool includesMotionSmoothing = false;
};
class SteamVRTabController : public QObject
@@ -35,21 +31,9 @@ class SteamVRTabController : public QObject
Q_PROPERTY(
float compositorSuperSampling READ compositorSuperSampling WRITE
setCompositorSuperSampling NOTIFY compositorSuperSamplingChanged )
/*
Q_PROPERTY(
bool allowInterleavedReprojection READ allowInterleavedReprojection
WRITE setAllowInterleavedReprojection NOTIFY
allowInterleavedReprojectionChanged )
Q_PROPERTY(
bool allowAsyncReprojection READ allowAsyncReprojection WRITE
setAllowAsyncReprojection NOTIFY allowAsyncReprojectionChanged )
Q_PROPERTY( bool forceReprojection READ forceReprojection WRITE
setForceReprojection NOTIFY forceReprojectionChanged )
*/
Q_PROPERTY(bool motionSmoothing READ motionSmoothing
WRITE setMotionSmoothing NOTIFY
motionSmoothingChanged)
Q_PROPERTY( bool motionSmoothing READ motionSmoothing WRITE
setMotionSmoothing NOTIFY motionSmoothingChanged )
Q_PROPERTY( bool allowSupersampleFiltering READ allowSupersampleFiltering
WRITE setAllowSupersampleFiltering NOTIFY
allowSupersampleFilteringChanged )
@@ -60,9 +44,6 @@ private:
float m_superSampling = 1.0;
float m_compositorSuperSampling = 1.0;
//bool m_allowInterleavedReprojection = true;
//bool m_allowAsyncReprojection = true;
//bool m_forceReprojection = false;
bool m_motionSmoothing = true;
bool m_allowSupersampleFiltering = true;
@@ -80,9 +61,6 @@ public:
float superSampling() const;
float compositorSuperSampling() const;
//bool allowInterleavedReprojection() const;
//bool allowAsyncReprojection() const;
//bool forceReprojection() const;
bool motionSmoothing() const;
bool allowSupersampleFiltering() const;
@@ -95,15 +73,13 @@ public:
public slots:
void setSuperSampling( float value, bool notify = true );
void setCompositorSuperSampling( float value, bool notify = true );
//void setAllowInterleavedReprojection( bool value, bool notify = true );
//void setAllowAsyncReprojection( bool value, bool notify = true );
//void setForceReprojection( bool value, bool notify = true );
void setMotionSmoothing( bool value, bool notify = true );
void setAllowSupersampleFiltering( bool value, bool notify = true );
void addSteamVRProfile( QString name,
bool includeSupersampling,
bool includeSupersampleFiltering);
bool includeSupersampleFiltering,
bool includeMotionSmoothing );
void applySteamVRProfile( unsigned index );
void deleteSteamVRProfile( unsigned index );
@@ -113,9 +89,6 @@ public slots:
signals:
void superSamplingChanged( float value );
void compositorSuperSamplingChanged( float value );
//void allowInterleavedReprojectionChanged( bool value );
//void allowAsyncReprojectionChanged( bool value );
//void forceReprojectionChanged( bool value );
void motionSmoothingChanged( bool value );
void allowSupersampleFilteringChanged( bool value );