summaryrefslogtreecommitdiffhomepage
path: root/freetrackclient
diff options
context:
space:
mode:
Diffstat (limited to 'freetrackclient')
-rw-r--r--freetrackclient/freetrackclient.c12
-rw-r--r--freetrackclient/fttypes.h69
2 files changed, 75 insertions, 6 deletions
diff --git a/freetrackclient/freetrackclient.c b/freetrackclient/freetrackclient.c
index 4bc39d67..95830221 100644
--- a/freetrackclient/freetrackclient.c
+++ b/freetrackclient/freetrackclient.c
@@ -31,9 +31,9 @@
#include <string.h>
#include <windows.h>
-#include "../ftnoir_protocol_ft/fttypes.h"
+#include "fttypes.h"
-#define FT_EXPORT(t) __declspec(dllexport) t __stdcall
+#define FT_EXPORT(t) t __stdcall
#if 0
# include <stdio.h>
@@ -70,7 +70,6 @@ static bool impl_create_mapping(void)
return true;
}
-#pragma comment (linker, "/export:FTGetData")
FT_EXPORT(bool) FTGetData(FTData* data)
{
if (impl_create_mapping() == false)
@@ -92,23 +91,24 @@ FT_EXPORT(bool) FTGetData(FTData* data)
// 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!
*/
-#pragma comment (linker, "/export:FTReportName")
FT_EXPORT(void) FTReportName( int name )
{
dbg_report("FTReportName request (ID = %d).\n", name);
}
-#pragma comment (linker, "/export:FTGetDllVersion")
FT_EXPORT(const char*) FTGetDllVersion(void)
{
dbg_report("FTGetDllVersion request.\n");
return dllVersion;
}
-#pragma comment (linker, "/export:FTProvider")
FT_EXPORT(const char*) FTProvider(void)
{
dbg_report("FTProvider request.\n");
return dllProvider;
}
+#pragma comment (linker, "/export:FTReportName=_FTReportName@4")
+#pragma comment (linker, "/export:FTGetDllVersion=_FTGetDllVersion@0")
+#pragma comment (linker, "/export:FTProvider=_FTProvider@0")
+#pragma comment (linker, "/export:FTGetData=_FTGetData@4")
diff --git a/freetrackclient/fttypes.h b/freetrackclient/fttypes.h
new file mode 100644
index 00000000..ad974110
--- /dev/null
+++ b/freetrackclient/fttypes.h
@@ -0,0 +1,69 @@
+/************************************************************************************
+ * * FTTypes FTTypes contains the specific type definitions for the *
+ * * FreeTrack protocol. *
+ * * It was loosely translated from FTTypes.pas *
+ * * which was created by the FreeTrack-team. *
+ * * *
+ * * Wim Vriend (Developing) *
+ * * Ron Hendriks (Testing and Research) *
+ * * *
+ * * Homepage <http://facetracknoir.sourceforge.net/home/default.htm> *
+ * * *
+ * * 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. *
+ * * *
+ * * The FTTypes sources were translated from the original Delphi sources *
+ * * created by the FreeTrack developers. *
+ */
+
+#pragma once
+
+#ifndef _MSC_VER
+# include <inttypes.h>
+#else
+typedef unsigned __int32 uint32_t;
+typedef __int32 int32_t;
+#endif
+
+#define FREETRACK_HEAP "FT_SharedMem"
+#define FREETRACK_MUTEX "FT_Mutext"
+
+/* only 6 headpose floats and the data id are filled -sh */
+typedef struct __FTData {
+ int DataID;
+ int CamWidth;
+ int CamHeight;
+ /* virtual pose */
+ float Yaw; /* positive yaw to the left */
+ float Pitch; /* positive pitch up */
+ float Roll; /* positive roll to the left */
+ float X;
+ float Y;
+ float Z;
+ /* raw pose with no smoothing, sensitivity, response curve etc. */
+ float RawYaw;
+ float RawPitch;
+ float RawRoll;
+ float RawX;
+ float RawY;
+ float RawZ;
+ /* raw points, sorted by Y, origin top left corner */
+ float X1;
+ float Y1;
+ float X2;
+ float Y2;
+ float X3;
+ float Y3;
+ float X4;
+ float Y4;
+} FTData;
+
+/* we add some shit at the end for other legacy proto, sadly */
+
+typedef struct __FTHeap {
+ FTData data;
+ int32_t GameID;
+ unsigned char table[8];
+ int32_t GameID2;
+} FTHeap;