diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2013-02-09 15:29:53 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2013-02-09 15:29:53 +0000 |
commit | 36f82a4f0dc4f002123cc313eab7c845dcd13572 (patch) | |
tree | c97146db8d0cf1f6b54a77650771b5e0824ed073 | |
parent | 22cf655f0b1380cb0e948302f4a73bbfb5ec919b (diff) |
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
-rw-r--r-- | FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui | 173 | ||||
-rw-r--r-- | FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp | 38 | ||||
-rw-r--r-- | FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h | 3 | ||||
-rw-r--r-- | FTNoIR_Protocol_FT/FTTypes.h | 9 | ||||
-rw-r--r-- | FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp | 37 | ||||
-rw-r--r-- | FaceTrackNoIR/FaceTrackNoIR.ui | 14 | ||||
-rw-r--r-- | FaceTrackNoIR/tracker.cpp | 3 | ||||
-rw-r--r-- | FreeTrackClient/FTClient.cpp | 119 | ||||
-rw-r--r-- | FreeTrackClient/FTClient.h | 30 | ||||
-rw-r--r-- | FreeTrackClient/FreeTrackClient.sln | 26 | ||||
-rw-r--r-- | FreeTrackClient/FreeTrackClient/FreeTrackClient.cpp | 294 | ||||
-rw-r--r-- | FreeTrackClient/FreeTrackClient/FreeTrackClient.rc | 103 | ||||
-rw-r--r-- | FreeTrackClient/FreeTrackClient/FreeTrackClient.vcproj | 556 | ||||
-rw-r--r-- | FreeTrackClient/FreeTrackClient/postbuild.bat | 15 | ||||
-rw-r--r-- | FreeTrackClient/FreeTrackClient/resource.h | 15 |
15 files changed, 1401 insertions, 34 deletions
diff --git a/FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui b/FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui index 980b2943..fc5abbcf 100644 --- a/FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui +++ b/FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui @@ -6,10 +6,16 @@ <rect>
<x>0</x>
<y>0</y>
- <width>588</width>
- <height>263</height>
+ <width>645</width>
+ <height>416</height>
</rect>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>645</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>FreeTrack 2.0 settings FaceTrackNoIR</string>
</property>
@@ -40,8 +46,8 @@ <widget class="QCheckBox" name="chkTIRViews">
<property name="geometry">
<rect>
- <x>70</x>
- <y>20</y>
+ <x>80</x>
+ <y>30</y>
<width>88</width>
<height>17</height>
</rect>
@@ -56,27 +62,27 @@ <widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
- <x>180</x>
+ <x>189</x>
<y>10</y>
- <width>301</width>
+ <width>421</width>
<height>16</height>
</rect>
</property>
<property name="text">
- <string>TIRViews is only required for some older games (like CFS3).</string>
+ <string>TIRViews is only required for some older games (like CFS3). For it to work, TIRViews.dll</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
- <x>180</x>
+ <x>189</x>
<y>30</y>
<width>421</width>
<height>16</height>
</rect>
</property>
<property name="text">
- <string>For it to work, TIRViews.dll must be placed in the FaceTrackNoIR program folder.</string>
+ <string>must be placed in the FaceTrackNoIR program folder. If the checkbox is disabled, the</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -85,14 +91,14 @@ <widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
- <x>180</x>
+ <x>189</x>
<y>50</y>
- <width>251</width>
+ <width>411</width>
<height>16</height>
</rect>
</property>
<property name="text">
- <string>If the checkbox is disabled, the DLL was not found.</string>
+ <string>the DLL was not found. You can get it from NaturalPoint.</string>
</property>
</widget>
</widget>
@@ -111,8 +117,8 @@ <widget class="QCheckBox" name="chkStartDummy">
<property name="geometry">
<rect>
- <x>13</x>
- <y>20</y>
+ <x>20</x>
+ <y>30</y>
<width>145</width>
<height>17</height>
</rect>
@@ -127,7 +133,7 @@ <widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
- <x>180</x>
+ <x>189</x>
<y>10</y>
<width>351</width>
<height>16</height>
@@ -140,7 +146,7 @@ <widget class="QLabel" name="label">
<property name="geometry">
<rect>
- <x>180</x>
+ <x>189</x>
<y>30</y>
<width>261</width>
<height>16</height>
@@ -156,7 +162,7 @@ <widget class="QLabel" name="label_7">
<property name="geometry">
<rect>
- <x>180</x>
+ <x>189</x>
<y>50</y>
<width>231</width>
<height>16</height>
@@ -169,6 +175,139 @@ </widget>
</item>
<item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>70</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Select interface</string>
+ </property>
+ <widget class="QLabel" name="label_8">
+ <property name="geometry">
+ <rect>
+ <x>189</x>
+ <y>10</y>
+ <width>351</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Some games support both FreeTrack and TrackIR and may get confused,</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_2">
+ <property name="geometry">
+ <rect>
+ <x>189</x>
+ <y>30</y>
+ <width>261</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>when both interfaces are visible.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_9">
+ <property name="geometry">
+ <rect>
+ <x>189</x>
+ <y>50</y>
+ <width>381</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Try to disable one interface, if you experience problems.</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" name="cbxSelectInterface">
+ <property name="geometry">
+ <rect>
+ <x>6</x>
+ <y>30</y>
+ <width>168</width>
+ <height>22</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_4">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>70</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Repair NPClient location</string>
+ </property>
+ <widget class="QLabel" name="label_10">
+ <property name="geometry">
+ <rect>
+ <x>188</x>
+ <y>10</y>
+ <width>381</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Users who use other software with an NPClient DLL (like TrackIR, FreeTrack or </string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_11">
+ <property name="geometry">
+ <rect>
+ <x>184</x>
+ <y>30</y>
+ <width>411</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string> GlovePIE) may need to repair the location of the DLL, after running FaceTrackNoIR.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_12">
+ <property name="geometry">
+ <rect>
+ <x>187</x>
+ <y>50</y>
+ <width>391</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Use this button to locate the desired NPClient DLL.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="bntLocateNPClient">
+ <property name="geometry">
+ <rect>
+ <x>4</x>
+ <y>30</y>
+ <width>171</width>
+ <height>23</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Locate DLL</string>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
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.
diff --git a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h index 00f124f6..c82c3e79 100644 --- a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h +++ b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h @@ -76,6 +76,7 @@ private: QLibrary FTIRViewsLib;
QProcess *dummyTrackIR;
int intGameID;
+ int intUsedInterface; // Determine which interface to use (or to hide from the game)
bool useTIRViews; // Needs to be in the Settings dialog
bool useDummyExe;
@@ -114,9 +115,11 @@ private: FTNoIR_Protocol *theProtocol;
private slots:
+ void selectDLL();
void doOK();
void doCancel();
void settingChanged() { settingsDirty = true; };
+ void settingChanged(int) { settingsDirty = true; };
};
//*******************************************************************************************************
diff --git a/FTNoIR_Protocol_FT/FTTypes.h b/FTNoIR_Protocol_FT/FTTypes.h index ece410ff..1f389711 100644 --- a/FTNoIR_Protocol_FT/FTTypes.h +++ b/FTNoIR_Protocol_FT/FTTypes.h @@ -92,6 +92,13 @@ struct FTMemMap { };
typedef FTMemMap * PFTMemMap;
-extern bool (*FTGetData) (PFreetrackData data);
+//extern bool (*FTGetData) (PFreetrackData data);
+// DLL function signatures
+// These match those given in FTTypes.pas
+// WINAPI is macro for __stdcall defined somewhere in the depths of windows.h
+typedef bool (WINAPI *importGetData)(TFreeTrackData * data);
+typedef char *(WINAPI *importGetDllVersion)(void);
+typedef void (WINAPI *importReportID)(int name);
+typedef char *(WINAPI *importProvider)(void);
#endif//INCLUDED_FTTYPES_H
diff --git a/FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp b/FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp index 678b3a5f..9f6fdcb1 100644 --- a/FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp +++ b/FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp @@ -32,6 +32,7 @@ */
#include "ftnoir_protocol_ft.h"
#include <QDebug>
+#include <QFileDialog>
//*******************************************************************************************************
// FaceTrackNoIR Client Settings-dialog.
@@ -52,6 +53,12 @@ QWidget() connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
connect(ui.chkTIRViews, SIGNAL(stateChanged(int)), this, SLOT(chkTIRViewsChanged()));
connect(ui.chkStartDummy, SIGNAL(stateChanged(int)), this, SLOT(settingChanged()));
+ connect(ui.cbxSelectInterface, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged( int )));
+ connect(ui.bntLocateNPClient, SIGNAL(clicked()), this, SLOT(selectDLL()));
+
+ ui.cbxSelectInterface->addItem("Enable both");
+ ui.cbxSelectInterface->addItem("Use FreeTrack, hide TrackIR");
+ ui.cbxSelectInterface->addItem("Use TrackIR, hide FreeTrack");
aFileName = QCoreApplication::applicationDirPath() + "/TIRViews.dll";
if ( !QFile::exists( aFileName ) ) {
@@ -147,7 +154,7 @@ void FTControls::loadSettings() { qDebug() << "loadSettings says: iniFile = " << currentFile;
iniFile.beginGroup ( "FT" );
-// ui.chkTIRViews->setChecked (iniFile.value ( "useTIRViews", 0 ).toBool());
+ ui.cbxSelectInterface->setCurrentIndex( iniFile.value ( "UsedInterface", 0 ).toInt() );
iniFile.endGroup ();
iniFile.beginGroup ( "FTIR" );
@@ -168,6 +175,7 @@ void FTControls::save() { QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
iniFile.beginGroup ( "FT" );
+ iniFile.setValue ( "UsedInterface", ui.cbxSelectInterface->currentIndex());
iniFile.endGroup ();
iniFile.beginGroup ( "FTIR" );
@@ -178,6 +186,33 @@ void FTControls::save() { settingsDirty = false;
}
+//
+// Select a NPClient.dll file, to repair the Location in the Registry.
+// Several program distribute their own version of this file.
+//
+void FTControls::selectDLL() {
+ QFileDialog::Options options;
+ QFileDialog::FileMode mode;
+
+ options |= QFileDialog::DontUseNativeDialog;
+ mode = QFileDialog::ExistingFile;
+ QString selectedFilter;
+ QString fileName = QFileDialog::getOpenFileName( this, tr("Select the desired NPClient DLL"), QCoreApplication::applicationDirPath() + "/NPClient.dll", tr("Dll file (*.dll);;All Files (*)"));
+
+ //
+ // Write the location of the file in the required Registry-key.
+ //
+ if (! fileName.isEmpty() ) {
+ if (fileName.endsWith("NPClient.dll", Qt::CaseInsensitive) ) {
+ QSettings settingsTIR("NaturalPoint", "NATURALPOINT\\NPClient Location"); // Registry settings (in HK_USER)
+ QString aLocation = fileName.left(fileName.length() - 12); // Location of Client DLL
+
+ settingsTIR.setValue( "Path" , aLocation );
+ }
+ }
+}
+
+
////////////////////////////////////////////////////////////////////////////////
// Factory function that creates instances if the Protocol-settings dialog object.
diff --git a/FaceTrackNoIR/FaceTrackNoIR.ui b/FaceTrackNoIR/FaceTrackNoIR.ui index e4fd2a7c..8c3db4a4 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.ui +++ b/FaceTrackNoIR/FaceTrackNoIR.ui @@ -342,7 +342,7 @@ Support FaceTrackNoIR!</string> <widget class="QLCDNumber" name="lcdNumOutputPosX">
<property name="geometry">
<rect>
- <x>114</x>
+ <x>112</x>
<y>34</y>
<width>50</width>
<height>21</height>
@@ -370,7 +370,7 @@ Support FaceTrackNoIR!</string> <widget class="QLCDNumber" name="lcdNumOutputPosY">
<property name="geometry">
<rect>
- <x>114</x>
+ <x>112</x>
<y>52</y>
<width>50</width>
<height>21</height>
@@ -398,7 +398,7 @@ Support FaceTrackNoIR!</string> <widget class="QLCDNumber" name="lcdNumOutputPosZ">
<property name="geometry">
<rect>
- <x>114</x>
+ <x>112</x>
<y>70</y>
<width>50</width>
<height>21</height>
@@ -474,7 +474,7 @@ Support FaceTrackNoIR!</string> <widget class="QLabel" name="lblRotZ">
<property name="geometry">
<rect>
- <x>166</x>
+ <x>164</x>
<y>74</y>
<width>20</width>
<height>16</height>
@@ -490,7 +490,7 @@ Support FaceTrackNoIR!</string> <widget class="QLabel" name="lblRotX">
<property name="geometry">
<rect>
- <x>168</x>
+ <x>166</x>
<y>35</y>
<width>20</width>
<height>16</height>
@@ -506,9 +506,9 @@ Support FaceTrackNoIR!</string> <widget class="QLabel" name="lblRotY">
<property name="geometry">
<rect>
- <x>166</x>
+ <x>164</x>
<y>55</y>
- <width>22</width>
+ <width>25</width>
<height>16</height>
</rect>
</property>
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp index 1dd2cf1b..2c09917b 100644 --- a/FaceTrackNoIR/tracker.cpp +++ b/FaceTrackNoIR/tracker.cpp @@ -424,6 +424,9 @@ bool bTracker2Confid = false; if(::WaitForSingleObject(m_StopThread, 0) == WAIT_OBJECT_0)
{
dinkeyboard->Unacquire(); // Unacquire keyboard
+ dinkeyboard->Release();
+ dinmouse->Unacquire(); // Unacquire mouse
+ dinmouse->Release();
din->Release(); // Release DirectInput
// Set event
diff --git a/FreeTrackClient/FTClient.cpp b/FreeTrackClient/FTClient.cpp new file mode 100644 index 00000000..d48a2c28 --- /dev/null +++ b/FreeTrackClient/FTClient.cpp @@ -0,0 +1,119 @@ +/** @file
+ @brief
+*/
+#include "FTClient.h"
+
+
+
+
+ static double/*?*/ const FT_PROGRAMID = "FT_ProgramID";
+
+
+ HANDLE hFTMemMap;
+ PFreetrackData FTData;
+ unsigned long lastDataID;
+ PHandle FTHandle;
+ PAnsiChar FTProgramName;
+ HANDLE FTMutex;
+
+
+bool FTGetData(PFreetrackData data)
+{ bool result;
+ result = false;
+ if( !! FTData ) {
+ if( FTData->DataID != lastDataID ) {
+ Move( FTData/*?*/^ , data/*?*/^ , SizeOf( TFreetrackData ) );
+ lastDataID = FTData->DataID;
+ result = true;
+ }
+ } else
+ OpenMapping;
+return result;
+}
+
+
+void FTReportName(PAnsiChar name)
+{
+ unsigned long MsgResult;
+
+ if( OpenMapping && ( WaitForSingleObject( FTMutex , 100 ) == WAIT_OBJECT_0 ) ) {
+ Move( name/*?*/^ , FTProgramName/*?*/^ , 100 );
+ SendMessageTimeout( FTHandle/*?*/^ , RegisterWindowMessage( FT_PROGRAMID ) , 0 , 0 , 0 , 2000 , MsgResult );
+ ReleaseMutex( FTMutex );
+ }
+}
+
+
+char* FTGetDllVersion()
+{ char* result;
+ unsigned long VerInfoSize;
+ Pointer VerInfo;
+ unsigned long VerValueSize;
+ PVSFixedFileInfo VerValue;
+ unsigned long Dummy;
+ std::string verString;
+ char* dllName[100];
+
+ result = "";
+ GetModuleFilename( HInstance , &dllName , 100 );
+ VerInfoSize = GetFileVersionInfoSize( &dllName , Dummy );
+ if( !( VerInfoSize == 0 ) ) {
+ GetMem( VerInfo , VerInfoSize );
+ GetFileVersionInfo( &dllName , 0 , VerInfoSize , VerInfo );
+ VerQueryValue( VerInfo , "\\" , Pointer( VerValue ) , VerValueSize );
+ /*?*//* WITH VerValue/*?*/^ */
+ {
+ verString = IntToStr( dwFileVersionMS >> 16 );
+ verString = verString + "." + IntToStr( dwFileVersionMS && 0xFFFF );
+ verString = verString + "." + IntToStr( dwFileVersionLS >> 16 );
+ verString = verString + "." + IntToStr( dwFileVersionLS && 0xFFFF );
+ result = char*( verString );
+ }
+ FreeMem( VerInfo , VerInfoSize );
+ }
+return result;
+}
+
+
+char* FTProvider()
+{ char* result;
+ result = FREETRACK;return result;
+}
+
+
+
+
+
+bool OpenMapping()
+{ bool result;
+ if( hFTMemMap != 0 )
+ result = true;else {
+ hFTMemMap = OpenFileMapping( FILE_MAP_ALL_ACCESS , false , FT_MM_DATA );
+ if( ( hFTMemMap != 0 ) ) {
+ FTData = MapViewOfFile( hFTMemMap , FILE_MAP_ALL_ACCESS , 0 , 0 , SizeOf( TFreetrackData ) + SizeOf( HANDLE ) + 100 );
+ FTHandle = Pointer( unsigned long( FTData ) + SizeOf( TFreetrackData ) );
+ FTProgramName = Pointer( unsigned long( FTHandle ) + SizeOf( HANDLE ) );
+ FTMutex = OpenMutex( MUTEX_ALL_ACCESS , false , FREETRACK_MUTEX );
+ }
+ result = !! FTData;
+ }
+return result;
+}
+
+
+void DestroyMapping()
+{
+ if( FTData != 00 ) {
+ UnMapViewofFile( FTData );
+ FTData = 00;
+ }
+
+ CloseHandle( FTMutex );
+ CloseHandle( hFTMemMap );
+ hFTMemMap = 0;
+}
+
+
+
+
+//END
diff --git a/FreeTrackClient/FTClient.h b/FreeTrackClient/FTClient.h new file mode 100644 index 00000000..406e1237 --- /dev/null +++ b/FreeTrackClient/FTClient.h @@ -0,0 +1,30 @@ +/** @file
+ @brief
+*/
+#pragma once
+#ifndef INCLUDED_FTCLIENT_H
+#define INCLUDED_FTCLIENT_H
+
+
+
+
+
+
+#include "Windows.h"
+#include "SysUtils.h"
+#include "FTTypes.h"
+
+/*__stdcall*/ bool FTGetData(PFreetrackData data);
+/*__stdcall*/ void FTReportName(PAnsiChar name);
+/*__stdcall*/ char* FTGetDllVersion();
+/*__stdcall*/ char* FTProvider();
+
+
+bool OpenMapping();
+void DestroyMapping();
+
+
+
+
+#endif//INCLUDED_FTCLIENT_H
+//END
diff --git a/FreeTrackClient/FreeTrackClient.sln b/FreeTrackClient/FreeTrackClient.sln new file mode 100644 index 00000000..5bbc5a5b --- /dev/null +++ b/FreeTrackClient/FreeTrackClient.sln @@ -0,0 +1,26 @@ +
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeTrackClient", "FreeTrackClient\FreeTrackClient.vcproj", "{74CE36A5-0E38-4252-AAD1-7B2066247F0E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ Release64|Win32 = Release64|Win32
+ Release64|x64 = Release64|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {74CE36A5-0E38-4252-AAD1-7B2066247F0E}.Release|Win32.ActiveCfg = Release|Win32
+ {74CE36A5-0E38-4252-AAD1-7B2066247F0E}.Release|Win32.Build.0 = Release|Win32
+ {74CE36A5-0E38-4252-AAD1-7B2066247F0E}.Release|x64.ActiveCfg = Release|x64
+ {74CE36A5-0E38-4252-AAD1-7B2066247F0E}.Release|x64.Build.0 = Release|x64
+ {74CE36A5-0E38-4252-AAD1-7B2066247F0E}.Release64|Win32.ActiveCfg = Release64|Win32
+ {74CE36A5-0E38-4252-AAD1-7B2066247F0E}.Release64|Win32.Build.0 = Release64|Win32
+ {74CE36A5-0E38-4252-AAD1-7B2066247F0E}.Release64|x64.ActiveCfg = Release64|x64
+ {74CE36A5-0E38-4252-AAD1-7B2066247F0E}.Release64|x64.Build.0 = Release64|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/FreeTrackClient/FreeTrackClient/FreeTrackClient.cpp b/FreeTrackClient/FreeTrackClient/FreeTrackClient.cpp new file mode 100644 index 00000000..e02f2fe8 --- /dev/null +++ b/FreeTrackClient/FreeTrackClient/FreeTrackClient.cpp @@ -0,0 +1,294 @@ +/********************************************************************************
+* FreeTrackClientDll Implements the FreeTrack 2.0 interface for FT-enabled *
+* games. *
+* It uses the FreeTrack protocol (memory mapping) to *
+* receive data from FaceTrackNoIR (or FreeTrack, or ...). *
+* *
+* Copyright (C) 2013 Wim Vriend (Developing) *
+* Ron Hendriks (Testing and Research) *
+* *
+* Homepage <http://facetracknoir.sourceforge.net/home/default.htm> *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU General Public License as published by the *
+* Free Software Foundation; either version 3 of the License, or (at your *
+* option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but *
+* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
+* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
+* more details. *
+* *
+* You should have received a copy of the GNU General Public License along *
+* with this program; if not, see <http://www.gnu.org/licenses/>. *
+* *
+********************************************************************************/
+/*
+ Modifications (last one on top):
+
+ 20130208 - WVR: The old DLL from FreeTrack seems to crash ArmA2. And we need 64-bit support.
+
+*/
+
+#ifdef WIN64
+#pragma comment(linker, "/export:FTGetData")
+#pragma comment(linker, "/export:FTReportName")
+#pragma comment(linker, "/export:FTGetDllVersion")
+#pragma comment(linker, "/export:FTProvider")
+#endif
+
+#ifdef WIN64
+# define FT_DECLSPEC __declspec(dllexport)
+#else
+# define FT_DECLSPEC
+#endif
+
+#define FT_EXPORT(t) extern "C" t FT_DECLSPEC __stdcall
+#define NP_AXIS_MAX 16383
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <windows.h>
+#include <tchar.h>
+
+#include "..\..\FTNOIR_PROTOCOL_FT\FTTypes.h"
+
+//
+// Functions to create/open the file-mapping
+// and to destroy it again.
+//
+bool FTCreateMapping();
+void FTDestroyMapping();
+float scale2AnalogLimits( float x, float min_x, float max_x );
+float getDegreesFromRads ( float rads );
+
+#if 1
+static FILE *debug_stream = fopen("c:\\FreeTrackClient.log", "a");
+#define dbg_report(...) if (debug_stream) { fprintf(debug_stream, __VA_ARGS__); fflush(debug_stream); }
+#else
+#define dbg_report(...)
+#endif
+
+//
+// Handles to 'handle' the memory mapping
+//
+static HANDLE hFTMemMap = 0;
+static FTMemMap *pMemData = 0;
+static HANDLE hFTMutex = 0;
+static char* dllVersion = "1.0.0.0";
+static char* dllProvider = "FreeTrack";
+
+static unsigned short gameid = 0;
+
+//
+// DllMain gets called, when the DLL is (un)loaded or a process attaches.
+//
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ switch (fdwReason) {
+ case DLL_PROCESS_ATTACH:
+#ifdef WIN64
+ dbg_report("\n= WIN64 =========================================================================================\n");
+#else
+ dbg_report("\n= WIN32 =========================================================================================\n");
+#endif
+ dbg_report("DllMain: (0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
+ dbg_report("DllMain: Attach request\n");
+ DisableThreadLibraryCalls(hinstDLL);
+ break;
+
+ case DLL_PROCESS_DETACH:
+ dbg_report("DllMain: Detach\n");
+ dbg_report("DllMain: (0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
+ dbg_report("==========================================================================================\n");
+ break;
+ }
+ return TRUE;
+}
+
+/******************************************************************
+ * FTGetData (FreeTrackClient.1)
+ */
+#pragma comment(linker, "/export:FTGetData@4=FTGetData")
+FT_EXPORT(bool) FTGetData(PFreetrackData data)
+{
+ static int frame = 0;
+ static int prevDataID = 0;
+ static int dlyTrackingOff = 0;
+ static int tracking = 0;
+
+// dbg_report("NP_GetData called.");
+ if (FTCreateMapping() == false) return false;
+
+ if (hFTMutex && WaitForSingleObject(hFTMutex, 5) == WAIT_OBJECT_0) {
+ if (pMemData) {
+
+ //
+ // When FaceTrackNoIR does not update frames (any more), don't update the data.
+ //
+ if (prevDataID != pMemData->data.DataID) {
+ memcpy(data, &pMemData->data, sizeof(TFreeTrackData));
+ dlyTrackingOff = 0;
+ }
+ else {
+ dlyTrackingOff++;
+ if (dlyTrackingOff > 20) {
+ dlyTrackingOff = 100;
+ tracking = false;
+ }
+ }
+ prevDataID = pMemData->data.DataID;
+
+ //
+ // Limit the range of DataID
+ //
+ if (pMemData->data.DataID > 1000) {
+ pMemData->data.DataID = 0;
+ }
+ data->DataID = pMemData->data.DataID;
+
+ //
+ // Send the ID to FaceTrackNoIR, so it can display the game-name.
+ // This could be a FreeTrack-specific ID
+ //
+ sprintf_s(pMemData->GameID, 19, "%d", gameid );
+
+ }
+ ReleaseMutex(hFTMutex);
+ }
+ return true;
+}
+
+/******************************************************************
+ * FTReportName (FreeTrackClient.2)
+ */
+#pragma comment(linker, "/export:FTReportName@4=FTReportName")
+//
+// For some mysterious reason, the previously existing function FTReportID has been changed to FTReportName, but with an integer as argument.
+// The Delphi-code from the FreeTrack repo suggest a char * as argument, so it cost me an afternoon to figure it out (and keep ArmA2 from crashing).
+// Thanks guys!
+//
+FT_EXPORT(void) FTReportName( int name )
+{
+ dbg_report("FTReportName request (ID = %d).\n", name);
+ gameid = name; // They might have really passed the name here... but they didn't!
+ return;
+}
+
+/******************************************************************
+ * FTGetDllVersion (FreeTrackClient.3)
+ */
+#pragma comment(linker, "/export:FTGetDllVersion@0=FTGetDllVersion")
+extern "C" __declspec( dllexport ) char* FTGetDllVersion(void)
+{
+ dbg_report("FTGetDllVersion request.\n");
+
+ return dllVersion;
+}
+
+/******************************************************************
+ * FTProvider (FreeTrackClient.4)
+ */
+#pragma comment(linker, "/export:FTProvider@0=FTProvider")
+extern "C" __declspec( dllexport ) char* FTProvider(void)
+{
+ dbg_report("FTProvider request.\n");
+
+ return dllProvider;
+}
+
+//
+// Create a memory-mapping to the Freetrack data.
+// It contains the tracking data, a handle to the main-window and the program-name of the Game!
+//
+//
+bool FTCreateMapping()
+{
+ bool bMappingExists = false;
+ PDWORD_PTR MsgResult = 0;
+
+ //
+ // Memory-mapping already exists!
+ //
+ if ( pMemData != NULL ) {
+ return true;
+ }
+
+ dbg_report("FTCreateMapping request (pMemData == NULL).\n");
+
+ //
+ // A FileMapping is used to create 'shared memory' between the FTClient and the FTServer.
+ //
+ // Try to create a FileMapping to the Shared Memory. This is done to check if it's already there (what
+ // may mean the face-tracker program is already running).
+ //
+ // If one already exists: close it and open the file-mapping to the existing one.
+ //
+ hFTMemMap = CreateFileMappingA( INVALID_HANDLE_VALUE , 00 , PAGE_READWRITE , 0 ,
+ sizeof( FTMemMap ),
+ (LPCSTR) FT_MM_DATA );
+
+ if ( ( hFTMemMap != 0 ) && ( GetLastError() == ERROR_ALREADY_EXISTS ) ) {
+ dbg_report("FTCreateMapping: Mapping already exists.\n");
+ bMappingExists = true; // So the server was (probably) already started!
+ CloseHandle( hFTMemMap );
+ hFTMemMap = 0;
+ }
+
+ //
+ // Create a new FileMapping, Read/Write access
+ //
+ hFTMemMap = OpenFileMappingA( FILE_MAP_ALL_ACCESS , false , (LPCSTR) FT_MM_DATA );
+ if ( ( hFTMemMap != 0 ) ) {
+ dbg_report("FTCreateMapping: Mapping opened.\n");
+ pMemData = (FTMemMap *) MapViewOfFile(hFTMemMap, FILE_MAP_ALL_ACCESS, 0, 0, sizeof( FTMemMap ) );
+ hFTMutex = CreateMutexA(NULL, false, FREETRACK_MUTEX);
+ }
+ else {
+ return false;
+ }
+ return true;
+}
+
+//
+// Destory the FileMapping to the shared memory
+//
+void FTDestroyMapping()
+{
+ if ( pMemData != NULL ) {
+ UnmapViewOfFile ( pMemData );
+ }
+
+ CloseHandle( hFTMutex );
+ CloseHandle( hFTMemMap );
+ pMemData = 0;
+ hFTMemMap = 0;
+}
+
+//
+// 4 convenience
+//
+float getDegreesFromRads ( float rads ) {
+ return (rads * 57.295781f);
+}
+
+//
+// Scale the measured value to the TIR values
+//
+float scale2AnalogLimits( float x, float min_x, float max_x ) {
+double y;
+double local_x;
+
+ local_x = x;
+ if (local_x > max_x) {
+ local_x = max_x;
+ }
+ if (local_x < min_x) {
+ local_x = min_x;
+ }
+ y = ( NP_AXIS_MAX * local_x ) / max_x;
+
+ return (float) y;
+}
diff --git a/FreeTrackClient/FreeTrackClient/FreeTrackClient.rc b/FreeTrackClient/FreeTrackClient/FreeTrackClient.rc new file mode 100644 index 00000000..299beb82 --- /dev/null +++ b/FreeTrackClient/FreeTrackClient/FreeTrackClient.rc @@ -0,0 +1,103 @@ +// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Dutch (Netherlands) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD)
+#ifdef _WIN32
+LANGUAGE LANG_DUTCH, SUBLANG_DUTCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "041304b0"
+ BEGIN
+ VALUE "Comments", "FreeTrack interface for FaceTrackNoIR."
+ VALUE "CompanyName", "FaceTrackNoIR Team"
+ VALUE "FileDescription", "64-bit interface for FreeTrack-enables games."
+ VALUE "FileVersion", "1, 0, 0, 1"
+ VALUE "InternalName", "FreeTrackClient"
+ VALUE "LegalCopyright", "Copyright (C) 2013, FaceTrackNoIR Team"
+ VALUE "OriginalFilename", "FreeTrackClient64.dll"
+ VALUE "ProductName", "Interface DLL for FreeTrack 2.0"
+ VALUE "ProductVersion", "1, 0, 0, 1"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x413, 1200
+ END
+END
+
+#endif // Dutch (Netherlands) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/FreeTrackClient/FreeTrackClient/FreeTrackClient.vcproj b/FreeTrackClient/FreeTrackClient/FreeTrackClient.vcproj new file mode 100644 index 00000000..7d69802e --- /dev/null +++ b/FreeTrackClient/FreeTrackClient/FreeTrackClient.vcproj @@ -0,0 +1,556 @@ +<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="FreeTrackClient"
+ ProjectGUID="{74CE36A5-0E38-4252-AAD1-7B2066247F0E}"
+ RootNamespace="FreeTrackClient"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\$(PlatformName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FreeTrackClient_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\$(PlatformName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FreeTrackClient_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\$(PlatformName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ OmitFramePointers="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;FreeTrackClient_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="false"
+ EnableEnhancedInstructionSet="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="1"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="postbuild.bat "$(OutDir)" "D:\Project\FaceTrackNoIR\VS2005\FaceTrackNoIR\bin""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\$(PlatformName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ OmitFramePointers="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FreeTrackClient_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="false"
+ EnableEnhancedInstructionSet="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="1"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release64|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\$(PlatformName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ OmitFramePointers="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FreeTrackClient_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="false"
+ EnableEnhancedInstructionSet="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="1"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release64|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\$(PlatformName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ OmitFramePointers="true"
+ PreprocessorDefinitions="WIN64;NDEBUG;_USRDLL;FreeTrackClient_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="false"
+ EnableEnhancedInstructionSet="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\$(ProjectName)64.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ VerboseOutput="true"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="postbuild.bat "$(OutDir)" "D:\Project\FaceTrackNoIR\VS2005\FaceTrackNoIR\bin""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\FreeTrackClient.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\postbuild.bat"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\FTNoIR_Protocol_FT\FTTypes.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resources"
+ >
+ <File
+ RelativePath=".\FreeTrackClient.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/FreeTrackClient/FreeTrackClient/postbuild.bat b/FreeTrackClient/FreeTrackClient/postbuild.bat new file mode 100644 index 00000000..87c192d1 --- /dev/null +++ b/FreeTrackClient/FreeTrackClient/postbuild.bat @@ -0,0 +1,15 @@ +@echo off
+rem Copies required DLL files into output folder.
+
+setlocal
+set COPY=xcopy /D /S /C /I /H /R /Y
+set FILTER=find /v "File(s) copied"
+
+echo parameters %1 en %2
+
+set API_BIN=%1
+set FTN_BIN=%2
+
+%COPY% %API_BIN%\*.dll %FTN_BIN%\ | %FILTER%
+exit /b 0
+
diff --git a/FreeTrackClient/FreeTrackClient/resource.h b/FreeTrackClient/FreeTrackClient/resource.h new file mode 100644 index 00000000..e517577e --- /dev/null +++ b/FreeTrackClient/FreeTrackClient/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by FreeTrackClient.rc
+//
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
|