From 1e7f2a5bad7dba79e90878a7dd9bd8c49d8fdf0e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 26 Dec 2018 01:03:07 +0100 Subject: [PATCH 1/4] add travis config for linux ci build --- .travis.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..111ee46 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: cpp +dist: xenial +compiler: + - clang + - gcc + +install: + - sudo apt-get update -qq + - sudo apt-get install build-essential qtbase5-dev qttools5-dev qtdeclarative5-dev qtmultimedia5-dev qt5-default qttools5-dev-tools + +script: + - mkdir build && cd build + - qmake .. + - make From d8044803c3b0325f3fbc466c926706bedaa6767f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 26 Dec 2018 01:55:58 +0100 Subject: [PATCH 2/4] specify c++11 --- advancedSettings.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/advancedSettings.pro b/advancedSettings.pro index fe86ccb..d54a379 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -5,6 +5,7 @@ #------------------------------------------------- QT += core gui qml quick multimedia +CONFIG += c++11 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets From 32fd6335883b2b2f6195e0d1f692729169618c57 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 26 Dec 2018 01:56:33 +0100 Subject: [PATCH 3/4] use kubuntu backports in travis for qt 5.6 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 111ee46..98504bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ compiler: - gcc install: + - sudo add-apt-repository ppa:kubuntu-ppa/backports -y - sudo apt-get update -qq - sudo apt-get install build-essential qtbase5-dev qttools5-dev qtdeclarative5-dev qtmultimedia5-dev qt5-default qttools5-dev-tools From f383fe081e8ec066f3c59d397c34323f7632ac1f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 26 Dec 2018 02:09:50 +0100 Subject: [PATCH 4/4] switch to cmath and std::isnan --- src/tabcontrollers/ChaperoneTabController.cpp | 12 ++++++------ src/utils/ChaperoneUtils.cpp | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/tabcontrollers/ChaperoneTabController.cpp b/src/tabcontrollers/ChaperoneTabController.cpp index cbde2e2..92572bf 100644 --- a/src/tabcontrollers/ChaperoneTabController.cpp +++ b/src/tabcontrollers/ChaperoneTabController.cpp @@ -1,7 +1,7 @@ #include "ChaperoneTabController.h" #include #include "../overlaycontroller.h" -#include +#include // application namespace namespace advsettings { @@ -361,7 +361,7 @@ void ChaperoneTabController::eventLoopTick(vr::TrackedDevicePose_t* devicePoses, poseHmd.mDeviceToAbsoluteTracking.m[1][3], poseHmd.mDeviceToAbsoluteTracking.m[2][3] }); - if (!isnan(distanceHmd)) { + if (!std::isnan(distanceHmd)) { minDistance = distanceHmd; } } @@ -374,7 +374,7 @@ void ChaperoneTabController::eventLoopTick(vr::TrackedDevicePose_t* devicePoses, poseLeft.mDeviceToAbsoluteTracking.m[1][3], poseLeft.mDeviceToAbsoluteTracking.m[2][3] }); - if (!isnan(distanceLeft) && (isnan(minDistance) || distanceLeft < minDistance)) { + if (!std::isnan(distanceLeft) && (std::isnan(minDistance) || distanceLeft < minDistance)) { minDistance = distanceLeft; } } @@ -388,12 +388,12 @@ void ChaperoneTabController::eventLoopTick(vr::TrackedDevicePose_t* devicePoses, poseRight.mDeviceToAbsoluteTracking.m[1][3], poseRight.mDeviceToAbsoluteTracking.m[2][3] }); - if (!isnan(distanceRight) && (isnan(minDistance) || distanceRight < minDistance)) { + if (!std::isnan(distanceRight) && (std::isnan(minDistance) || distanceRight < minDistance)) { minDistance = distanceRight; } } } - if (!isnan(minDistance)) { + if (!std::isnan(minDistance)) { handleChaperoneWarnings(minDistance); } } @@ -1002,7 +1002,7 @@ float ChaperoneTabController::getBoundsMaxY() { } else { ci = 2; } - if (isnan(result) || result < collisionBounds[b].vCorners[ci].v[1]) { + if (std::isnan(result) || result < collisionBounds[b].vCorners[ci].v[1]) { result = collisionBounds[b].vCorners[ci].v[1]; } } diff --git a/src/utils/ChaperoneUtils.cpp b/src/utils/ChaperoneUtils.cpp index a0cbf6c..832593a 100644 --- a/src/utils/ChaperoneUtils.cpp +++ b/src/utils/ChaperoneUtils.cpp @@ -1,7 +1,6 @@ - #include "ChaperoneUtils.h" #include -#include +#include namespace utils { @@ -43,7 +42,7 @@ float ChaperoneUtils::_getDistanceToChaperone(const vr::HmdVector3_t & x, vr::Hm float d_z = x1_z - x.v[2]; d = sqrt(d_x*d_x + d_z*d_z); } - if (isnan(distance) || d < distance) { + if (std::isnan(distance) || d < distance) { distance = d; if (projectedPoint) { projectedPoint->v[0] = x1_x;