Merge branch 'master' of https://github.com/highfidelity/hifi into editHandleToggleFix

This commit is contained in:
David Back 2018-07-02 10:57:47 -07:00
commit 122b385dd3
8 changed files with 95 additions and 65 deletions

View file

@ -22,7 +22,7 @@ macro(optional_win_executable_signing)
# setup a post build command to sign the executable
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${SIGNTOOL_EXECUTABLE} sign /fd sha256 /f %HF_PFX_FILE% /p %HF_PFX_PASSPHRASE% /tr http://tsa.starfieldtech.com /td SHA256 ${EXECUTABLE_PATH}
COMMAND ${SIGNTOOL_EXECUTABLE} sign /fd sha256 /f %HF_PFX_FILE% /p %HF_PFX_PASSPHRASE% /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 ${EXECUTABLE_PATH}
)
else ()
message(FATAL_ERROR "HF_PFX_PASSPHRASE must be set for executables to be signed.")

View file

@ -130,7 +130,7 @@
; The Inner invocation has written an uninstaller binary for us.
; We need to sign it if it's a production or PR build.
!if @PRODUCTION_BUILD@ == 1
!system '"@SIGNTOOL_EXECUTABLE@" sign /fd sha256 /f %HF_PFX_FILE% /p %HF_PFX_PASSPHRASE% /tr http://tsa.starfieldtech.com /td SHA256 $%TEMP%\@UNINSTALLER_NAME@' = 0
!system '"@SIGNTOOL_EXECUTABLE@" sign /fd sha256 /f %HF_PFX_FILE% /p %HF_PFX_PASSPHRASE% /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 $%TEMP%\@UNINSTALLER_NAME@' = 0
!endif
; Good. Now we can carry on writing the real installer.

View file

