diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-01-01 10:33:12 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-01-01 10:33:12 +0100 |
commit | 4a9c157caa350f0e333cba8444793ddae840bf12 (patch) | |
tree | 76ec89921ba7780557720a8dd46c5106e228f241 /ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp | |
parent | cb24e0d1dc2917691db6f30c063f2add323ca70b (diff) |
settings for mouse
Diffstat (limited to 'ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp')
-rw-r--r-- | ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp | 56 |
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; |