summaryrefslogtreecommitdiffhomepage
path: root/proto-simconnect/ftnoir_protocol_sc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'proto-simconnect/ftnoir_protocol_sc.cpp')
-rw-r--r--proto-simconnect/ftnoir_protocol_sc.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/proto-simconnect/ftnoir_protocol_sc.cpp b/proto-simconnect/ftnoir_protocol_sc.cpp
index 9c0f1a5b..be0c23c4 100644
--- a/proto-simconnect/ftnoir_protocol_sc.cpp
+++ b/proto-simconnect/ftnoir_protocol_sc.cpp
@@ -14,13 +14,13 @@
#include "opentrack-library-path.h"
#include "compat/timer.hpp"
-simconnect::simconnect() : hSimConnect(nullptr), should_stop(false), should_reconnect(false)
+simconnect::simconnect() : hSimConnect(nullptr), should_reconnect(false)
{
}
simconnect::~simconnect()
{
- should_stop = true;
+ requestInterruption();
wait();
}
@@ -34,7 +34,7 @@ void simconnect::run()
return;
}
- while (!should_stop)
+ while (!isInterruptionRequested())
{
HRESULT hr;
@@ -52,7 +52,7 @@ void simconnect::run()
Timer tm;
int idle_seconds = 0;
- while (!should_stop)
+ while (!isInterruptionRequested())
{
if (should_reconnect)
{
@@ -88,14 +88,15 @@ void simconnect::run()
qDebug() << "simconnect: can't open handle:" << hr;
}
- if (!should_stop)
+ if (!isInterruptionRequested())
Sleep(100);
}
CloseHandle(event);
}
-void simconnect::pose( const double *headpose ) {
+void simconnect::pose( const double *headpose )
+{
// euler degrees
virtSCRotX = float(-headpose[Pitch]);
virtSCRotY = float(headpose[Yaw]);