diff options
Diffstat (limited to 'ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp')
-rw-r--r-- | ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp | 61 |
1 files changed, 12 insertions, 49 deletions
diff --git a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp index 986ccc65..632d502a 100644 --- a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp +++ b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.cpp @@ -30,9 +30,6 @@ /** constructor **/ FTNoIR_Protocol::FTNoIR_Protocol() { - loadSettings(); - ProgramName = "Microsoft FS2004"; - prevPosX = 0.0f; prevPosY = 0.0f; prevPosZ = 0.0f; @@ -41,12 +38,8 @@ FTNoIR_Protocol::FTNoIR_Protocol() prevRotZ = 0.0f; } -/** destructor **/ FTNoIR_Protocol::~FTNoIR_Protocol() { - // - // Free the DLL - // FSUIPCLib.unload(); } @@ -69,38 +62,20 @@ double local_x; return (int) y; } -// -// 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 ( "FSUIPC" ); - LocationOfDLL = iniFile.value ( "LocationOfDLL", FSUIPC_FILENAME ).toString(); - qDebug() << "FSUIPCServer::loadSettings() says: Location of DLL = " << LocationOfDLL; - iniFile.endGroup (); -} - -// -// Update Headpose in Game. -// void FTNoIR_Protocol::sendHeadposeToGame(const double *headpose ) { -DWORD result; -TFSState pitch; -TFSState yaw; -TFSState roll; -WORD FSZoom; + DWORD result; + TFSState pitch; + TFSState yaw; + TFSState roll; + WORD FSZoom; -float virtPosX; -float virtPosY; -float virtPosZ; + float virtPosX; + float virtPosY; + float virtPosZ; -float virtRotX; -float virtRotY; -float virtRotZ; + float virtRotX; + float virtRotY; + float virtRotZ; // qDebug() << "FSUIPCServer::run() says: started!"; @@ -168,9 +143,6 @@ float virtRotZ; prevRotZ = virtRotZ; } -// -// Returns 'true' if all seems OK. -// bool FTNoIR_Protocol::checkServerInstallationOK() { qDebug() << "checkServerInstallationOK says: Starting Function"; @@ -178,7 +150,7 @@ bool FTNoIR_Protocol::checkServerInstallationOK() // // Load the DLL. // - FSUIPCLib.setFileName( LocationOfDLL ); + FSUIPCLib.setFileName( s.LocationOfDLL ); if (FSUIPCLib.load() != true) { qDebug() << "checkServerInstallationOK says: Error loading FSUIPC DLL"; return false; @@ -190,15 +162,6 @@ bool FTNoIR_Protocol::checkServerInstallationOK() 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 FTNoIR_Protocol* CALLING_CONVENTION GetConstructor(void) { return new FTNoIR_Protocol; |