summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp')
-rw-r--r--ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp56
1 files changed, 11 insertions, 45 deletions
diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
index 64e010a8..cc8aa11e 100644
--- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
+++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp
@@ -29,38 +29,12 @@
#include "ftnoir_protocol_mouse.h"
#include "facetracknoir/global-settings.h"
-/** constructor **/
-FTNoIR_Protocol::FTNoIR_Protocol()
-{
- loadSettings();
-}
-
-/** destructor **/
-FTNoIR_Protocol::~FTNoIR_Protocol()
-{
-}
-
-//
-// Load the current Settings from the currently 'active' INI-file.
-//
-void FTNoIR_Protocol::loadSettings() {
- QSettings settings("opentrack"); // Registry settings (in HK_USER)
-
- QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
- QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
-
- iniFile.beginGroup ( "Mouse" );
- Mouse_X = (FTN_AngleName) (iniFile.value ( "Mouse_X", 0 ).toInt());
- Mouse_Y = (FTN_AngleName) (iniFile.value ( "Mouse_Y", 0 ).toInt());
- iniFile.endGroup ();
-}
-
-//
-// Update Headpose in Game.
-//
void FTNoIR_Protocol::sendHeadposeToGame(const double *headpose ) {
- float fMouse_X = 0;
- float fMouse_Y = 0;
+ double fMouse_X = 0;
+ double fMouse_Y = 0;
+
+ int Mouse_X = s.Mouse_X;
+ int Mouse_Y = s.Mouse_Y;
if (Mouse_X > 0 && Mouse_X <= 6)
fMouse_X = headpose[Mouse_X-1] / (Mouse_X < 3 ? 100 : 180);
@@ -77,24 +51,16 @@ void FTNoIR_Protocol::sendHeadposeToGame(const double *headpose ) {
}
}
-//
-// Returns 'true' if all seems OK.
-//
+void FTNoIR_Protocol::reload()
+{
+ s.b->reload();
+}
+
bool FTNoIR_Protocol::checkServerInstallationOK()
{
-
- return true;
+ return true;
}
-////////////////////////////////////////////////////////////////////////////////
-// Factory function that creates instances if the Protocol object.
-
-// Export both decorated and undecorated names.
-// GetProtocol - Undecorated name, which can be easily used with GetProcAddress
-// Win32 API function.
-// _GetProtocol@0 - Common name decoration for __stdcall functions in C language.
-//#pragma comment(linker, "/export:GetProtocol=_GetProtocol@0")
-
extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocol* CALLING_CONVENTION GetConstructor()
{
return new FTNoIR_Protocol;