Convert m_pPumpEventsTimer into object
Having an extra layer of indirection was unnecessary. The if statement guard to check if the pointer is null is now unnecessary.
This commit is contained in:
@@ -389,15 +389,12 @@ OverlayController::~OverlayController()
|
|||||||
|
|
||||||
void OverlayController::Shutdown()
|
void OverlayController::Shutdown()
|
||||||
{
|
{
|
||||||
if ( m_pPumpEventsTimer )
|
disconnect( &m_pumpEventsTimer,
|
||||||
{
|
SIGNAL( timeout() ),
|
||||||
disconnect( m_pPumpEventsTimer.get(),
|
this,
|
||||||
SIGNAL( timeout() ),
|
SLOT( OnTimeoutPumpEvents() ) );
|
||||||
this,
|
m_pumpEventsTimer.stop();
|
||||||
SLOT( OnTimeoutPumpEvents() ) );
|
|
||||||
m_pPumpEventsTimer->stop();
|
|
||||||
m_pPumpEventsTimer.reset();
|
|
||||||
}
|
|
||||||
if ( m_pRenderTimer )
|
if ( m_pRenderTimer )
|
||||||
{
|
{
|
||||||
disconnect( &m_renderControl,
|
disconnect( &m_renderControl,
|
||||||
@@ -511,16 +508,15 @@ void OverlayController::SetWidget( QQuickItem* quickItem,
|
|||||||
SLOT( OnRenderRequest() ) );
|
SLOT( OnRenderRequest() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pPumpEventsTimer.reset( new QTimer() );
|
connect( &m_pumpEventsTimer,
|
||||||
connect( m_pPumpEventsTimer.get(),
|
|
||||||
SIGNAL( timeout() ),
|
SIGNAL( timeout() ),
|
||||||
this,
|
this,
|
||||||
SLOT( OnTimeoutPumpEvents() ) );
|
SLOT( OnTimeoutPumpEvents() ) );
|
||||||
|
|
||||||
// Every 1ms we check if the current frame has advanced (for vsync)
|
// Every 1ms we check if the current frame has advanced (for vsync)
|
||||||
m_pPumpEventsTimer->setInterval( 1 );
|
m_pumpEventsTimer.setInterval( 1 );
|
||||||
|
|
||||||
m_pPumpEventsTimer->start();
|
m_pumpEventsTimer.start();
|
||||||
|
|
||||||
m_steamVRTabController.initStage2( this );
|
m_steamVRTabController.initStage2( this );
|
||||||
m_chaperoneTabController.initStage2( this );
|
m_chaperoneTabController.initStage2( this );
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ private:
|
|||||||
QOpenGLContext m_openGLContext;
|
QOpenGLContext m_openGLContext;
|
||||||
QOffscreenSurface m_offscreenSurface;
|
QOffscreenSurface m_offscreenSurface;
|
||||||
|
|
||||||
std::unique_ptr<QTimer> m_pPumpEventsTimer;
|
QTimer m_pumpEventsTimer;
|
||||||
std::unique_ptr<QTimer> m_pRenderTimer;
|
std::unique_ptr<QTimer> m_pRenderTimer;
|
||||||
bool m_dashboardVisible = false;
|
bool m_dashboardVisible = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user