From 41c2933a5ab2a2592a8d4dffb91b6db3a02f3c9b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 27 Jul 2014 16:21:31 +0200 Subject: rename file so that name makes any sense --- ftnoir_protocol_wine/ftnoir_protocol_wine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.h') diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.h b/ftnoir_protocol_wine/ftnoir_protocol_wine.h index 50d2bc0c..70a2b0d0 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.h +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.h @@ -39,7 +39,7 @@ #include #include #include -#include "facetracknoir/global-settings.h" +#include "facetracknoir/plugin-support.h" #include "compat/compat.h" #include "ftnoir_protocol_wine/wine-shm.h" -- cgit v1.2.3 From 31f526c28a48edf7dca470a3cb068dc80f4014de Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 30 Aug 2014 09:30:29 +0200 Subject: remove capt obvious comments --- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h | 1 - ftnoir_protocol_mouse/ftnoir_protocol_mouse.h | 4 ---- ftnoir_protocol_sc/ftnoir_protocol_sc.h | 4 ---- ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp | 2 -- ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h | 3 --- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 13 ------------- ftnoir_protocol_wine/ftnoir_protocol_wine.h | 4 ---- ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp | 9 --------- ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 9 --------- ftnoir_tracker_hydra/ftnoir_tracker_hydra_dll.cpp | 9 --------- ftnoir_tracker_udp/ftnoir_tracker_udp.h | 4 ---- 11 files changed, 62 deletions(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.h') diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index c9c80c5f..cb40959d 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -33,7 +33,6 @@ private: struct libevdev_uinput* uidev; }; -// Widget that has controls for FTNoIR protocol client-settings. class LibevdevControls: public QWidget, public IProtocolDialog { Q_OBJECT diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h index f1e752b0..e096bf50 100644 --- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h +++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h @@ -71,7 +71,6 @@ private: struct settings s; }; -// Widget that has controls for FTNoIR protocol client-settings. class MOUSEControls: public QWidget, public IProtocolDialog { Q_OBJECT @@ -92,9 +91,6 @@ private slots: void doCancel(); }; -//******************************************************************************************************* -// FaceTrackNoIR Protocol DLL. Functions used to get general info on the Protocol -//******************************************************************************************************* class FTNoIR_ProtocolDll : public Metadata { public: diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h index 758ca1ec..d6185428 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h @@ -128,7 +128,6 @@ private: settings s; }; -// Widget that has controls for FTNoIR protocol client-settings. class SCControls: public QWidget, public IProtocolDialog { Q_OBJECT @@ -144,9 +143,6 @@ private slots: void doCancel(); }; -//******************************************************************************************************* -// FaceTrackNoIR Protocol DLL. Functions used to get general info on the Protocol -//******************************************************************************************************* class FTNoIR_ProtocolDll : public Metadata { public: diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp index 5f469e7f..33dd35ae 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp @@ -2,13 +2,11 @@ #include "facetracknoir/plugin-support.h" #include -/** constructor **/ FTNoIR_Protocol::FTNoIR_Protocol() { VJoy_Initialize("", ""); } -/** destructor **/ FTNoIR_Protocol::~FTNoIR_Protocol() { VJoy_Shutdown(); diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h index 24a4e28f..6ef828d4 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h @@ -72,9 +72,6 @@ private slots: void doCancel(); }; -//******************************************************************************************************* -// FaceTrackNoIR Protocol DLL. Functions used to get general info on the Protocol -//******************************************************************************************************* class FTNoIR_ProtocolDll : public Metadata { public: diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index 83986b42..3208795c 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -50,24 +50,11 @@ void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { } } -// -// Check if the Client DLL exists and load it (to test it), if so. -// Returns 'true' if all seems OK. -// bool FTNoIR_Protocol::checkServerInstallationOK() { return lck_shm.success(); } -//////////////////////////////////////////////////////////////////////////////// -// Factory function that creates instances if the Protocol object. - -// Export both decorated and undecorated names. -// GetProtocol - Undecorated name, which can be easily used with GetProcAddress -// Win32 API function. -// _GetProtocol@0 - Common name decoration for __stdcall functions in C language. -//#pragma comment(linker, "/export:GetProtocol=_GetProtocol@0") - extern "C" FTNOIR_PROTOCOL_BASE_EXPORT void* CALLING_CONVENTION GetConstructor() { return (IProtocol*) new FTNoIR_Protocol; diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.h b/ftnoir_protocol_wine/ftnoir_protocol_wine.h index 70a2b0d0..bde1c100 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.h +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.h @@ -64,7 +64,6 @@ private: QMutex game_name_mutex; }; -// Widget that has controls for FTNoIR protocol client-settings. class FTControls: public QWidget, public IProtocolDialog { Q_OBJECT @@ -81,9 +80,6 @@ private slots: void doCancel(); }; -//******************************************************************************************************* -// FaceTrackNoIR Protocol DLL. Functions used to get general info on the Protocol -//******************************************************************************************************* class FTNoIR_ProtocolDll : public Metadata { public: diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp index 4b00d7dc..7bab1651 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp @@ -10,15 +10,6 @@ FTNoIR_ProtocolDll::~FTNoIR_ProtocolDll() } -//////////////////////////////////////////////////////////////////////////////// -// Factory function that creates instances if the Protocol object. - -// Export both decorated and undecorated names. -// GetProtocolDll - Undecorated name, which can be easily used with GetProcAddress -// Win32 API function. -// _GetProtocolDll@0 - Common name decoration for __stdcall functions in C language. -//#pragma comment(linker, "/export:GetProtocolDll=_GetProtocolDll@0") - extern "C" FTNOIR_PROTOCOL_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata() { return new FTNoIR_ProtocolDll; diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 5e983f4f..84b7eed3 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -440,15 +440,6 @@ extern "C" FTNOIR_TRACKER_BASE_EXPORT ITracker* CALLING_CONVENTION GetConstructo return new Tracker; } -//////////////////////////////////////////////////////////////////////////////// -// Factory function that creates instances if the Tracker-settings dialog object. - -// Export both decorated and undecorated names. -// GetTrackerDialog - Undecorated name, which can be easily used with GetProcAddress -// Win32 API function. -// _GetTrackerDialog@0 - Common name decoration for __stdcall functions in C language. -//#pragma comment(linker, "/export:GetTrackerDialog=_GetTrackerDialog@0") - extern "C" FTNOIR_TRACKER_BASE_EXPORT ITrackerDialog* CALLING_CONVENTION GetDialog( ) { return new TrackerControls; diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dll.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dll.cpp index f0939081..b14b865c 100644 --- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dll.cpp +++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra_dll.cpp @@ -23,15 +23,6 @@ void FTNoIR_TrackerDll::getIcon(QIcon *icon) *icon = QIcon(":/images/facetracknoir.png"); } -//////////////////////////////////////////////////////////////////////////////// -// Factory function that creates instances if the Tracker object. - -// Export both decorated and undecorated names. -// GetTrackerDll - Undecorated name, which can be easily used with GetProcAddress -// Win32 API function. -// _GetTrackerDll@0 - Common name decoration for __stdcall functions in C language. -//#pragma comment(linker, "/export:GetTrackerDll=_GetTrackerDll@0") - extern "C" FTNOIR_TRACKER_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata() { return new FTNoIR_TrackerDll; diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.h b/ftnoir_tracker_udp/ftnoir_tracker_udp.h index 2854e942..c093c940 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.h +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.h @@ -46,7 +46,6 @@ private: settings s; }; -// Widget that has controls for FTNoIR protocol client-settings. class TrackerControls: public QWidget, public ITrackerDialog { Q_OBJECT @@ -63,9 +62,6 @@ private slots: void doCancel(); }; -//******************************************************************************************************* -// FaceTrackNoIR Tracker DLL. Functions used to get general info on the Tracker -//******************************************************************************************************* class FTNoIR_TrackerDll : public Metadata { public: -- cgit v1.2.3 From 61f739e32f81150f905a577050440a35bbe5c467 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 13 Sep 2014 13:15:57 +0200 Subject: nix wrong attribution --- ftnoir_protocol_wine/ftnoir_protocol_wine.h | 32 ----------------------------- 1 file changed, 32 deletions(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.h') diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.h b/ftnoir_protocol_wine/ftnoir_protocol_wine.h index bde1c100..95e833f6 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.h +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.h @@ -1,32 +1,4 @@ -/******************************************************************************** -* 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) 2010 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* 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 . * -* * -* FTServer FTServer is the Class, that communicates headpose-data * -* to games, using the FreeTrackClient.dll. * -********************************************************************************/ #pragma once -#ifndef INCLUDED_FTSERVER_H -#define INCLUDED_FTSERVER_H #include "ftnoir_protocol_base/ftnoir_protocol_base.h" #include "ftnoir_protocol_ft/fttypes.h" @@ -92,7 +64,3 @@ public: void getIcon(QIcon *icon) { *icon = QIcon(":/images/wine.png"); } }; - - -#endif//INCLUDED_FTSERVER_H -//END -- cgit v1.2.3 From 69236c0317a30bf100ec4f3d0f8e58fdc565a34b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 22 Sep 2014 15:25:19 +0200 Subject: fix Wine proto bitrot --- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 5 +- ftnoir_protocol_wine/ftnoir_protocol_wine.h | 17 ++--- .../ftnoir_protocol_wine_dialog.cpp | 10 +-- ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp | 2 +- .../opentrack-wrapper-wine-main.cxx | 84 +++++++++------------- .../opentrack-wrapper-wine-posix.cxx | 12 ++-- .../opentrack-wrapper-wine-windows.cxx | 16 +++-- ftnoir_protocol_wine/wine-shm.h | 4 ++ 8 files changed, 70 insertions(+), 80 deletions(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.h') diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index 3208795c..8ebc394d 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -3,11 +3,12 @@ #include #include /* For mode constants */ #include /* For O_* constants */ +#include "ftnoir_csv/csv.h" FTNoIR_Protocol::FTNoIR_Protocol() : lck_shm(WINE_SHM_NAME, WINE_MTX_NAME, sizeof(WineSHM)), shm(NULL), gameid(0) { if (lck_shm.success()) { - shm = (WineSHM*) lck_shm.mem; + shm = (WineSHM*) lck_shm.ptr(); memset(shm, 0, sizeof(*shm)); } wrapper.start("wine", QStringList() << (QCoreApplication::applicationDirPath() + "/opentrack-wrapper-wine.exe.so")); @@ -55,7 +56,7 @@ bool FTNoIR_Protocol::checkServerInstallationOK() return lck_shm.success(); } -extern "C" FTNOIR_PROTOCOL_BASE_EXPORT void* CALLING_CONVENTION GetConstructor() +extern "C" OPENTRACK_EXPORT void* CALLING_CONVENTION GetConstructor() { return (IProtocol*) new FTNoIR_Protocol; } diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.h b/ftnoir_protocol_wine/ftnoir_protocol_wine.h index 95e833f6..9a7fb7d5 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.h +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.h @@ -1,8 +1,5 @@ #pragma once -#include "ftnoir_protocol_base/ftnoir_protocol_base.h" -#include "ftnoir_protocol_ft/fttypes.h" -#include "ftnoir_csv/csv.h" #include "ui_ftnoir_winecontrols.h" #include #include @@ -11,15 +8,15 @@ #include #include #include -#include "facetracknoir/plugin-support.h" +#include "facetracknoir/plugin-api.hpp" #include "compat/compat.h" #include "ftnoir_protocol_wine/wine-shm.h" class FTNoIR_Protocol : public IProtocol { public: - FTNoIR_Protocol(); - virtual ~FTNoIR_Protocol(); + FTNoIR_Protocol(); + ~FTNoIR_Protocol() override; bool checkServerInstallationOK(); void sendHeadposeToGame(const double* headpose); @@ -48,15 +45,15 @@ private: Ui::UICFTControls ui; private slots: - void doOK(); - void doCancel(); + void doOK(); + void doCancel(); }; class FTNoIR_ProtocolDll : public Metadata { public: - FTNoIR_ProtocolDll(); - ~FTNoIR_ProtocolDll(); + FTNoIR_ProtocolDll(); + ~FTNoIR_ProtocolDll(); void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("Wine"); } void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("Wine"); } diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine_dialog.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine_dialog.cpp index a6fae479..bcd3df45 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine_dialog.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine_dialog.cpp @@ -4,20 +4,20 @@ FTControls::FTControls() : QWidget() { - ui.setupUi( this ); - connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); - connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); + ui.setupUi( this ); + connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); + connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); } void FTControls::doOK() { - this->close(); + this->close(); } void FTControls::doCancel() { this->close(); } -extern "C" FTNOIR_PROTOCOL_BASE_EXPORT void* CALLING_CONVENTION GetDialog( ) +extern "C" OPENTRACK_EXPORT void* CALLING_CONVENTION GetDialog( ) { return (IProtocolDialog*) new FTControls; } diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp index 7d7fb247..16e3e7c7 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp @@ -9,7 +9,7 @@ FTNoIR_ProtocolDll::~FTNoIR_ProtocolDll() { } -extern "C" FTNOIR_PROTOCOL_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata() +extern "C" OPENTRACK_EXPORT Metadata* CALLING_CONVENTION GetMetadata() { return new FTNoIR_ProtocolDll; } diff --git a/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx b/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx index 6e512b6e..fe5a95f9 100644 --- a/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx +++ b/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx @@ -1,60 +1,42 @@ -#include -#include +#include +#include #include "ftnoir_protocol_ft/fttypes.h" #include "ftnoir_protocol_wine/wine-shm.h" -#include "ftnoir_tracker_base/ftnoir_tracker_types.h" -void create_registry_key(void); +#define OPENTRACK_CROSS_ONLY +#include "facetracknoir/plugin-api.hpp" -class ShmPosix { -public: - ShmPosix(const char *shmName, const char *mutexName, int mapSize); - ~ShmPosix(); - void lock(); - void unlock(); - bool success(); - void* mem; -private: - int fd, size; -}; +#define OPENTRACK_COMPAT_BUNDLED +#include "compat/compat.h" -class ShmWine { -public: - ShmWine(const char *shmName, const char *mutexName, int mapSize); - ~ShmWine(); - void lock(); - void unlock(); - bool success(); - void* mem; -private: - void *hMutex, *hMapFile; -}; -#include +void create_registry_key(void); +ptr make_shm_posix(); +ptr make_shm_win32(); int main(void) { - ShmPosix lck_posix(WINE_SHM_NAME, WINE_MTX_NAME, sizeof(WineSHM)); - ShmWine lck_wine("FT_SharedMem", "FT_Mutext", sizeof(FTMemMap)); - if(!lck_posix.success()) { - printf("Can't open posix map: %d\n", errno); - return 1; - } - if(!lck_wine.success()) { - printf("Can't open Wine map\n"); - return 1; - } - WineSHM* shm_posix = (WineSHM*) lck_posix.mem; - FTMemMap* shm_wine = (FTMemMap*) lck_wine.mem; - TFreeTrackData* data = &shm_wine->data; + ptr lck_posix = make_shm_posix(); + ptr lck_wine = make_shm_win32(); + if(!lck_posix->success()) { + printf("Can't open posix map: %d\n", errno); + return 1; + } + if(!lck_wine->success()) { + printf("Can't open Wine map\n"); + return 1; + } + WineSHM* shm_posix = (WineSHM*) lck_posix->ptr(); + FTHeap* shm_wine = (FTHeap*) lck_wine->ptr(); + FTData* data = &shm_wine->data; create_registry_key(); - while (1) { - (void) Sleep(10); - lck_posix.lock(); - if (shm_posix->stop) { - lck_posix.unlock(); - break; - } - lck_wine.lock(); + while (1) { + (void) Sleep(4); + lck_posix->lock(); + if (shm_posix->stop) { + lck_posix->unlock(); + break; + } + lck_wine->lock(); data->Yaw = shm_posix->data[Yaw]; data->Pitch = shm_posix->data[Pitch]; data->Roll = shm_posix->data[Roll]; @@ -68,7 +50,7 @@ int main(void) shm_posix->gameid = shm_wine->GameID; for (int i = 0; i < 8; i++) shm_wine->table[i] = shm_posix->table[i]; - lck_wine.unlock(); - lck_posix.unlock(); - } + lck_wine->unlock(); + lck_posix->unlock(); + } } diff --git a/ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx b/ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx index 010c4440..ea01ff03 100644 --- a/ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx +++ b/ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx @@ -1,8 +1,12 @@ #define OPENTRACK_COMPAT_BUNDLED -#ifdef _WIN32 -# undef _WIN32 -#endif - #define PortableLockedShm ShmPosix +#undef _WIN32 +#include "ftnoir_protocol_ft/fttypes.h" +#include "wine-shm.h" #include "compat/compat.h" #include "compat/compat.cpp" + +ptr make_shm_posix() +{ + return std::make_shared(FREETRACK_HEAP, FREETRACK_MUTEX, sizeof(FTHeap)); +} diff --git a/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx b/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx index e7102600..715dcc69 100644 --- a/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx +++ b/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx @@ -1,19 +1,21 @@ -#define OPENTRACK_COMPAT_BUNDLED - #ifndef __WIN32 -#define __WIN32 +# error "bad cross" #endif +#define OPENTRACK_COMPAT_BUNDLED #define PortableLockedShm ShmWine - -#include "ftnoir_protocol_ft/fttypes.h" #include "compat/compat.h" #include "compat/compat.cpp" -#include +#include "wine-shm.h" + +ptr make_shm_win32() +{ + return std::make_shared(WINE_SHM_NAME, WINE_MTX_NAME, sizeof(WineSHM)); +} void create_registry_key(void) { char dir[8192]; - + if (GetCurrentDirectoryA(8192, dir) < 8190) { HKEY hkpath; diff --git a/ftnoir_protocol_wine/wine-shm.h b/ftnoir_protocol_wine/wine-shm.h index ddbda8b5..c0f29cd3 100644 --- a/ftnoir_protocol_wine/wine-shm.h +++ b/ftnoir_protocol_wine/wine-shm.h @@ -3,6 +3,10 @@ #define WINE_SHM_NAME "facetracknoir-wine-shm" #define WINE_MTX_NAME "facetracknoir-wine-mtx" +#include + +template using ptr = std::shared_ptr; + struct WineSHM { double data[6]; int gameid, gameid2; -- cgit v1.2.3