summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR/SCServer.h
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2010-12-18 11:43:47 +0000
committerWim Vriend <facetracknoir@gmail.com>2010-12-18 11:43:47 +0000
commit9e0250dcad1ef02dc6cba1315fe37c8c2329769a (patch)
tree44978da1243d8c4dbc91e35ad6d00f697b1107c3 /FaceTrackNoIR/SCServer.h
parent4c04337f46470180312812634beb0e39a04bcf9f (diff)
Base Class for Game protocol
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@30 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR/SCServer.h')
-rw-r--r--FaceTrackNoIR/SCServer.h34
1 files changed, 10 insertions, 24 deletions
diff --git a/FaceTrackNoIR/SCServer.h b/FaceTrackNoIR/SCServer.h
index e694463d..6df22b21 100644
--- a/FaceTrackNoIR/SCServer.h
+++ b/FaceTrackNoIR/SCServer.h
@@ -28,6 +28,7 @@
// This is necessary to run FaceTrackNoIR on a PC without FSX
//
#define SIMCONNECT_H_NOMANIFEST
+#include "FTNoIR_cxx_protocolserver.h"
#include "Windows.h"
#include <stdlib.h>
#include "SimConnect.h"
@@ -46,10 +47,11 @@ typedef HRESULT (WINAPI *importSimConnect_Close)(HANDLE hSimConnect);
typedef HRESULT (WINAPI *importSimConnect_CameraSetRelative6DOF)(HANDLE hSimConnect, float fDeltaX, float fDeltaY, float fDeltaZ, float fPitchDeg, float fBankDeg, float fHeadingDeg);
using namespace std;
+using namespace v4friend::ftnoir;
static const char* SC_CLIENT_FILENAME = "SimConnect.dll";
-class SCServer : public QThread {
+class SCServer : public ProtocolServerBase {
Q_OBJECT
public:
@@ -58,40 +60,24 @@ public:
SCServer();
~SCServer();
- bool SCCheckClientDLL();
-
// protected member methods
protected:
void run();
+ bool checkServerInstallationOK( HANDLE handle );
private:
- // Handles to neatly terminate thread...
- HANDLE m_StopThread;
- HANDLE m_WaitThread;
-
// Private properties
QString ProgramName;
QLibrary SCClientLib;
public:
+ void setVirtRotX(float rot) { virtRotX = -1.0f * rot; } // degrees
+ void setVirtRotY(float rot) { virtRotY = -1.0f * rot; }
+ void setVirtRotZ(float rot) { virtRotZ = rot; }
- // Settings for calculating the Virtual Pose
- static float virtPosX;
- static float virtPosY;
- static float virtPosZ;
-
- static float virtRotX;
- static float virtRotY;
- static float virtRotZ;
-
- static void setVirtRotX(float rot) { virtRotX = -1.0f * rot; } // degrees
- static void setVirtRotY(float rot) { virtRotY = -1.0f * rot; }
- static void setVirtRotZ(float rot) { virtRotZ = rot; }
-
- static void setVirtPosX(float pos) { virtPosX = pos/100.f; } // cm to meters
- static void setVirtPosY(float pos) { virtPosY = pos/100.f; }
- static void setVirtPosZ(float pos) { virtPosZ = -1.0f * pos/100.f; }
-
+ void setVirtPosX(float pos) { virtPosX = pos/100.f; } // cm to meters
+ void setVirtPosY(float pos) { virtPosY = pos/100.f; }
+ void setVirtPosZ(float pos) { virtPosZ = -1.0f * pos/100.f; }
};