diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-06 07:19:21 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-06 07:19:21 +0200 |
commit | 555d0555e990a99c2061570dcebd0d868f1334b8 (patch) | |
tree | a1702776ed614df99f0f4071ddce391cff20a8e4 /ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | |
parent | e21853bff477cd90c5c60ba1a4ef9304df7538fe (diff) |
simconnect: get rid of redundant logic
Diffstat (limited to 'ftnoir_protocol_sc/ftnoir_protocol_sc.cpp')
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp index 30590715..c9b0541a 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp @@ -144,9 +144,6 @@ bool FTNoIR_Protocol::correct() return false; } - // - // Get the functions from the DLL. - // simconnect_open = (importSimConnect_Open) SCClientLib.resolve("SimConnect_Open"); if (simconnect_open == NULL) { qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_Open function not found in DLL!"; @@ -163,8 +160,6 @@ bool FTNoIR_Protocol::correct() return false; } - //return true; - simconnect_calldispatch = (importSimConnect_CallDispatch) SCClientLib.resolve("SimConnect_CallDispatch"); if (simconnect_calldispatch == NULL) { qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_CallDispatch function not found in DLL!"; @@ -177,24 +172,6 @@ bool FTNoIR_Protocol::correct() return false; } - simconnect_mapclienteventtosimevent = (importSimConnect_MapClientEventToSimEvent) SCClientLib.resolve("SimConnect_MapClientEventToSimEvent"); - if (simconnect_subscribetosystemevent == NULL) { - qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_MapClientEventToSimEvent function not found in DLL!"; - return false; - } - - simconnect_addclienteventtonotificationgroup = (importSimConnect_AddClientEventToNotificationGroup) SCClientLib.resolve("SimConnect_AddClientEventToNotificationGroup"); - if (simconnect_subscribetosystemevent == NULL) { - qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_AddClientEventToNotificationGroup function not found in DLL!"; - return false; - } - - simconnect_setnotificationgrouppriority = (importSimConnect_SetNotificationGroupPriority) SCClientLib.resolve("SimConnect_SetNotificationGroupPriority"); - if (simconnect_subscribetosystemevent == NULL) { - qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_SetNotificationGroupPriority function not found in DLL!"; - return false; - } - qDebug() << "FTNoIR_Protocol::correct() says: SimConnect functions resolved in DLL!"; start(); @@ -204,22 +181,7 @@ bool FTNoIR_Protocol::correct() void FTNoIR_Protocol::handle() { - if (prevSCPosX != virtSCPosX || - prevSCPosY != virtSCPosY || - prevSCPosZ != virtSCPosZ || - prevSCRotX != virtSCRotX || - prevSCRotY != virtSCRotY || - prevSCRotZ != virtSCRotZ) - { - (void) simconnect_set6DOF(hSimConnect, virtSCPosX, virtSCPosY, virtSCPosZ, virtSCRotX, virtSCRotZ, virtSCRotY); - } - - prevSCPosX = virtSCPosX; - prevSCPosY = virtSCPosY; - prevSCPosZ = virtSCPosZ; - prevSCRotX = virtSCRotX; - prevSCRotY = virtSCRotY; - prevSCRotZ = virtSCRotZ; + (void) simconnect_set6DOF(hSimConnect, virtSCPosX, virtSCPosY, virtSCPosZ, virtSCRotX, virtSCRotZ, virtSCRotY); } void CALLBACK FTNoIR_Protocol::processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD, void *self_) |