diff options
Diffstat (limited to 'ftnoir_protocol_sc')
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | 18 | ||||
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_protocol_sc.h | 13 | ||||
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp | 6 | ||||
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp | 4 | ||||
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_sccontrols.ui | 144 |
5 files changed, 90 insertions, 95 deletions
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp index 2714e980..72b800d2 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp @@ -27,7 +27,7 @@ * must be treated as such... * ********************************************************************************/ #include "ftnoir_protocol_sc.h" -#include "facetracknoir/global-settings.h" +#include "facetracknoir/plugin-support.h" importSimConnect_CameraSetRelative6DOF FTNoIR_Protocol::simconnect_set6DOF; HANDLE FTNoIR_Protocol::hSimConnect = 0; // Handle to SimConnect @@ -79,13 +79,11 @@ void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { if (!blnSimConnectActive) { if (SUCCEEDED(simconnect_open(&hSimConnect, "FaceTrackNoIR", NULL, 0, 0, 0))) { - HRESULT hr; - simconnect_subscribetosystemevent(hSimConnect, EVENT_PING, "Frame"); - hr = simconnect_mapclienteventtosimevent(hSimConnect, EVENT_INIT, ""); - hr = simconnect_addclienteventtonotificationgroup(hSimConnect, GROUP0, EVENT_INIT, false); - hr = simconnect_setnotificationgrouppriority(hSimConnect, GROUP0, SIMCONNECT_GROUP_PRIORITY_HIGHEST); + simconnect_mapclienteventtosimevent(hSimConnect, EVENT_INIT, ""); + simconnect_addclienteventtonotificationgroup(hSimConnect, GROUP0, EVENT_INIT, false); + simconnect_setnotificationgrouppriority(hSimConnect, GROUP0, SIMCONNECT_GROUP_PRIORITY_HIGHEST); blnSimConnectActive = true; } } @@ -93,6 +91,8 @@ void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { (void) (simconnect_calldispatch(hSimConnect, processNextSimconnectEvent, NULL)); } +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" + class ActivationContext { public: ActivationContext(const int resid) { @@ -103,7 +103,7 @@ public: actx.lpResourceName = MAKEINTRESOURCEA(resid); actx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID; #ifdef _MSC_VER -# define PREFIX "" +# error "MSVC support removed" #else # define PREFIX "lib" #endif @@ -203,7 +203,7 @@ bool FTNoIR_Protocol::checkServerInstallationOK() return true; } -void CALLBACK FTNoIR_Protocol::processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD cbData, void *pContext) +void CALLBACK FTNoIR_Protocol::processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD, void *) { switch(pData->dwID) { @@ -246,7 +246,7 @@ void CALLBACK FTNoIR_Protocol::processNextSimconnectEvent(SIMCONNECT_RECV* pData } } -extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocol* CALLING_CONVENTION GetConstructor() +extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor() { return new FTNoIR_Protocol; } diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h index a13c0097..02cb7b0e 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h @@ -29,7 +29,7 @@ #pragma once #undef _WIN32_WINNT #define _WIN32_WINNT 0x0502 -#include "facetracknoir/global-settings.h" +#include "facetracknoir/plugin-api.hpp" // // Prevent the SimConnect manifest from being merged in the application-manifest // This is necessary to run FaceTrackNoIR on a PC without FSX @@ -38,8 +38,7 @@ #include <windows.h> #include <SimConnect.h> -#include <ftnoir_protocol_base/ftnoir_protocol_base.h> -#include <ui_ftnoir_sccontrols.h> +#include "ui_ftnoir_sccontrols.h" #include <QMessageBox> #include <QSettings> #include <QLibrary> @@ -89,7 +88,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - virtual ~FTNoIR_Protocol(); + ~FTNoIR_Protocol() override; bool checkServerInstallationOK(); void sendHeadposeToGame(const double* headpose); QString getGameName() { @@ -128,13 +127,12 @@ private: settings s; }; -// Widget that has controls for FTNoIR protocol client-settings. class SCControls: public QWidget, public IProtocolDialog { Q_OBJECT public: SCControls(); - void registerProtocol(IProtocol *protocol) {} + void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} private: Ui::UICSCControls ui; @@ -144,9 +142,6 @@ private slots: void doCancel(); }; -//******************************************************************************************************* -// FaceTrackNoIR Protocol DLL. Functions used to get general info on the Protocol -//******************************************************************************************************* class FTNoIR_ProtocolDll : public Metadata { public: diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp index c7428d77..c3d64e9d 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp @@ -24,7 +24,7 @@ ********************************************************************************/ #include "ftnoir_protocol_sc.h" #include <QDebug> -#include "facetracknoir/global-settings.h" +#include "facetracknoir/plugin-support.h" SCControls::SCControls() : QWidget() @@ -44,11 +44,11 @@ void SCControls::doOK() { } void SCControls::doCancel() { - s.b->revert(); + s.b->reload(); close(); } -extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocolDialog* CALLING_CONVENTION GetDialog( ) +extern "C" OPENTRACK_EXPORT IProtocolDialog* GetDialog( ) { return new SCControls; } diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp index 0a52fa96..9bdbef09 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp @@ -24,9 +24,9 @@ ********************************************************************************/ #include "ftnoir_protocol_sc.h" #include <QDebug> -#include "facetracknoir/global-settings.h" +#include "facetracknoir/plugin-support.h" -extern "C" FTNOIR_PROTOCOL_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata() +extern "C" OPENTRACK_EXPORT Metadata* GetMetadata() { return new FTNoIR_ProtocolDll; } diff --git a/ftnoir_protocol_sc/ftnoir_sccontrols.ui b/ftnoir_protocol_sc/ftnoir_sccontrols.ui index 87dc8d86..5b2fd291 100644 --- a/ftnoir_protocol_sc/ftnoir_sccontrols.ui +++ b/ftnoir_protocol_sc/ftnoir_sccontrols.ui @@ -1,72 +1,72 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>UICSCControls</class>
- <widget class="QWidget" name="UICSCControls">
- <property name="windowModality">
- <enum>Qt::NonModal</enum>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>290</width>
- <height>79</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>SimConnect settings FaceTrackNoIR</string>
- </property>
- <property name="windowIcon">
- <iconset>
- <normaloff>images/FaceTrackNoIR.png</normaloff>images/FaceTrackNoIR.png</iconset>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>FSX version</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="comboBox">
- <item>
- <property name="text">
- <string>SP1</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>SP2</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Acceleration</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
- <slots>
- <slot>startEngineClicked()</slot>
- <slot>stopEngineClicked()</slot>
- <slot>cameraSettingsClicked()</slot>
- </slots>
-</ui>
+<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>UICSCControls</class> + <widget class="QWidget" name="UICSCControls"> + <property name="windowModality"> + <enum>Qt::NonModal</enum> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>290</width> + <height>79</height> + </rect> + </property> + <property name="windowTitle"> + <string>SimConnect settings FaceTrackNoIR</string> + </property> + <property name="windowIcon"> + <iconset> + <normaloff>images/FaceTrackNoIR.png</normaloff>images/FaceTrackNoIR.png</iconset> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>FSX version</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="comboBox"> + <item> + <property name="text"> + <string>SP1</string> + </property> + </item> + <item> + <property name="text"> + <string>SP2</string> + </property> + </item> + <item> + <property name="text"> + <string>Acceleration</string> + </property> + </item> + </widget> + </item> + <item row="1" column="1"> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> + <slots> + <slot>startEngineClicked()</slot> + <slot>stopEngineClicked()</slot> + <slot>cameraSettingsClicked()</slot> + </slots> +</ui> |