summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-04-02 22:24:41 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-04-02 22:24:41 +0200
commit99d4700738cf6db88981b501876d7dc2ebd5a93c (patch)
tree797c29be1ef40970759f0c849814dc18c9d9c72e
parent46568e0f208cb31ddf816724750a9c6bd73155f4 (diff)
Update Linux support (no CSV yet, sorry)
-rw-r--r--ftnoir_protocol_wine/ftnoir-wrapper-wine-main.cxx23
-rw-r--r--ftnoir_protocol_wine/fttypes.h59
2 files changed, 29 insertions, 53 deletions
diff --git a/ftnoir_protocol_wine/ftnoir-wrapper-wine-main.cxx b/ftnoir_protocol_wine/ftnoir-wrapper-wine-main.cxx
index b64b8254..a8c77a45 100644
--- a/ftnoir_protocol_wine/ftnoir-wrapper-wine-main.cxx
+++ b/ftnoir_protocol_wine/ftnoir-wrapper-wine-main.cxx
@@ -27,7 +27,7 @@ private:
int main(void)
{
ShmPosix lck_posix(WINE_SHM_NAME, WINE_MTX_NAME, sizeof(WineSHM));
- ShmWine lck_wine("FT_SharedMem", "FT_Mutext", sizeof(TFreeTrackData));
+ ShmWine lck_wine("FT_SharedMem", "FT_Mutext", sizeof(FTMemMap));
if(lck_posix.mem == (void*)-1) {
printf("Can't open posix map: %d\n", errno);
return 1;
@@ -37,7 +37,8 @@ int main(void)
return 1;
}
WineSHM* shm_posix = (WineSHM*) lck_posix.mem;
- TFreeTrackData* shm_wine = (TFreeTrackData*) lck_wine.mem;
+ FTMemMap* shm_wine = (TFreeTrackData*) lck_wine.mem;
+ TFreeTrackData* data = &shm_wine->data;
while (!shm_posix->stop) {
(void) Sleep(10);
lck_posix.lock();
@@ -46,15 +47,15 @@ int main(void)
break;
}
lck_wine.lock();
- shm_wine->Yaw = shm_posix->rx;
- shm_wine->Pitch = shm_posix->ry;
- shm_wine->Roll = shm_posix->rz;
- shm_wine->X = shm_posix->tx;
- shm_wine->Y = shm_posix->ty;
- shm_wine->Z = shm_posix->tz;
- shm_wine->DataID = 1;
- shm_wine->CamWidth = 2;
- shm_wine->CamHeight = 3;
+ data->Yaw = shm_posix->rx;
+ data->Pitch = shm_posix->ry;
+ data->Roll = shm_posix->rz;
+ data->X = shm_posix->tx;
+ data->Y = shm_posix->ty;
+ data->Z = shm_posix->tz;
+ data->DataID = 1;
+ data->CamWidth = 250;
+ data->CamHeight = 100;
lck_wine.unlock();
lck_posix.unlock();
}
diff --git a/ftnoir_protocol_wine/fttypes.h b/ftnoir_protocol_wine/fttypes.h
index 73cbae0e..1e5fcd44 100644
--- a/ftnoir_protocol_wine/fttypes.h
+++ b/ftnoir_protocol_wine/fttypes.h
@@ -1,44 +1,6 @@
-/********************************************************************************
-* 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) 2010 Wim Vriend (Developing) *
-* Ron Hendriks (Testing and Research) *
-* *
-* Homepage <http://www.free-track.net> *
-* *
-* 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/>. *
-* *
-* We would like to extend our grattitude to the creators of SweetSpotter, *
-* which has become the basis of this program: "Great work guys!" *
-********************************************************************************/
-#ifndef INCLUDED_FTTYPES_H
-#define INCLUDED_FTTYPES_H
-
-#define WINE_SHM_NAME "facetracknoir-wine-shm"
-#define WINE_MTX_NAME "facetracknoir-wine-mtx"
-
-struct WineSHM {
- float rx, ry, rz, tx, ty, tz;
- bool stop;
-};
-
struct TFreeTrackData {
- int DataID;
- int CamWidth;
+ int DataID;
+ int CamWidth;
int CamHeight;
// virtual pose
float Yaw; // positive yaw to the left
@@ -47,7 +9,7 @@ struct TFreeTrackData {
float X;
float Y;
float Z;
- // raw pose with no smoothing, sensitivity, response curve etc.
+ // raw pose with no smoothing, sensitivity, response curve etc.
float RawYaw;
float RawPitch;
float RawRoll;
@@ -64,5 +26,18 @@ struct TFreeTrackData {
float X4;
float Y4;
};
+typedef TFreeTrackData * PFreetrackData;
+
+struct FTMemMap {
+ TFreeTrackData data;
-#endif//INCLUDED_FTTYPES_H
+#ifdef WIN64
+ __int32 command;
+#else
+ HANDLE handle;
+#endif
+ char ProgramName[100]; // The name of the game
+ char GameID[10]; // The international game-ID
+ char FTNID[30]; // The FaceTrackNoIR game-ID
+ char FTNVERSION[10]; // The version of FaceTrackNoIR, in which the game was first supported
+}; \ No newline at end of file