Convert m_dragComfortFactor to new settings API and change sign
There was no reason for it to be unsigned. This has been changed to int for internal consistency.
This commit is contained in:
@@ -39,8 +39,6 @@ namespace advsettings
|
||||
{
|
||||
void MoveCenterTabController::initStage1()
|
||||
{
|
||||
m_dragComfortFactor = static_cast<unsigned int>( settings::getSetting(
|
||||
settings::IntSetting::PLAYSPACE_dragComfortFactor ) );
|
||||
m_turnComfortFactor = static_cast<unsigned int>( settings::getSetting(
|
||||
settings::IntSetting::PLAYSPACE_turnComfortFactor ) );
|
||||
|
||||
@@ -616,23 +614,20 @@ void MoveCenterTabController::setTurnBounds( bool value, bool notify )
|
||||
}
|
||||
}
|
||||
|
||||
unsigned MoveCenterTabController::dragComfortFactor() const
|
||||
int MoveCenterTabController::dragComfortFactor() const
|
||||
{
|
||||
return m_dragComfortFactor;
|
||||
return settings::getSetting(
|
||||
settings::IntSetting::PLAYSPACE_dragComfortFactor );
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setDragComfortFactor( unsigned value,
|
||||
bool notify )
|
||||
void MoveCenterTabController::setDragComfortFactor( int value, bool notify )
|
||||
{
|
||||
m_dragComfortFactor = value;
|
||||
auto settings = OverlayController::appSettings();
|
||||
settings->beginGroup( "playspaceSettings" );
|
||||
settings->setValue( "dragComfortFactor", m_dragComfortFactor );
|
||||
settings->endGroup();
|
||||
settings->sync();
|
||||
settings::setSetting( settings::IntSetting::PLAYSPACE_dragComfortFactor,
|
||||
value );
|
||||
|
||||
if ( notify )
|
||||
{
|
||||
emit dragComfortFactorChanged( m_dragComfortFactor );
|
||||
emit dragComfortFactorChanged( value );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2931,8 +2926,8 @@ void MoveCenterTabController::eventLoopTick(
|
||||
// Smooth drag motion can cause sim-sickness so we check if the user
|
||||
// wants to skip frames to reduce vection. We use the factor squared
|
||||
// because of logarithmic human perception.
|
||||
if ( m_dragComfortFrameSkipCounter
|
||||
>= ( m_dragComfortFactor * m_dragComfortFactor ) )
|
||||
if ( m_dragComfortFrameSkipCounter >= static_cast<unsigned>(
|
||||
( dragComfortFactor() * dragComfortFactor() ) ) )
|
||||
{
|
||||
updateHandDrag( devicePoses, angle );
|
||||
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
|
||||
|
||||
@@ -123,7 +123,6 @@ private:
|
||||
bool m_moveShortcutLeftPressed = false;
|
||||
vr::TrackedDeviceIndex_t m_activeMoveController;
|
||||
float m_lastControllerPosition[3];
|
||||
unsigned m_dragComfortFactor = 0;
|
||||
unsigned m_turnComfortFactor = 0;
|
||||
bool m_heightToggle = false;
|
||||
float m_heightToggleOffset = -1.0f;
|
||||
@@ -226,7 +225,7 @@ public:
|
||||
bool turnBindLeft() const;
|
||||
bool dragBounds() const;
|
||||
bool turnBounds() const;
|
||||
unsigned dragComfortFactor() const;
|
||||
int dragComfortFactor() const;
|
||||
unsigned turnComfortFactor() const;
|
||||
bool heightToggle() const;
|
||||
float heightToggleOffset() const;
|
||||
@@ -296,7 +295,7 @@ public slots:
|
||||
void setMoveShortcutLeft( bool value, bool notify = true );
|
||||
void setTurnBindRight( bool value, bool notify = true );
|
||||
void setTurnBindLeft( bool value, bool notify = true );
|
||||
void setDragComfortFactor( unsigned value, bool notify = true );
|
||||
void setDragComfortFactor( int value, bool notify = true );
|
||||
void setTurnComfortFactor( unsigned value, bool notify = true );
|
||||
void setDragBounds( bool value, bool notify = true );
|
||||
void setTurnBounds( bool value, bool notify = true );
|
||||
@@ -348,7 +347,7 @@ signals:
|
||||
void turnBindLeftChanged( bool value );
|
||||
void dragBoundsChanged( bool value );
|
||||
void turnBoundsChanged( bool value );
|
||||
void dragComfortFactorChanged( unsigned value );
|
||||
void dragComfortFactorChanged( int value );
|
||||
void turnComfortFactorChanged( unsigned value );
|
||||
void heightToggleChanged( bool value );
|
||||
void heightToggleOffsetChanged( float value );
|
||||
|
||||
Reference in New Issue
Block a user