From 2f8c3f2f2451636624149e448f480e934cfd2404 Mon Sep 17 00:00:00 2001 From: Clement Date: Wed, 9 Oct 2019 14:26:41 -0700 Subject: [PATCH 1/8] Add bullet patch for clang 8 compatibility --- .../bullet-git-fix-build-clang-8.patch | 36 +++++++++++++++++++ cmake/ports/bullet3/portfile.cmake | 1 + 2 files changed, 37 insertions(+) create mode 100644 cmake/ports/bullet3/bullet-git-fix-build-clang-8.patch diff --git a/cmake/ports/bullet3/bullet-git-fix-build-clang-8.patch b/cmake/ports/bullet3/bullet-git-fix-build-clang-8.patch new file mode 100644 index 0000000000..bdf106b38e --- /dev/null +++ b/cmake/ports/bullet3/bullet-git-fix-build-clang-8.patch @@ -0,0 +1,36 @@ +From 7638b7c5a659dceb4e580ae87d4d60b00847ef94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Emil=20Nord=C3=A9n?= +Date: Sat, 4 May 2019 08:38:53 +0200 +Subject: [PATCH] fixed build on latest version of clang + +--- + src/Bullet3Common/b3Vector3.h | 2 +- + src/LinearMath/btVector3.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/Bullet3Common/b3Vector3.h b/src/Bullet3Common/b3Vector3.h +index 56e6c13311..a70d68d6e1 100644 +--- a/src/Bullet3Common/b3Vector3.h ++++ b/src/Bullet3Common/b3Vector3.h +@@ -36,7 +36,7 @@ subject to the following restrictions: + #pragma warning(disable : 4556) // value of intrinsic immediate argument '4294967239' is out of range '0 - 255' + #endif + +-#define B3_SHUFFLE(x, y, z, w) ((w) << 6 | (z) << 4 | (y) << 2 | (x)) ++#define B3_SHUFFLE(x, y, z, w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff) + //#define b3_pshufd_ps( _a, _mask ) (__m128) _mm_shuffle_epi32((__m128i)(_a), (_mask) ) + #define b3_pshufd_ps(_a, _mask) _mm_shuffle_ps((_a), (_a), (_mask)) + #define b3_splat3_ps(_a, _i) b3_pshufd_ps((_a), B3_SHUFFLE(_i, _i, _i, 3)) +diff --git a/src/LinearMath/btVector3.h b/src/LinearMath/btVector3.h +index 61fd8d1e46..d65ed9808d 100644 +--- a/src/LinearMath/btVector3.h ++++ b/src/LinearMath/btVector3.h +@@ -36,7 +36,7 @@ subject to the following restrictions: + #pragma warning(disable : 4556) // value of intrinsic immediate argument '4294967239' is out of range '0 - 255' + #endif + +-#define BT_SHUFFLE(x, y, z, w) ((w) << 6 | (z) << 4 | (y) << 2 | (x)) ++#define BT_SHUFFLE(x, y, z, w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff) + //#define bt_pshufd_ps( _a, _mask ) (__m128) _mm_shuffle_epi32((__m128i)(_a), (_mask) ) + #define bt_pshufd_ps(_a, _mask) _mm_shuffle_ps((_a), (_a), (_mask)) + #define bt_splat3_ps(_a, _i) bt_pshufd_ps((_a), BT_SHUFFLE(_i, _i, _i, 3)) diff --git a/cmake/ports/bullet3/portfile.cmake b/cmake/ports/bullet3/portfile.cmake index 32713f5a46..cda39ed349 100644 --- a/cmake/ports/bullet3/portfile.cmake +++ b/cmake/ports/bullet3/portfile.cmake @@ -27,6 +27,7 @@ vcpkg_from_github( REF ab8f16961e19a86ee20c6a1d61f662392524cc77 SHA512 927742db29867517283d45e475f0c534a9a57e165cae221f26e08e88057253a1682ac9919b2dc547b9cf388ba0b931b175623461d44f28c9184796ba90b1ed55 HEAD_REF master + PATCHES "bullet-git-fix-build-clang-8.patch" ) vcpkg_configure_cmake( From 0df6661f5b124a4c8653b5f82833d92cd336324b Mon Sep 17 00:00:00 2001 From: Clement Date: Thu, 10 Oct 2019 15:57:05 -0700 Subject: [PATCH 2/8] Fix incorrect assert --- interface/src/avatar/MyAvatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 386e15b041..ceb4baf095 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -152,7 +152,7 @@ static int triggerReactionNameToIndex(const QString& reactionName) { } static int beginEndReactionNameToIndex(const QString& reactionName) { - assert(NUM_AVATAR_BEGIN_END_REACTIONS == TRIGGER_REACTION_NAMES.size()); + assert(NUM_AVATAR_BEGIN_END_REACTIONS == BEGIN_END_REACTION_NAMES.size()); return BEGIN_END_REACTION_NAMES.indexOf(reactionName); } From f9446041205f52a6d9b74d4308d698e5ebc276b3 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 12 Oct 2019 10:10:27 +1300 Subject: [PATCH 3/8] Deprecate Toolbar API's addButton() and removeButton() methods --- libraries/ui/src/ui/ToolbarScriptingInterface.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libraries/ui/src/ui/ToolbarScriptingInterface.h b/libraries/ui/src/ui/ToolbarScriptingInterface.h index 952d3cce95..3d38aa296b 100644 --- a/libraries/ui/src/ui/ToolbarScriptingInterface.h +++ b/libraries/ui/src/ui/ToolbarScriptingInterface.h @@ -92,15 +92,19 @@ public: ToolbarProxy(QObject* qmlObject, QObject* parent = nullptr); /**jsdoc + * Currently doesn't work. * @function ToolbarProxy#addButton - * @param {object} properties - * @returns {ToolbarButtonProxy} + * @param {object} properties - Button properties + * @returns {object} The button added. + * @deprecated This method is deprecated and will be removed. */ Q_INVOKABLE ToolbarButtonProxy* addButton(const QVariant& properties); /**jsdoc + * Currently doesn't work. * @function ToolbarProxy#removeButton - * @param {string} name + * @param {string} name - Button name. + * @deprecated This method is deprecated and will be removed. */ Q_INVOKABLE void removeButton(const QVariant& name); From 5292dddc391c11315733f79ab7e508fd12605506 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 12 Oct 2019 10:10:41 +1300 Subject: [PATCH 4/8] Rewrite toolbarTest.js --- scripts/developer/tests/toolbarTest.js | 143 ++++++------------------- 1 file changed, 32 insertions(+), 111 deletions(-) diff --git a/scripts/developer/tests/toolbarTest.js b/scripts/developer/tests/toolbarTest.js index 89609e610d..9e82f814ac 100644 --- a/scripts/developer/tests/toolbarTest.js +++ b/scripts/developer/tests/toolbarTest.js @@ -1,117 +1,38 @@ -var isActive = false; +(function () { -var toolBar = (function() { - var that = {}, - toolBar, - activeButton, - newModelButton, - newShapeButton, - newLightButton, - newTextButton, - newWebButton, - newZoneButton, - newParticleButton, - newMaterialButton - - var toolIconUrl = Script.resolvePath("../../system/assets/images/tools/"); - - function initialize() { - print("Toolbars: " + Toolbars); - toolBar = Toolbars.getToolbar("highfidelity.edit.toolbar"); - print("Toolbar: " + toolBar); - activeButton = toolBar.addButton({ - objectName: "activeButton", - imageURL: toolIconUrl + "edit-01.svg", - visible: true, - alpha: 0.9, - }); - - print("Button " + activeButton); - print("Button signal " + activeButton.clicked); - activeButton.clicked.connect(function(){ - print("Clicked on button " + isActive); - that.setActive(!isActive); - }); - - newModelButton = toolBar.addButton({ - objectName: "newModelButton", - imageURL: toolIconUrl + "model-01.svg", - alpha: 0.9, - visible: false - }); - - newShapeButton = toolBar.addButton({ - objectName: "newShapeButton", - imageURL: toolIconUrl + "cube-01.svg", - alpha: 0.9, - visible: false - }); - - newLightButton = toolBar.addButton({ - objectName: "newLightButton", - imageURL: toolIconUrl + "light-01.svg", - alpha: 0.9, - visible: false - }); - - newTextButton = toolBar.addButton({ - objectName: "newTextButton", - imageURL: toolIconUrl + "text-01.svg", - alpha: 0.9, - visible: false - }); - - newWebButton = toolBar.addButton({ - objectName: "newWebButton", - imageURL: toolIconUrl + "web-01.svg", - alpha: 0.9, - visible: false - }); - - newZoneButton = toolBar.addButton({ - objectName: "newZoneButton", - imageURL: toolIconUrl + "zone-01.svg", - alpha: 0.9, - visible: false - }); - - newParticleButton = toolBar.addButton({ - objectName: "newParticleButton", - imageURL: toolIconUrl + "particle-01.svg", - alpha: 0.9, - visible: false - }); - - newMaterialButton = toolBar.addButton({ - objectName: "newMaterialButton", - imageURL: toolIconUrl + "material-01.svg", - alpha: 0.9, - visible: false - }); - - that.setActive(false); - newModelButton.clicked(); + // Get the system toolbar. + var toolbar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); + if (!toolbar) { + print("ERROR: Couldn't get system toolbar."); + return; } - that.setActive = function(active) { - if (active != isActive) { - isActive = active; - that.showTools(isActive); - } - }; + Script.setTimeout(function () { + // Report the system toolbar visibility. + var isToolbarVisible = toolbar.readProperty("visible"); + print("Toolbar visible: " + isToolbarVisible); - // Sets visibility of tool buttons, excluding the power button - that.showTools = function(doShow) { - newModelButton.writeProperty('visible', doShow); - newShapeButton.writeProperty('visible', doShow); - newLightButton.writeProperty('visible', doShow); - newTextButton.writeProperty('visible', doShow); - newWebButton.writeProperty('visible', doShow); - newZoneButton.writeProperty('visible', doShow); - newParticleButton.writeProperty('visible', doShow); - newMaterialButton.writeProperty('visible', doShow); - }; + // Briefly toggle the system toolbar visibility. + print("Toggle toolbar"); + toolbar.writeProperty("visible", !isToolbarVisible); + Script.setTimeout(function () { + print("Toggle toolbar"); + toolbar.writeProperty("visible", isToolbarVisible); + }, 2000); + }, 2000); + + Script.setTimeout(function () { + // Report the system toolbar visibility alternative method. + isToolbarVisible = toolbar.readProperties(["visible"]).visible; + print("Toolbar visible: " + isToolbarVisible); + + // Briefly toggle the system toolbar visibility. + print("Toggle toolbar"); + toolbar.writeProperties({ visible: !isToolbarVisible }); + Script.setTimeout(function () { + print("Toggle toolbar"); + toolbar.writeProperties({ visible: isToolbarVisible }); + }, 2000); + }, 6000); - initialize(); - return that; }()); From 377ffe969807f767c7c829b8633bec7dd67dfb63 Mon Sep 17 00:00:00 2001 From: Rebecca Stankus Date: Fri, 11 Oct 2019 16:01:27 -0700 Subject: [PATCH 5/8] Fixed calculation of overlay position --- scripts/simplifiedUI/ui/simplifiedUI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index 1154e386ea..37cf506898 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -298,7 +298,7 @@ function updateOutputDeviceMutedOverlay(isMuted) { var outputDeviceMutedOverlayBottomY = props.y + overlayDims; var inputDeviceMutedOverlayTopY = INPUT_DEVICE_MUTED_MARGIN_TOP_PX; if (outputDeviceMutedOverlayBottomY + OUTPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX > inputDeviceMutedOverlayTopY) { - overlayDims = 2 * (inputDeviceMutedOverlayTopY - Window.innerHeight / 2 - OUTPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX); + overlayDims = 2 * (Window.innerHeight - inputDeviceMutedOverlayTopY / 2 - OUTPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX); } if (overlayDims + OUTPUT_DEVICE_MUTED_MARGIN_LEFT_RIGHT_PX > Window.innerWidth) { From 95b5c8a905de4debc2a46176fbd2db93e5ff012f Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Mon, 14 Oct 2019 10:46:32 -0700 Subject: [PATCH 6/8] DEV-2375: ensure web entities stop playing audio --- interface/resources/qml/Web3DSurface.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/resources/qml/Web3DSurface.qml b/interface/resources/qml/Web3DSurface.qml index ff574ceaa5..5f49fe399a 100644 --- a/interface/resources/qml/Web3DSurface.qml +++ b/interface/resources/qml/Web3DSurface.qml @@ -33,6 +33,10 @@ Item { property var item: null function load(url, scriptUrl) { + // Ensure we reset any existing item to "about:blank" to ensure web audio stops: DEV-2375 + if (root.item != null) { + root.item.url = "about:blank" + } QmlSurface.load("./controls/WebView.qml", root, function(newItem) { root.item = newItem root.item.url = url From 6c35387b8d98be39e9416ff423b1c55c2af0c1bf Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Mon, 14 Oct 2019 10:56:23 -0700 Subject: [PATCH 7/8] also fix DEV-2083 --- interface/resources/qml/Web3DSurface.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/resources/qml/Web3DSurface.qml b/interface/resources/qml/Web3DSurface.qml index 5f49fe399a..3340226761 100644 --- a/interface/resources/qml/Web3DSurface.qml +++ b/interface/resources/qml/Web3DSurface.qml @@ -36,6 +36,8 @@ Item { // Ensure we reset any existing item to "about:blank" to ensure web audio stops: DEV-2375 if (root.item != null) { root.item.url = "about:blank" + root.item.destroy() + root.item = null } QmlSurface.load("./controls/WebView.qml", root, function(newItem) { root.item = newItem From 5831eb261fa4b5e0664800ee3a71226044b54b74 Mon Sep 17 00:00:00 2001 From: RebeccaStankus Date: Mon, 14 Oct 2019 16:08:01 -0700 Subject: [PATCH 8/8] Changed calculation of overlay size --- scripts/simplifiedUI/ui/simplifiedUI.js | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index 3de8af8a24..f0a76f4f5f 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -284,28 +284,21 @@ function maybeDeleteOutputDeviceMutedOverlay() { var outputDeviceMutedOverlay = false; var OUTPUT_DEVICE_MUTED_OVERLAY_DEFAULT_DIMS_PX = 300; -var OUTPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX = 20; -var OUTPUT_DEVICE_MUTED_MARGIN_LEFT_RIGHT_PX = 20; +var OUTPUT_DEVICE_MUTED_OVERLAY_DEFAULT_MARGINS_PX = 20; +var OUTPUT_DEVICE_MUTED_DIMS_RATIO_TO_WINDOW_SIZE = 0.8; function updateOutputDeviceMutedOverlay(isMuted) { if (isMuted) { var props = { imageURL: Script.resolvePath("images/outputDeviceMuted.svg"), alpha: 0.5 }; + var overlayDims = OUTPUT_DEVICE_MUTED_OVERLAY_DEFAULT_DIMS_PX; - props.x = Window.innerWidth / 2 - overlayDims / 2; - props.y = Window.innerHeight / 2 - overlayDims / 2; + var overlayWithMarginsDims = overlayDims + 2 * OUTPUT_DEVICE_MUTED_OVERLAY_DEFAULT_MARGINS_PX; - var outputDeviceMutedOverlayBottomY = props.y + overlayDims; - var inputDeviceMutedOverlayTopY = INPUT_DEVICE_MUTED_MARGIN_TOP_PX; - if (outputDeviceMutedOverlayBottomY + OUTPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX > inputDeviceMutedOverlayTopY) { - overlayDims = 2 * (Window.innerHeight - inputDeviceMutedOverlayTopY / 2 - OUTPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX); - } - - if (overlayDims + OUTPUT_DEVICE_MUTED_MARGIN_LEFT_RIGHT_PX > Window.innerWidth) { - overlayDims = Math.min(Window.innerWidth - OUTPUT_DEVICE_MUTED_MARGIN_LEFT_RIGHT_PX, overlayDims); - } else { - overlayDims = Math.min(OUTPUT_DEVICE_MUTED_OVERLAY_DEFAULT_DIMS_PX, overlayDims); + if (overlayWithMarginsDims > Window.innerHeight || overlayWithMarginsDims > Window.innerWidth) { + var minWindowDims = Math.min(Window.innerHeight, Window.innerWidth); + overlayDims = Math.round(minWindowDims * OUTPUT_DEVICE_MUTED_DIMS_RATIO_TO_WINDOW_SIZE); } props.width = overlayDims;