@ -2521,6 +2521,13 @@ bool EntityTree::readFromMap(QVariantMap& map) {
}
}
// Zero out the spread values that were fixed in version ParticleEntityFix so they behave the same as before
if (contentVersion < (int)EntityVersion::ParticleEntityFix) {
properties.setRadiusSpread(0.0f);
properties.setAlphaSpread(0.0f);
properties.setColorSpread({0, 0, 0});
}
EntityItemPointer entity = addEntity(entityItemID, properties);
if (!entity) {
qCDebug(entities) << "adding Entity failed:" << entityItemID << properties.getType();

View file

@ -66,7 +66,7 @@ OffscreenSurface::OffscreenSurface()
}
OffscreenSurface::~OffscreenSurface() {
delete _sharedObject;
_sharedObject->deleteLater();
}
bool OffscreenSurface::fetchTexture(TextureAndFence& textureAndFence) {

View file

@ -44,6 +44,11 @@ void Space::processResets(const Transaction::Resets& transactions) {
for (auto& reset : transactions) {
// Access the true item
auto proxyID = std::get<0>(reset);
// Guard against proxyID being past the end of the list.
if (proxyID < 0 || proxyID >= (int32_t)_proxies.size() || proxyID >= (int32_t)_owners.size()) {
continue;
}
auto& item = _proxies[proxyID];
// Reset the item with a new payload

View file

@ -2373,7 +2373,6 @@ function selectParticleEntity(entityID) {
particleExplorerTool.createWebView();
particleExplorerTool.setActiveParticleEntity(entityID);
particleExplorerTool.setActiveParticleProperties(properties);
// Switch to particle explorer
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");

View file

@ -61,12 +61,18 @@ function HifiEntityUI(parent) {
this.parent = parent;
var self = this;
this.sendPackage = {};
this.settingsUpdateLock = false;
this.webBridgeSync = _.debounce(function (id, val) {
if (self.EventBridge && !self.settingsUpdateLock) {
var sendPackage = {};
sendPackage[id] = val;
self.submitChanges(sendPackage);
this.webBridgeSync = function(id, val) {
if (!this.settingsUpdateLock) {
this.sendPackage[id] = val;
this.webBridgeSyncDebounce();
}
};
this.webBridgeSyncDebounce = _.debounce(function () {
if (self.EventBridge) {
self.submitChanges(self.sendPackage);
self.sendPackage = {};
}
}, DEBOUNCE_TIMEOUT);
}
@ -159,7 +165,6 @@ HifiEntityUI.prototype = {
var self = this;
var fields = document.getElementsByTagName("input");
self.settingsUpdateLock = true;
if (!currentProperties.locked) {
for (var i = 0; i < fields.length; i++) {
fields[i].removeAttribute("disabled");
@ -179,7 +184,7 @@ HifiEntityUI.prototype = {
for (var e in keys) {
if (keys.hasOwnProperty(e)) {
var value = keys[e];
var property = currentProperties[value];
var field = self.builtRows[value];
if (field) {
@ -235,10 +240,6 @@ HifiEntityUI.prototype = {
}
}
}
// Now unlocking settings Update lock for sending messages on callbacks.
setTimeout(function () {
self.settingsUpdateLock = false;
}, DEBOUNCE_TIMEOUT * 2.5);
},
connect: function (EventBridge) {
this.EventBridge = EventBridge;
@ -253,28 +254,9 @@ HifiEntityUI.prototype = {
data = JSON.parse(data);
if (data.messageType === 'particle_settings') {
// Update settings
var currentProperties = data.currentProperties;
// Update uninitialized variables
if (!currentProperties.alphaStart) {
currentProperties.alphaStart = currentProperties.alpha;
}
if (!currentProperties.alphaFinish) {
currentProperties.alphaFinish = currentProperties.alpha;
}
if (!currentProperties.radiusStart) {
currentProperties.radiusStart = currentProperties.particleRadius;
}
if (!currentProperties.radiusFinish) {
currentProperties.radiusFinish = currentProperties.particleRadius;
}
if (!currentProperties.colorStart || !currentProperties.colorStart.red) {
currentProperties.colorStart = currentProperties.color;
}
if (!currentProperties.colorFinish || !currentProperties.colorFinish.red) {
currentProperties.colorFinish = currentProperties.color;
}
self.fillFields(currentProperties);
self.settingsUpdateLock = true;
self.fillFields(data.currentProperties);
self.settingsUpdateLock = false;
// Do expected property match with structure;
} else if (data.messageType === 'particle_close') {
self.disableFields();

View file

@ -9,7 +9,8 @@
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
/* global window, alert, ParticleExplorerTool, EventBridge, dat, listenForSettingsUpdates,createVec3Folder,createQuatFolder,writeVec3ToInterface,writeDataToInterface*/
/* global window, alert, ParticleExplorerTool, EventBridge, dat, listenForSettingsUpdates, createVec3Folder,
createQuatFolder, writeVec3ToInterface, writeDataToInterface */
var PARTICLE_EXPLORER_HTML_URL = Script.resolvePath('particleExplorer.html');
@ -17,7 +18,7 @@ var PARTICLE_EXPLORER_HTML_URL = Script.resolvePath('particleExplorer.html');
ParticleExplorerTool = function() {
var that = {};
that.activeParticleEntity = 0;
that.activeParticleProperties = {};
that.updatedActiveParticleProperties = {};
that.createWebView = function() {
that.webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
@ -30,7 +31,7 @@ ParticleExplorerTool = function() {
return;
}
that.activeParticleEntity = 0;
that.activeParticleProperties = {};
that.updatedActiveParticleProperties = {};
var messageData = {
messageType: "particle_close"
@ -38,46 +39,86 @@ ParticleExplorerTool = function() {
that.webView.emitScriptEvent(JSON.stringify(messageData));
};
function sendActiveParticleProperties() {
function sendParticleProperties(properties) {
that.webView.emitScriptEvent(JSON.stringify({
messageType: "particle_settings",
currentProperties: that.activeParticleProperties
currentProperties: properties
}));
}
function sendActiveParticleProperties() {
var properties = Entities.getEntityProperties(that.activeParticleEntity);
if (properties.emitOrientation) {
properties.emitOrientation = Quat.safeEulerAngles(properties.emitOrientation);
}
// Update uninitialized variables
if (isNaN(properties.alphaStart)) {
properties.alphaStart = properties.alpha;
}
if (isNaN(properties.alphaFinish)) {
properties.alphaFinish = properties.alpha;
}
if (isNaN(properties.radiusStart)) {
properties.radiusStart = properties.particleRadius;
}
if (isNaN(properties.radiusFinish)) {
properties.radiusFinish = properties.particleRadius;
}
if (isNaN(properties.colorStart.red)) {
properties.colorStart = properties.color;
}
if (isNaN(properties.colorFinish.red)) {
properties.colorFinish = properties.color;
}
sendParticleProperties(properties);
}
function sendUpdatedActiveParticleProperties() {
sendParticleProperties(that.updatedActiveParticleProperties);
that.updatedActiveParticleProperties = {};
}
that.webEventReceived = function(message) {
var data = JSON.parse(message);
if (data.messageType === "settings_update") {
if (data.updatedSettings.emitOrientation) {
data.updatedSettings.emitOrientation = Quat.fromVec3Degrees(data.updatedSettings.emitOrientation);
}
Entities.editEntity(that.activeParticleEntity, data.updatedSettings);
for (var key in data.updatedSettings) {
if (that.activeParticleProperties.hasOwnProperty(key)) {
that.activeParticleProperties[key] = data.updatedSettings[key];
}
}
var updatedSettings = data.updatedSettings;
var optionalProps = ["alphaStart", "alphaFinish", "radiusStart", "radiusFinish", "colorStart", "colorFinish"];
var fallbackProps = ["alpha", "particleRadius", "color"];
var entityProps = Entities.getEntityProperties(that.activeParticleProperties, optionalProps);
for (var i = 0; i < optionalProps.length; i++) {
var fallbackProp = fallbackProps[Math.floor(i / 2)];
var optionalValue = updatedSettings[optionalProps[i]];
var fallbackValue = updatedSettings[fallbackProp];
if (optionalValue && fallbackValue) {
delete updatedSettings[optionalProps[i]];
}
}
if (updatedSettings.emitOrientation) {
updatedSettings.emitOrientation = Quat.fromVec3Degrees(updatedSettings.emitOrientation);
}
Entities.editEntity(that.activeParticleEntity, updatedSettings);
var entityProps = Entities.getEntityProperties(that.activeParticleEntity, optionalProps);
var needsUpdate = false;
for (var i = 0; i < optionalProps.length; i++) {
var fallback = fallbackProps[Math.floor(i / 2)];
if (data.updatedSettings[fallback]) {
var prop = optionalProps[i];
if (!that.activeParticleProperties[prop] || (fallback === "color" && !that.activeParticleProperties[prop].red)) {
that.activeParticleProperties[prop] = entityProps[fallback];
var fallbackProp = fallbackProps[Math.floor(i / 2)];
var fallbackValue = updatedSettings[fallbackProp];
if (fallbackValue) {
var optionalProp = optionalProps[i];
if ((fallbackProp !== "color" && isNaN(entityProps[optionalProp])) || (fallbackProp === "color" && isNaN(entityProps[optionalProp].red))) {
that.updatedActiveParticleProperties[optionalProp] = fallbackValue;
needsUpdate = true;
}
}
}
if (needsUpdate) {
sendActiveParticleProperties();
sendUpdatedActiveParticleProperties();
}
} else if (data.messageType === "page_loaded") {
sendActiveParticleProperties();
}
@ -85,12 +126,8 @@ ParticleExplorerTool = function() {
that.setActiveParticleEntity = function(id) {
that.activeParticleEntity = id;
};
that.setActiveParticleProperties = function(properties) {
that.activeParticleProperties = properties;
sendActiveParticleProperties();
};
return that;
};