From e481697ea6e156e456f3d51ba7c816ad4a908792 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 15 Sep 2013 16:00:25 +0200 Subject: Fix mingw-w64 cross-compile from Linux Case-sensitivity and MSVC-isms bite again. --- CMakeLists.txt | 23 ++- FTNoIR_Tracker_PT/camera.cpp | 7 +- ftnoir_protocol_sc/ftnoir_protocol_sc.h | 6 +- ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp | 2 +- ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h | 31 +++- ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui | 170 ++++++++++------------ ftnoir_tracker_rift/ftnoir_tracker_rift.cpp | 2 +- 7 files changed, 133 insertions(+), 108 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c5bed0f..ba4857a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,10 +342,10 @@ endif() if(WIN32 AND SDK_VJOY) include_directories(${SDK_VJOY}) add_library(opentrack-proto-vjoy SHARED ${opentrack-proto-vjoy-c} ${opentrack-proto-vjoy-moc} ${opentrack-proto-vjoy-uih} ${opentrack-proto-vjoy-rcc}) - target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/vjoy.lib") + target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/VJoy.dll") if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) SET_TARGET_PROPERTIES(opentrack-proto-vjoy - PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/posix-version-script.txt") + PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/posix-version-script.txt -Wl,--enable-stdcall-fixup") endif() endif() @@ -362,7 +362,7 @@ endif() add_library(opentrack-proto-simconnect SHARED ${opentrack-proto-simconnect-c} ${opentrack-proto-simconnect-moc} ${opentrack-proto-simconnect-uih} ${opentrack-proto-simconnect-rcc}) target_link_libraries(opentrack-proto-simconnect ${MY_QT_LIBS}) include_directories("${SDK_SIMCONNECT}/inc") - target_link_libraries(opentrack-proto-simconnect "${SDK_SIMCONNECT}/lib/simconnect.lib") + target_link_libraries(opentrack-proto-simconnect "${SDK_SIMCONNECT}/lib/SimConnect.lib") endif() add_library(opentrack-proto-freetrack SHARED ${opentrack-proto-freetrack-c} ${opentrack-proto-freetrack-moc} ${opentrack-proto-freetrack-uih} ${opentrack-proto-freetrack-rcc}) @@ -458,16 +458,19 @@ endif() endif() if(SDK_RIFT) - include_directories("${SDK_RIFT}/include") + include_directories("${SDK_RIFT}/Include") include_directories("${SDK_RIFT}/Src") add_library(opentrack-tracker-rift SHARED ${opentrack-tracker-rift-c} ${opentrack-tracker-rift-moc} ${opentrack-tracker-rift-uih} ${opentrack-tracker-rift-rcc}) target_link_libraries(opentrack-tracker-rift ${MY_QT_LIBS}) if(WIN32) - target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/lib/win32/libovr.lib" winmm.lib) + target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/Lib/Win32/libovr.lib" winmm.lib) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) SET_TARGET_PROPERTIES(opentrack-tracker-rift - PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/posix-version-script.txt") + PROPERTIES + LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/facetracknoir/posix-version-script.txt" + COMPILE_FLAGS "-fno-strict-aliasing" + ) endif() endif() @@ -477,7 +480,13 @@ endif() add_library(opentrack-tracker-hydra SHARED ${opentrack-tracker-hydra-c} ${opentrack-tracker-hydra-moc} ${opentrack-tracker-hydra-uih} ${opentrack-tracker-hydra-rcc}) target_link_libraries(opentrack-tracker-hydra ${MY_QT_LIBS}) if(WIN32) - target_link_libraries(opentrack-tracker-hydra "${SDK_HYDRA}/lib/win32/release_static/sixense_s.lib" "${SDK_HYDRA}/lib/win32/release_static/sixense_utils_s.lib") + if(CMAKE_COMPILER_IS_GNUCXX) + target_link_libraries(opentrack-tracker-hydra "${SDK_HYDRA}/lib/win32/release_dll/sixense.lib" "${SDK_HYDRA}/lib/win32/release_dll/sixense_utils.lib") + install(FILES "${SDK_HYDRA}/bin/win32/release_dll/sixense.dll" "${SDK_HYDRA}/bin/win32/release_dll/sixense_utils.dll" + DESTINATION .) + else() + target_link_libraries(opentrack-tracker-hydra "${SDK_HYDRA}/lib/win32/release_static/sixense_s.lib" "${SDK_HYDRA}/lib/win32/release_static/sixense_utils_s.lib") + endif() endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) SET_TARGET_PROPERTIES(opentrack-tracker-hydra diff --git a/FTNoIR_Tracker_PT/camera.cpp b/FTNoIR_Tracker_PT/camera.cpp index a372373d..14f7a6be 100644 --- a/FTNoIR_Tracker_PT/camera.cpp +++ b/FTNoIR_Tracker_PT/camera.cpp @@ -14,6 +14,11 @@ using namespace cv; #include #endif +#if defined(OPENTRACK_API) && defined(_WIN32) +#include +#include +#endif + #ifdef OPENTRACK_API void get_camera_device_names(std::vector& device_names) { # if defined(_WIN32) @@ -23,7 +28,7 @@ void get_camera_device_names(std::vector& device_names) { hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void **)&pSysDevEnum); if (FAILED(hr)) { - return ret; + return; } // Obtain a class enumerator for the video compressor category. IEnumMoniker *pEnumCat = NULL; diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h index b3596722..8fcf7c1f 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h @@ -37,11 +37,11 @@ #define SIMCONNECT_H_NOMANIFEST #define _WIN32_WINNT 0x0502 -#include +#include #include -#include <..\ftnoir_protocol_base\ftnoir_protocol_base.h> -#include +#include +#include #include #include #include diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp index fce8753a..59a921b8 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc_dll.cpp @@ -22,7 +22,7 @@ * with this program; if not, see . * * * ********************************************************************************/ -#include "ftnoir_protocol_SC.h" +#include "ftnoir_protocol_sc.h" #include #include "facetracknoir/global-settings.h" diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h index 5c260d2e..30d89572 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h @@ -28,8 +28,8 @@ #pragma once #include "ftnoir_protocol_base/ftnoir_protocol_base.h" #include "ui_ftnoir_vjoy_controls.h" -#include -#include +#include + #include #include #include @@ -92,3 +92,30 @@ public: void getIcon(QIcon *icon) { *icon = QIcon(":/images/vjoy.png"); } }; + +#define VJOY_AXIS_MIN -32768 +#define VJOY_AXIS_NIL 0 +#define VJOY_AXIS_MAX 32767 + +#include + +typedef struct _JOYSTICK_STATE +{ + UCHAR ReportId; // Report Id + SHORT XAxis; // X Axis + SHORT YAxis; // Y Axis + SHORT ZAxis; // Z Axis + SHORT XRotation; // X Rotation + SHORT YRotation; // Y Rotation + SHORT ZRotation; // Z Rotation + SHORT Slider; // Slider + SHORT Dial; // Dial + USHORT POV; // POV + UINT32 Buttons; // 32 Buttons +} JOYSTICK_STATE, * PJOYSTICK_STATE; + +#include + +extern "C" BOOL __stdcall VJoy_Initialize(PCHAR name, PCHAR serial); +extern "C" VOID __stdcall VJoy_Shutdown(); +extern "C" BOOL __stdcall VJoy_UpdateJoyState(int id, PJOYSTICK_STATE pJoyState); diff --git a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui index eaf5b9d6..612c61f1 100644 --- a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui +++ b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui @@ -1,13 +1,16 @@ UIRiftControls - + + + Qt::ApplicationModal + 0 0 411 - 142 + 145 @@ -45,97 +48,78 @@ - - - - - - - Pitch: - - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - - - - Yaw: - - - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - - - Roll: - - - - - - - - - 20 - 16777215 - - - - Qt::LeftToRight - - - - - - - - - - - - - - + + + + Pitch: + + + + + + + + 20 + 16777215 + + + + Qt::LeftToRight + + + + + + + + + + + + + Yaw: + + + + + + + + 20 + 16777215 + + + + Qt::LeftToRight + + + + + + + + + + Roll: + + + + + + + + 20 + 16777215 + + + + Qt::LeftToRight + + + + + + diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp index f5e1f5fa..0c3984ac 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp @@ -55,7 +55,7 @@ void Rift_Tracker::StartTracker(QFrame* videoFrame) // System::Init(Log::ConfigureDefaultLog(LogMask_All)); pManager = *DeviceManager::Create(); - DeviceEnumerator& enumerator = pManager->EnumerateDevices(); + DeviceEnumerator enumerator = pManager->EnumerateDevices(); if (enumerator.IsAvailable()) { pHMD = *enumerator.CreateDevice(); -- cgit v1.2.3