Ssbugs, removal of re-vive, and dashboard loop tick (#277)

* minor changes

* debugging testing

* removed un-needed log calls

* moved some logic to run only when dashboard is active

* fixed linker error

* added casting

* removed revive tab

* removed stray revive reference

* removed revive from sources

* fixed misc formatting issues

* added newline
This commit is contained in:
ykeara
2019-08-22 13:40:48 -05:00
committed by GitHub
parent 1b5e092cc2
commit 746aa23207
18 changed files with 108 additions and 2834 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ void FixFloorTabController::initStage2( OverlayController* var_parent )
this->parent = var_parent;
}
void FixFloorTabController::eventLoopTick(
void FixFloorTabController::dashboardLoopTick(
vr::TrackedDevicePose_t* devicePoses )
{
if ( state > 0 )
@@ -56,6 +56,7 @@ public:
void initStage2( OverlayController* parent );
void eventLoopTick( vr::TrackedDevicePose_t* devicePoses );
void dashboardLoopTick( vr::TrackedDevicePose_t* devicePoses );
Q_INVOKABLE QString currentStatusMessage();
Q_INVOKABLE float currentStatusMessageTimeout();
File diff suppressed because it is too large Load Diff
-199
View File
@@ -1,199 +0,0 @@
#pragma once
#include <QObject>
class QQuickWindow;
// application namespace
namespace advsettings
{
// forward declaration
class OverlayController;
struct ReviveControllerProfile
{
std::string profileName;
int gripButtonMode;
bool triggerAsGrip;
float thumbDeadzone;
float thumbRange;
float touchPitch;
float touchYaw;
float touchRoll;
float touchX;
float touchY;
float touchZ;
};
class ReviveTabController : public QObject
{
Q_OBJECT
Q_PROPERTY( int isOverlayInstalled READ isOverlayInstalled NOTIFY
isOverlayInstalledChanged )
Q_PROPERTY( int gripButtonMode READ gripButtonMode WRITE setGripButtonMode
NOTIFY gripButtonModeChanged )
Q_PROPERTY( int triggerAsGrip READ triggerAsGrip WRITE setTriggerAsGrip
NOTIFY triggerAsGripChanged )
Q_PROPERTY( bool pixelsPerDisplayPixelOverrideEnabled READ
isPixelsPerDisplayPixelOverrideEnabled WRITE
setPixelsPerDisplayPixelOverrideEnabled NOTIFY
pixelsPerDisplayPixelOverrideEnabledChanged )
Q_PROPERTY( float toggleDelay READ toggleDelay WRITE setToggleDelay NOTIFY
toggleDelayChanged )
Q_PROPERTY(
float pixelsPerDisplayPixelOverride READ pixelsPerDisplayPixelOverride
WRITE setPixelsPerDisplayPixelOverride NOTIFY
pixelsPerDisplayPixelOverrideChanged )
Q_PROPERTY( float thumbDeadzone READ thumbDeadzone WRITE setThumbDeadzone
NOTIFY thumbDeadzoneChanged )
Q_PROPERTY( float thumbRange READ thumbRange WRITE setThumbRange NOTIFY
thumbRangeChanged )
Q_PROPERTY( float touchPitch READ touchPitch WRITE setTouchPitch NOTIFY
touchPitchChanged )
Q_PROPERTY(
float touchYaw READ touchYaw WRITE setTouchYaw NOTIFY touchYawChanged )
Q_PROPERTY( float touchRoll READ touchRoll WRITE setTouchRoll NOTIFY
touchRollChanged )
Q_PROPERTY( float touchX READ touchX WRITE setTouchX NOTIFY touchXChanged )
Q_PROPERTY( float touchY READ touchY WRITE setTouchY NOTIFY touchYChanged )
Q_PROPERTY( float touchZ READ touchZ WRITE setTouchZ NOTIFY touchZChanged )
Q_PROPERTY( float piPlayerHeight READ piPlayerHeight WRITE setPiPlayerHeight
NOTIFY piPlayerHeightChanged )
Q_PROPERTY( float piEyeHeight READ piEyeHeight WRITE setPiEyeHeight NOTIFY
piEyeHeightChanged )
Q_PROPERTY( QString piUsername READ piUsername WRITE setPiUsername NOTIFY
piUsernameChanged )
Q_PROPERTY(
QString piName READ piName WRITE setPiName NOTIFY piNameChanged )
Q_PROPERTY(
int piGender READ piGender WRITE setPiGender NOTIFY piGenderChanged )
private:
OverlayController* parent;
bool m_isOverlayInstalled = false;
int m_gripButtonMode = 0;
float m_toggleDelay = 0.5f;
bool m_triggerAsGrip = false;
bool m_pixelsPerDisplayPixelOverrideEnabled = false;
float m_pixelsPerDisplayPixelOverride = 1.0f;
float m_thumbDeadzone = 0.3f;
float m_thumbRange = 2.0f;
float m_touchPitch = -28.0f;
float m_touchYaw = 0.0f;
float m_touchRoll = -14.0f;
float m_touchX = 0.016f;
float m_touchY = -0.036f;
float m_touchZ = 0.016f;
float m_piPlayerHeight = 1.778f;
float m_piEyeHeight = 1.675f;
QString m_piUsername = "";
QString m_piName = "";
int m_piGender = 0; // 0 .. Unknown, 1 .. Male, 2 .. Female
unsigned settingsUpdateCounter = 0;
std::vector<ReviveControllerProfile> controllerProfiles;
public:
void initStage1( bool forceRevivePage );
void initStage2( OverlayController* parent );
void eventLoopTick();
bool isOverlayInstalled() const;
int gripButtonMode() const;
bool triggerAsGrip() const;
float toggleDelay() const;
bool isPixelsPerDisplayPixelOverrideEnabled() const;
float pixelsPerDisplayPixelOverride() const;
float thumbDeadzone() const;
float thumbRange() const;
float touchPitch() const;
float touchYaw() const;
float touchRoll() const;
float touchX() const;
float touchY() const;
float touchZ() const;
float piPlayerHeight() const;
float piEyeHeight() const;
const QString& piUsername() const;
const QString& piName() const;
int piGender() const; // 0 .. Unknown, 1 .. Male, 2 .. Female
Q_INVOKABLE float getCurrentHMDHeight();
void reloadControllerProfiles();
void saveControllerProfiles();
Q_INVOKABLE unsigned getControllerProfileCount();
Q_INVOKABLE QString getControllerProfileName( unsigned index );
public slots:
void setGripButtonMode( int value, bool notify = true );
void setTriggerAsGrip( bool value, bool notify = true );
void setToggleDelay( float value, bool notify = true );
void setPixelsPerDisplayPixelOverrideEnabled( bool value,
bool notify = true );
void setPixelsPerDisplayPixelOverride( float value, bool notify = true );
void setThumbDeadzone( float value, bool notify = true );
void setThumbRange( float value, bool notify = true );
void setTouchPitch( float value, bool notify = true );
void setTouchYaw( float value, bool notify = true );
void setTouchRoll( float value, bool notify = true );
void setTouchX( float value, bool notify = true );
void setTouchY( float value, bool notify = true );
void setTouchZ( float value, bool notify = true );
void setPiPlayerHeight( float value, bool notify = true );
void setPiEyeHeight( float value, bool notify = true );
void setPiUsername( const QString& value, bool notify = true );
void setPiName( const QString& value, bool notify = true );
void setPiGender( int value,
bool notify
= true ); // 0 .. Unknown, 1 .. Male, 2 .. Female
void addControllerProfile( QString name );
void applyControllerProfile( unsigned index );
void deleteControllerProfile( unsigned index );
void reset();
signals:
void isOverlayInstalledChanged( bool value );
void gripButtonModeChanged( int value );
void triggerAsGripChanged( bool value );
void toggleDelayChanged( float value );
void pixelsPerDisplayPixelOverrideEnabledChanged( bool value );
void pixelsPerDisplayPixelOverrideChanged( float value );
void thumbDeadzoneChanged( float value );
void thumbRangeChanged( float value );
void touchPitchChanged( float value );
void touchYawChanged( float value );
void touchRollChanged( float value );
void touchXChanged( float value );
void touchYChanged( float value );
void touchZChanged( float value );
void piPlayerHeightChanged( float value );
void piEyeHeightChanged( float value );
void piUsernameChanged( const QString& value );
void piNameChanged( const QString& value );
void piGenderChanged( int value );
void controllerProfilesUpdated();
};
} // namespace advsettings
+3 -36
View File
@@ -9,14 +9,6 @@ void SettingsTabController::initStage1()
{
m_autoStartEnabled = vr::VRApplications()->GetApplicationAutoLaunch(
application_strings::applicationKey );
auto settings = OverlayController::appSettings();
settings->beginGroup( "applicationSettings" );
auto value = settings->value( "forceRevivePage", m_forceRevivePage );
settings->endGroup();
if ( value.isValid() && !value.isNull() )
{
m_forceRevivePage = value.toBool();
}
}
void SettingsTabController::initStage2( OverlayController* var_parent )
@@ -24,15 +16,12 @@ void SettingsTabController::initStage2( OverlayController* var_parent )
this->parent = var_parent;
}
void SettingsTabController::eventLoopTick()
void SettingsTabController::dashboardLoopTick()
{
if ( settingsUpdateCounter >= k_settingsTabSettingsUpdateCounter )
{
if ( parent->isDashboardVisible() )
{
setAutoStartEnabled( vr::VRApplications()->GetApplicationAutoLaunch(
application_strings::applicationKey ) );
}
setAutoStartEnabled( vr::VRApplications()->GetApplicationAutoLaunch(
application_strings::applicationKey ) );
settingsUpdateCounter = 0;
}
else
@@ -66,26 +55,4 @@ void SettingsTabController::setAutoStartEnabled( bool value, bool notify )
}
}
bool SettingsTabController::forceRevivePage() const
{
return m_forceRevivePage;
}
void SettingsTabController::setForceRevivePage( bool value, bool notify )
{
if ( m_forceRevivePage != value )
{
m_forceRevivePage = value;
auto settings = OverlayController::appSettings();
settings->beginGroup( "applicationSettings" );
settings->setValue( "forceRevivePage", m_forceRevivePage );
settings->endGroup();
settings->sync();
if ( notify )
{
emit forceRevivePageChanged( m_forceRevivePage );
}
}
}
} // namespace advsettings
+1 -7
View File
@@ -15,8 +15,6 @@ class SettingsTabController : public QObject
Q_OBJECT
Q_PROPERTY( bool autoStartEnabled READ autoStartEnabled WRITE
setAutoStartEnabled NOTIFY autoStartEnabledChanged )
Q_PROPERTY( bool forceRevivePage READ forceRevivePage WRITE
setForceRevivePage NOTIFY forceRevivePageChanged )
private:
OverlayController* parent;
@@ -24,24 +22,20 @@ private:
unsigned settingsUpdateCounter = 0;
bool m_autoStartEnabled = false;
bool m_forceRevivePage = false;
public:
void initStage1();
void initStage2( OverlayController* parent );
void eventLoopTick();
void dashboardLoopTick();
bool autoStartEnabled() const;
bool forceRevivePage() const;
public slots:
void setAutoStartEnabled( bool value, bool notify = true );
void setForceRevivePage( bool value, bool notify = true );
signals:
void autoStartEnabledChanged( bool value );
void forceRevivePageChanged( bool value );
};
} // namespace advsettings
+84 -91
View File
@@ -9,7 +9,7 @@ void SteamVRTabController::initStage1()
{
initMotionSmoothing();
initSupersampleOverride();
eventLoopTick();
dashboardLoopTick();
reloadSteamVRProfiles();
}
@@ -18,105 +18,98 @@ void SteamVRTabController::initStage2( OverlayController* var_parent )
this->parent = var_parent;
}
void SteamVRTabController::eventLoopTick()
void SteamVRTabController::dashboardLoopTick()
{
if ( settingsUpdateCounter >= k_steamVrSettingsUpdateCounter )
{
if ( parent->isDashboardVisible() )
vr::EVRSettingsError vrSettingsError;
// checks supersampling override and resynchs if necessry
// also prints error if can't find.
auto sso = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
vr::EVRSettingsError vrSettingsError;
// checks supersampling override and resynchs if necessry
// also prints error if can't find.
auto sso = vr::VRSettings()->GetBool(
vr::k_pch_SteamVR_Section,
vr::k_pch_SteamVR_SupersampleManualOverride_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowSupersampleOverride( sso );
// 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 )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_SupersampleScale_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
if ( m_superSampling != 1.0f )
{
LOG( WARNING )
<< "Could not read \""
<< vr::k_pch_SteamVR_SupersampleManualOverride_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
LOG( DEBUG ) << "OpenVR returns an error and we have a custom "
"supersampling value: "
<< m_superSampling;
setSuperSampling( 1.0 );
}
setAllowSupersampleOverride( sso );
// 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 )
{
LOG( WARNING )
<< "Could not read \""
<< vr::k_pch_SteamVR_SupersampleScale_Float
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
if ( m_superSampling != 1.0f )
{
LOG( DEBUG )
<< "OpenVR returns an error and we have a custom "
"supersampling value: "
<< m_superSampling;
setSuperSampling( 1.0 );
}
}
else if ( m_superSampling != ss )
{
LOG( DEBUG ) << "OpenVR reports a changed supersampling value: "
<< 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,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not read \""
<< vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowSupersampleFiltering( sf );
}
else if ( fabs( static_cast<double>( m_superSampling - ss ) ) > 0.05 )
{
LOG( INFO ) << "OpenVR reports a changed supersampling value: "
<< 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,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setAllowSupersampleFiltering( sf );
// 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 )
{
LOG( WARNING )
<< "Could not read \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool << "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setMotionSmoothing( ms );
// 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 )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setMotionSmoothing( ms );
// Checks and synchs performance graph
auto pg
= vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
// Checks and synchs performance graph
auto pg = vr::VRSettings()->GetBool( vr::k_pch_Perf_Section,
vr::k_pch_Perf_PerfGraphInHMD_Bool,
&vrSettingsError );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING )
<< "Could not read \"" << vr::k_pch_Perf_PerfGraphInHMD_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setPerformanceGraph( pg );
if ( vrSettingsError != vr::VRSettingsError_None )
{
LOG( WARNING ) << "Could not read \""
<< vr::k_pch_Perf_PerfGraphInHMD_Bool
<< "\" setting: "
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
vrSettingsError );
}
setPerformanceGraph( pg );
settingsUpdateCounter = 0;
}
else
@@ -310,9 +303,9 @@ void SteamVRTabController::setSuperSampling( float value, const bool notify )
{
bool override = false;
// Mirrors Desktop Clamp
if ( value <= 0.2f )
if ( value < 0.2f )
{
LOG( WARNING ) << "Encountered a supersampling value <= 0.01, setting "
LOG( WARNING ) << "Encountered a supersampling value <= 0.2, setting "
"supersampling to 1.0";
value = 1.0f;
override = true;
@@ -63,6 +63,7 @@ public:
void initStage2( OverlayController* parent );
void eventLoopTick();
void dashboardLoopTick();
float superSampling() const;
bool motionSmoothing() const;
@@ -113,8 +113,6 @@ void VideoTabController::reloadVideoConfig()
setColorGreen( settings->value( "colorGreen", 0.0f ).toFloat() );
setColorBlue( settings->value( "colorBlue", 0.0f ).toFloat() );
settings->endGroup();
LOG( INFO ) << "bright opacityValue: " << m_brightnessOpacityValue
<< " REd value is: " << m_colorRed;
setBrightnessOpacityValue();
loadColorOverlay();
settings->sync();