From 6be2bbea386c0fb98c750927b1ade2c6dd9d3fbe Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 13 Sep 2013 15:02:31 +0200 Subject: Remove per-file version history. Be careful not to touch copyright information. --- freetrackclient/freetrackclient.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'freetrackclient/freetrackclient.cpp') diff --git a/freetrackclient/freetrackclient.cpp b/freetrackclient/freetrackclient.cpp index 98544e2d..52aa6190 100644 --- a/freetrackclient/freetrackclient.cpp +++ b/freetrackclient/freetrackclient.cpp @@ -23,12 +23,6 @@ * with this program; if not, see . * * * ********************************************************************************/ -/* - Modifications (last one on top): - - 20130208 - WVR: The old DLL from FreeTrack seems to crash ArmA2. And we need 64-bit support. - -*/ #define FT_EXPORT(t) extern "C" t __declspec(dllexport) __stdcall #define NP_AXIS_MAX 16383 -- cgit v1.2.3 From 94c0368c1a008d089ab780ffcea4f8aa24a0ee35 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 14 Sep 2013 23:46:24 +0200 Subject: Unbreak Windows build --- facetracknoir/facetracknoir.h | 1 + freetrackclient/freetrackclient.cpp | 18 +++++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'freetrackclient/freetrackclient.cpp') diff --git a/facetracknoir/facetracknoir.h b/facetracknoir/facetracknoir.h index 8f83a851..b4ea2912 100644 --- a/facetracknoir/facetracknoir.h +++ b/facetracknoir/facetracknoir.h @@ -62,6 +62,7 @@ #include "global-settings.h" #include "tracker.h" #include "facetracknoir/curve-config.h" +#include "facetracknoir/shortcuts.h" class Tracker; // pre-define class to avoid circular includes class FaceTrackNoIR; diff --git a/freetrackclient/freetrackclient.cpp b/freetrackclient/freetrackclient.cpp index 52aa6190..0f8ced65 100644 --- a/freetrackclient/freetrackclient.cpp +++ b/freetrackclient/freetrackclient.cpp @@ -34,7 +34,7 @@ #include #include -#include "ftnoir_protocol_ft\fttypes.h" +#include "ftnoir_protocol_ft/fttypes.h" // // Functions to create/open the file-mapping @@ -58,8 +58,8 @@ static FILE *debug_stream = fopen("c:\\FreeTrackClient.log", "a"); static HANDLE hFTMemMap = 0; static FTMemMap *pMemData = 0; static HANDLE hFTMutex = 0; -static char* dllVersion = "1.0.0.0"; -static char* dllProvider = "FreeTrack"; +static const char* dllVersion = "1.0.0.0"; +static const char* dllProvider = "FreeTrack"; static unsigned short gameid = 0; @@ -92,13 +92,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) /****************************************************************** * 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; @@ -117,7 +117,6 @@ FT_EXPORT(bool) FTGetData(PFreetrackData data) dlyTrackingOff++; if (dlyTrackingOff > 20) { dlyTrackingOff = 100; - tracking = false; } } prevDataID = pMemData->data.DataID; @@ -161,7 +160,7 @@ FT_EXPORT(void) FTReportName( int name ) * FTGetDllVersion (FreeTrackClient.3) */ #pragma comment(linker, "/export:FTGetDllVersion@0=FTGetDllVersion") -extern "C" __declspec( dllexport ) char* FTGetDllVersion(void) +extern "C" __declspec( dllexport ) const char* FTGetDllVersion(void) { dbg_report("FTGetDllVersion request.\n"); @@ -172,7 +171,7 @@ extern "C" __declspec( dllexport ) char* FTGetDllVersion(void) * FTProvider (FreeTrackClient.4) */ #pragma comment(linker, "/export:FTProvider@0=FTProvider") -extern "C" __declspec( dllexport ) char* FTProvider(void) +extern "C" __declspec( dllexport ) const char* FTProvider(void) { dbg_report("FTProvider request.\n"); @@ -186,8 +185,6 @@ extern "C" __declspec( dllexport ) char* FTProvider(void) // bool FTCreateMapping() { - bool bMappingExists = false; - // // Memory-mapping already exists! // @@ -211,7 +208,6 @@ bool FTCreateMapping() 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; } -- cgit v1.2.3 From 63461cea1a06434343a800a57004b326d4905f03 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 11 Oct 2013 12:58:08 +0200 Subject: clarify copyright Please see facetracknoir/develop: 336fc06ebe550d2c5fefae7dc1f967377eef998d https://sourceforge.net/p/facetracknoir/codegit/ci/336fc06ebe550d2c5fefae7dc1f967377eef998d/tree/ % git clone http://git.code.sf.net/p/facetracknoir/codegit Signed-off-by: Stanislaw Halik --- freetrackclient/freetrackclient.cpp | 45 ++++++++---------- ftnoir_protocol_ft/fttypes.h | 55 +++++++++------------- qfunctionconfigurator/qfunctionconfigurator.cpp | 41 +++------------- qfunctionconfigurator/qfunctionconfigurator.h | 40 +++------------- .../qfunctionconfiguratorplugin.cpp | 40 +++------------- .../qfunctionconfiguratorplugin.h | 6 +++ 6 files changed, 65 insertions(+), 162 deletions(-) (limited to 'freetrackclient/freetrackclient.cpp') diff --git a/freetrackclient/freetrackclient.cpp b/freetrackclient/freetrackclient.cpp index 0f8ced65..efc639ca 100644 --- a/freetrackclient/freetrackclient.cpp +++ b/freetrackclient/freetrackclient.cpp @@ -1,29 +1,22 @@ -/******************************************************************************** -* 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 * -* * -* 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 . * -* * -********************************************************************************/ - +/*********************************************************************************** + * * 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 FreeTrackClient sources were translated from the original Delphi sources * + * * created by the FreeTrack developers. * + */ #define FT_EXPORT(t) extern "C" t __declspec(dllexport) __stdcall #define NP_AXIS_MAX 16383 diff --git a/ftnoir_protocol_ft/fttypes.h b/ftnoir_protocol_ft/fttypes.h index 0c65fc2f..ced844dc 100644 --- a/ftnoir_protocol_ft/fttypes.h +++ b/ftnoir_protocol_ft/fttypes.h @@ -1,34 +1,21 @@ -/******************************************************************************** -* FTTypes FTTypes contains th specific type definitions for the * -* FreeTrack protocol. * -* It was loosely translated from FTTypes.pas * -* which was created by the FreeTrack-team. * -* * -* Copyright (C) 2013 Wim Vriend (Developing) * -* Ron Hendriks (Testing and Research) * -* * -* Homepage * -* * -* 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 . * -* * -* We would like to extend our grattitude to the creators of SweetSpotter, * -* which has become the basis of this program: "Great work guys!" * -********************************************************************************/ -/* - Modifications (last one on top): - 20130125 - WVR: Upgraded to FT2.0: now the FreeTrack protocol supports all TIR-enabled games. The memory-mapping was expanded for this purpose. -*/ +/************************************************************************************ + * * 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. * + */ #ifndef INCLUDED_FTTYPES_H #define INCLUDED_FTTYPES_H @@ -50,8 +37,8 @@ typedef __int32 my_32bit_int; #define FREETRACK_MUTEX "FT_Mutext" struct TFreeTrackData { - int DataID; - int CamWidth; + int DataID; + int CamWidth; int CamHeight; // virtual pose float Yaw; // positive yaw to the left @@ -80,7 +67,7 @@ struct TFreeTrackData { typedef TFreeTrackData * PFreetrackData; struct FTMemMap { - TFreeTrackData data; + TFreeTrackData data; my_32bit_int GameID; unsigned char table[8]; my_32bit_int GameID2; diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp index 802c0a1d..bad06f8a 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.cpp +++ b/qfunctionconfigurator/qfunctionconfigurator.cpp @@ -1,37 +1,10 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2012 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* 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 . * -* * -* The FunctionConfigurator was made by Stanislaw Halik, and adapted to * -* FaceTrackNoIR. * -* * -* All credits for this nice piece of code should go to Stanislaw. * -* * -* Copyright (c) 2011-2012, Stanislaw Halik * -* Permission to use, copy, modify, and/or distribute this * -* software for any purpose with or without fee is hereby granted, * -* provided that the above copyright notice and this permission * -* notice appear in all copies. * -********************************************************************************/ +/* Copyright (c) 2011-2012 Stanislaw Halik + * Adapted to FaceTrackNoIR by Wim Vriend. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + #include "qfunctionconfigurator/qfunctionconfigurator.h" #include #include diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h index 07eeeae3..8460751a 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.h +++ b/qfunctionconfigurator/qfunctionconfigurator.h @@ -1,37 +1,9 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2012 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* 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 . * -* * -* The FunctionConfigurator was made by Stanislaw Halik, and adapted to * -* FaceTrackNoIR. * -* * -* All credits for this nice piece of code should go to Stanislaw. * -* * -* Copyright (c) 2011-2012, Stanislaw Halik * -* Permission to use, copy, modify, and/or distribute this * -* software for any purpose with or without fee is hereby granted, * -* provided that the above copyright notice and this permission * -* notice appear in all copies. * -********************************************************************************/ +/* Copyright (c) 2011-2012 Stanislaw Halik + * Adapted to FaceTrackNoIR by Wim Vriend. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ #ifndef QFUNCTIONCONFIGURATOR_H #define QFUNCTIONCONFIGURATOR_H diff --git a/qfunctionconfigurator/qfunctionconfiguratorplugin.cpp b/qfunctionconfigurator/qfunctionconfiguratorplugin.cpp index 5e98eb39..9bed2c9e 100644 --- a/qfunctionconfigurator/qfunctionconfiguratorplugin.cpp +++ b/qfunctionconfigurator/qfunctionconfiguratorplugin.cpp @@ -1,37 +1,9 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2012 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* 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 . * -* * -* The FunctionConfigurator was made by Stanislaw Halik, and adapted to * -* FaceTrackNoIR. * -* * -* All credits for this nice piece of code should go to Stanislaw. * -* * -* Copyright (c) 2011-2012, Stanislaw Halik * -* Permission to use, copy, modify, and/or distribute this * -* software for any purpose with or without fee is hereby granted, * -* provided that the above copyright notice and this permission * -* notice appear in all copies. * -********************************************************************************/ +/* Copyright (c) 2011-2012 Stanislaw Halik + * Adapted to FaceTrackNoIR by Wim Vriend. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ #include "qfunctionconfigurator.h" #include diff --git a/qfunctionconfigurator/qfunctionconfiguratorplugin.h b/qfunctionconfigurator/qfunctionconfiguratorplugin.h index c6b65fcc..c854d3a2 100644 --- a/qfunctionconfigurator/qfunctionconfiguratorplugin.h +++ b/qfunctionconfigurator/qfunctionconfiguratorplugin.h @@ -1,3 +1,9 @@ +/* Copyright (c) 2011-2012 Stanislaw Halik + * Adapted to FaceTrackNoIR by Wim Vriend. + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ #ifndef QFUNCTIONCONFIGURATORPLUGIN_H #define QFUNCTIONCONFIGURATORPLUGIN_H -- cgit v1.2.3 From bb84d3767648fda977a2ff29c7de80aed4f2205f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 15 Oct 2013 13:03:30 +0200 Subject: freetrackclient: don't include unnecessary headers --- freetrackclient/freetrackclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'freetrackclient/freetrackclient.cpp') diff --git a/freetrackclient/freetrackclient.cpp b/freetrackclient/freetrackclient.cpp index efc639ca..71e0e3a7 100644 --- a/freetrackclient/freetrackclient.cpp +++ b/freetrackclient/freetrackclient.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +//#include #include "ftnoir_protocol_ft/fttypes.h" -- cgit v1.2.3 From fbef92577584a6000cdbcffa5744b77d28f1dc0c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 29 Dec 2013 03:33:50 +0100 Subject: unbitrot freetrack proto --- CMakeLists.txt | 6 ++---- freetrackclient/freetrackclient.cpp | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 15 deletions(-) (limited to 'freetrackclient/freetrackclient.cpp') diff --git a/CMakeLists.txt b/CMakeLists.txt index eff5edaf..8e9ade02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -499,11 +499,9 @@ if(WIN32) add_library(opentrack-proto-win32-mouse SHARED ${opentrack-proto-win32-mouse-c} ${opentrack-proto-win32-mouse-h} ${opentrack-proto-win32-mouse-moc} ${opentrack-proto-win32-mouse-uih} ${opentrack-proto-win32-mouse-rcc}) target_link_libraries(opentrack-proto-win32-mouse ${MY_QT_LIBS}) + add_library(freetrackclient SHARED ${opentrack-freetrack-c} ${opentrack-freetrack-h}) if(CMAKE_COMPILER_IS_GNUCC) - add_library(freetrackclient SHARED ${opentrack-freetrack-c} ${opentrack-freetrack-h} "${CMAKE_SOURCE_DIR}/freetrackclient/freetrackclient.def") - set_target_properties(freetrackclient PROPERTIES LINK_FLAGS "-Wl,--enable-stdcall-fixup") - else() - add_library(freetrackclient SHARED ${opentrack-freetrack-c} ${opentrack-freetrack-h}) + set_target_properties(freetrackclient PROPERTIES LINK_FLAGS "-Wl,--enable-stdcall-fixup -fno-lto -Wl,-kill-at" PREFIX "" COMPILE_FLAGS "-fno-lto") endif() endif() diff --git a/freetrackclient/freetrackclient.cpp b/freetrackclient/freetrackclient.cpp index 71e0e3a7..395f017d 100644 --- a/freetrackclient/freetrackclient.cpp +++ b/freetrackclient/freetrackclient.cpp @@ -17,7 +17,6 @@ * * The FreeTrackClient sources were translated from the original Delphi sources * * * created by the FreeTrack developers. * */ -#define FT_EXPORT(t) extern "C" t __declspec(dllexport) __stdcall #define NP_AXIS_MAX 16383 #include @@ -29,14 +28,15 @@ #include "ftnoir_protocol_ft/fttypes.h" +#define FT_EXPORT(t) extern "C" __declspec(dllexport) t __stdcall + // // 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 ); +static float scale2AnalogLimits( float x, float min_x, float max_x ); +static float getDegreesFromRads ( float rads ); +FT_EXPORT(bool) FTCreateMapping(void); #if 0 static FILE *debug_stream = fopen("c:\\FreeTrackClient.log", "a"); @@ -153,7 +153,7 @@ FT_EXPORT(void) FTReportName( int name ) * FTGetDllVersion (FreeTrackClient.3) */ #pragma comment(linker, "/export:FTGetDllVersion@0=FTGetDllVersion") -extern "C" __declspec( dllexport ) const char* FTGetDllVersion(void) +FT_EXPORT(const char*) FTGetDllVersion(void) { dbg_report("FTGetDllVersion request.\n"); @@ -164,7 +164,7 @@ extern "C" __declspec( dllexport ) const char* FTGetDllVersion(void) * FTProvider (FreeTrackClient.4) */ #pragma comment(linker, "/export:FTProvider@0=FTProvider") -extern "C" __declspec( dllexport ) const char* FTProvider(void) +FT_EXPORT(const char*) FTProvider(void) { dbg_report("FTProvider request.\n"); @@ -176,7 +176,7 @@ extern "C" __declspec( dllexport ) const char* FTProvider(void) // It contains the tracking data, a handle to the main-window and the program-name of the Game! // // -bool FTCreateMapping() +FT_EXPORT(bool) FTCreateMapping(void) { // // Memory-mapping already exists! @@ -223,7 +223,7 @@ bool FTCreateMapping() // // Destory the FileMapping to the shared memory // -void FTDestroyMapping() +FT_EXPORT(void) FTDestroyMapping(void) { if ( pMemData != NULL ) { UnmapViewOfFile ( pMemData ); @@ -238,14 +238,14 @@ void FTDestroyMapping() // // 4 convenience // -float getDegreesFromRads ( float rads ) { +static 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 ) { +static float scale2AnalogLimits( float x, float min_x, float max_x ) { double y; double local_x; -- cgit v1.2.3