From 36f82a4f0dc4f002123cc313eab7c845dcd13572 Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Sat, 9 Feb 2013 15:29:53 +0000 Subject: Created a FaceTrackNoIR-version of FreeTrackClient.dll, because the existing one was crashing ArmA2. Made a 64-bit version too. The FTReportName function was a trouble-maker. In the repo of FreeTrack it expects a pointer to a name, in reality, it should receive an integer... Cost me a while to figure out why ArmA kept crashing :( Also added the option to enable/disable FreeTrack or TrackIR in the FreeTrack 2.0 settings-dialog. Even more, added a button so users can 'repair' the location of NPClient.dll. Some users complained that their SW didn't work with TrackIR any more, after running FaceTrackNoIR... git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@270 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp | 38 ++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp') diff --git a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp index 0491b9fa..f33f92c5 100644 --- a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp +++ b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp @@ -26,6 +26,8 @@ ********************************************************************************/ /* Modifications (last one on top): + 20130209 - WVR: Some games support both interfaces and cause trouble. Added ComboBox to fix this (hide one interface + by clearing the appropriate Registry-setting). 20130203 - WVR: Added Tirviews and dummy checkboxes to the Settings dialog. This is necessary for CFS3 etc. 20130125 - WVR: Upgraded to FT2.0: now the FreeTrack protocol supports all TIR-enabled games. 20110401 - WVR: Moved protocol to a DLL, convenient for installation etc. @@ -45,8 +47,13 @@ FTNoIR_Protocol::FTNoIR_Protocol() comhandle = 0; useTIRViews = false; useDummyExe = false; + intUsedInterface = 0; + // + // Load the INI-settings. + // loadSettings(); + ProgramName = ""; intGameID = 0; @@ -93,12 +100,6 @@ FTNoIR_Protocol::~FTNoIR_Protocol() FTDestroyMapping(); } -///** helper to Auto-destruct **/ -//void FTNoIR_Protocol::Release() -//{ -// delete this; -//} - void FTNoIR_Protocol::Initialize() { return; @@ -174,6 +175,10 @@ void FTNoIR_Protocol::loadSettings() { QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) + iniFile.beginGroup ( "FT" ); + intUsedInterface = iniFile.value ( "UsedInterface", 0 ).toInt(); + iniFile.endGroup (); + // // Use the settings-section from the deprecated fake-TIR protocol, as they are most likely to be found there. // @@ -321,8 +326,25 @@ bool FTNoIR_Protocol::checkServerInstallationOK( HANDLE handle ) // Write the path in the registry (for FreeTrack and FreeTrack20), for the game(s). // aLocation = QCoreApplication::applicationDirPath() + "/"; - settings.setValue( "Path" , aLocation ); - settingsTIR.setValue( "Path" , aLocation ); + + qDebug() << "checkServerInstallationOK says: used interface = " << intUsedInterface; + switch (intUsedInterface) { + case 0: // Use both interfaces + settings.setValue( "Path" , aLocation ); + settingsTIR.setValue( "Path" , aLocation ); + break; + case 1: // Use FreeTrack, disable TrackIR + settings.setValue( "Path" , aLocation ); + settingsTIR.setValue( "Path" , "" ); + break; + case 2: // Use TrackIR, disable FreeTrack + settings.setValue( "Path" , "" ); + settingsTIR.setValue( "Path" , aLocation ); + break; + default: + // should never be reached + break; + } // // TIRViews must be started first, or the NPClient DLL will never be loaded. -- cgit v1.2.3