From 589371a5aa5d552533e2412bc995ae2a60405bf5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 28 Oct 2014 09:06:06 +0100 Subject: unbreak ftclient, needs MSVC no matter what --- CMakeLists.txt | 13 ++-- bin/freetrackclient.dll | Bin 0 -> 75776 bytes freetrackclient/freetrackclient.c | 12 ++-- freetrackclient/fttypes.h | 69 +++++++++++++++++++++ ftnoir_protocol_ft/ftnoir_protocol_ft.h | 2 +- ftnoir_protocol_ft/fttypes.h | 68 -------------------- .../opentrack-wrapper-wine-main.cxx | 2 +- 7 files changed, 84 insertions(+), 82 deletions(-) create mode 100755 bin/freetrackclient.dll create mode 100644 freetrackclient/fttypes.h delete mode 100644 ftnoir_protocol_ft/fttypes.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 5165b365..d0e7a6e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,7 @@ endif() opentrack_module(opentrack-compat compat) opentrack_module(opentrack-xplane-plugin x-plane-plugin) -opentrack_module(freetrackclient freetrackclient) +#opentrack_module(freetrackclient freetrackclient) if(SDK_XPLANE) # probably librt already included @@ -292,10 +292,10 @@ if(WIN32) opentrack_library(opentrack-proto-win32-mouse ftnoir_protocol_mouse) endif() -if(WIN32) - add_library(freetrackclient SHARED ${freetrackclient-c}) - set_target_properties(freetrackclient PROPERTIES PREFIX "") -endif() +#if(WIN32) +# add_library(freetrackclient SHARED ${freetrackclient-c}) +# set_target_properties(freetrackclient PROPERTIES PREFIX "") +#endif() opentrack_library(opentrack-proto-udp ftnoir_protocol_ftn) @@ -466,11 +466,12 @@ endif() if(WIN32) install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/tracker-ht DESTINATION .) - install(TARGETS freetrackclient RUNTIME DESTINATION . LIBRARY DESTINATION . ) + #install(TARGETS freetrackclient RUNTIME DESTINATION . LIBRARY DESTINATION . ) endif() install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty-notices DESTINATION .) +install(FILES "${CMAKE_SOURCE_DIR}/bin/freetrackclient.dll" DESTINATION .) install(FILES "${CMAKE_SOURCE_DIR}/bin/NPClient.dll" "${CMAKE_SOURCE_DIR}/bin/NPClient64.dll" "${CMAKE_SOURCE_DIR}/bin/TrackIR.exe" DESTINATION .) install(DIRECTORY "${CMAKE_SOURCE_DIR}/bin/settings" "${CMAKE_SOURCE_DIR}/clientfiles" DESTINATION .) diff --git a/bin/freetrackclient.dll b/bin/freetrackclient.dll new file mode 100755 index 00000000..4d4b64ab Binary files /dev/null and b/bin/freetrackclient.dll differ 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 #include -#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 @@ -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 * + * * * + * * 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 +#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; diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.h b/ftnoir_protocol_ft/ftnoir_protocol_ft.h index ba98b4b7..6bbf1bd3 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft.h +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.h @@ -38,7 +38,7 @@ #include #include "compat/compat.h" #include "opentrack/options.hpp" -#include "fttypes.h" +#include "../freetrackclient/fttypes.h" using namespace options; struct settings { diff --git a/ftnoir_protocol_ft/fttypes.h b/ftnoir_protocol_ft/fttypes.h deleted file mode 100644 index f41350c8..00000000 --- a/ftnoir_protocol_ft/fttypes.h +++ /dev/null @@ -1,68 +0,0 @@ -/************************************************************************************ - * * 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 * - * * * - * * 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 -#else -typedef unsigned __int32 uint32_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; diff --git a/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx b/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx index 9a07681c..47e53eb7 100644 --- a/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx +++ b/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx @@ -1,6 +1,6 @@ #include #include -#include "ftnoir_protocol_ft/fttypes.h" +#include "freetrackclient/fttypes.h" #include "ftnoir_protocol_wine/wine-shm.h" #define OPENTRACK_CROSS_ONLY -- cgit v1.2.3