mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 04:42:20 +02:00
Merge remote-tracking branch 'upstream/master' into scriptaudioinjector-delete-via-signal
Need 985 PR.
This commit is contained in:
commit
2ebc6e66fe
74 changed files with 4943 additions and 1058 deletions
|
@ -66,12 +66,6 @@ Open `%HIFI_DIR%\build\hifi.sln` using Visual Studio.
|
|||
|
||||
Change the Solution Configuration (menu ribbon under the menu bar, next to the green play button) from "Debug" to "Release" for best performance.
|
||||
|
||||
Create another environment variable (see Step #3)
|
||||
* Set "Variable name": `PreferredToolArchitecture`
|
||||
* Set "Variable value": `x64`
|
||||
|
||||
Restart Visual Studio for the new variable to take effect.
|
||||
|
||||
Run from the menu bar `Build > Build Solution`.
|
||||
|
||||
### Step 6. Testing Interface
|
||||
|
|
|
@ -10,6 +10,11 @@ endif()
|
|||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/macros/TargetPython.cmake")
|
||||
target_python()
|
||||
|
||||
if (WIN32 AND NOT HIFI_ANDROID)
|
||||
# Force x64 toolset
|
||||
set(CMAKE_GENERATOR_TOOLSET "host=x64" CACHE STRING "64-bit toolset" FORCE)
|
||||
endif()
|
||||
|
||||
# set our OS X deployment target
|
||||
# (needs to be set before first project() call and before prebuild.py)
|
||||
# Will affect VCPKG dependencies
|
||||
|
|
|
@ -17,7 +17,7 @@ Documentation
|
|||
=========
|
||||
Documentation is available at [docs.highfidelity.com](https://docs.highfidelity.com), if something is missing, please suggest it via a new job on Worklist (add to the hifi-docs project).
|
||||
|
||||
There is also detailed [documentation on our coding standards](https://wiki.highfidelity.com/wiki/Coding_Standards).
|
||||
There is also detailed [documentation on our coding standards](CODING_STANDARD.md).
|
||||
|
||||
Contributor License Agreement (CLA)
|
||||
=========
|
||||
|
|
|
@ -1292,6 +1292,7 @@ void OctreeServer::aboutToFinish() {
|
|||
for (auto& it : _sendThreads) {
|
||||
auto& sendThread = *it.second;
|
||||
sendThread.setIsShuttingDown();
|
||||
sendThread.terminate();
|
||||
}
|
||||
|
||||
// Clear will destruct all the unique_ptr to OctreeSendThreads which will call the GenericThread's dtor
|
||||
|
|
|
@ -131,8 +131,11 @@ macro(SET_PACKAGING_PARAMETERS)
|
|||
endif ()
|
||||
|
||||
if (DEPLOY_PACKAGE)
|
||||
# for deployed packages always grab the serverless content
|
||||
set(DOWNLOAD_SERVERLESS_CONTENT ON)
|
||||
# For deployed packages we do not grab the serverless content any longer.
|
||||
# Instead, we deploy just the serverless content that is in the interface/resources/serverless
|
||||
# directory. If we ever move back to delivering serverless via a hosted .zip file,
|
||||
# we can re-enable this.
|
||||
set(DOWNLOAD_SERVERLESS_CONTENT OFF)
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
|
|
|
@ -142,22 +142,6 @@ endif()
|
|||
if (APPLE)
|
||||
add_executable(${TARGET_NAME} MACOSX_BUNDLE ${INTERFACE_SRCS} ${QM})
|
||||
|
||||
set_from_env(XCODE_DEVELOPMENT_TEAM XCODE_DEVELOPMENT_TEAM "")
|
||||
if ("${XCODE_DEVELOPMENT_TEAM}" STREQUAL "")
|
||||
message(WARNING "XCODE_DEVELOPMENT_TEAM environment variable is not set. Not signing build.")
|
||||
else()
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/interface.entitlements"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Developer ID Application"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTS NO
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_STYLE "Manual"
|
||||
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${XCODE_DEVELOPMENT_TEAM}"
|
||||
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES
|
||||
XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--timestamp --deep"
|
||||
XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER ""
|
||||
)
|
||||
endif()
|
||||
|
||||
# make sure the output name for the .app bundle is correct
|
||||
# Fix up the rpath so macdeployqt works
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "@executable_path/../Frameworks")
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>high-fidelity.hifi</string>
|
||||
</array>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.device.audio-input</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
Binary file not shown.
BIN
interface/resources/avatar/animations/emote_clap01_all.fbx
Normal file
BIN
interface/resources/avatar/animations/emote_clap01_all.fbx
Normal file
Binary file not shown.
Binary file not shown.
BIN
interface/resources/avatar/animations/emote_point01_all.fbx
Normal file
BIN
interface/resources/avatar/animations/emote_point01_all.fbx
Normal file
Binary file not shown.
BIN
interface/resources/avatar/animations/emote_raisehand01_all.fbx
Normal file
BIN
interface/resources/avatar/animations/emote_raisehand01_all.fbx
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -33,33 +33,6 @@ var EventBridge;
|
|||
// replace the TempEventBridge with the real one.
|
||||
var tempEventBridge = EventBridge;
|
||||
EventBridge = channel.objects.eventBridge;
|
||||
EventBridge.audioOutputDeviceChanged.connect(function(deviceName) {
|
||||
navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(function(mediaStream) {
|
||||
navigator.mediaDevices.enumerateDevices().then(function(devices) {
|
||||
devices.forEach(function(device) {
|
||||
if (device.kind == "audiooutput") {
|
||||
if (device.label == deviceName){
|
||||
console.log("Changing HTML audio output to device " + device.label);
|
||||
var deviceId = device.deviceId;
|
||||
var videos = document.getElementsByTagName("video");
|
||||
for (var i = 0; i < videos.length; i++){
|
||||
videos[i].setSinkId(deviceId);
|
||||
}
|
||||
var audios = document.getElementsByTagName("audio");
|
||||
for (var i = 0; i < audios.length; i++){
|
||||
audios[i].setSinkId(deviceId);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}).catch(function(err) {
|
||||
console.log("Error getting media devices"+ err.name + ": " + err.message);
|
||||
});
|
||||
}).catch(function(err) {
|
||||
console.log("Error getting user media"+ err.name + ": " + err.message);
|
||||
});
|
||||
});
|
||||
|
||||
// To be able to update the state of the output device selection for every element added to the DOM
|
||||
// we need to listen to events that might precede the addition of this elements.
|
||||
|
|
|
@ -5,4 +5,6 @@ Text {
|
|||
style: Text.Outline;
|
||||
styleColor: "black";
|
||||
font.pixelSize: 12;
|
||||
font.bold: true;
|
||||
font.family: "monospace";
|
||||
}
|
||||
|
|
|
@ -39,8 +39,8 @@ Rectangle {
|
|||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
AudioScriptingInterface.noiseGateOpened.connect(function() { gated = false; });
|
||||
AudioScriptingInterface.noiseGateClosed.connect(function() { gated = true; });
|
||||
AudioScriptingInterface.noiseGateOpened.connect(function() { root.gated = false; });
|
||||
AudioScriptingInterface.noiseGateClosed.connect(function() { root.gated = true; });
|
||||
HMD.displayModeChanged.connect(function() {
|
||||
muted = AudioScriptingInterface.muted;
|
||||
pushToTalk = AudioScriptingInterface.pushToTalk;
|
||||
|
@ -151,7 +151,7 @@ Rectangle {
|
|||
readonly property string yellow: "#C0C000";
|
||||
readonly property string fill: "#55000000";
|
||||
readonly property string border: standalone ? "#80FFFFFF" : "#55FFFFFF";
|
||||
readonly property string icon: (muted || clipping) ? mutedColor : gated ? gatedColor : unmutedColor;
|
||||
readonly property string icon: (muted || clipping) ? mutedColor : root.gated ? gatedColor : unmutedColor;
|
||||
}
|
||||
|
||||
Item {
|
||||
|
@ -169,7 +169,7 @@ Rectangle {
|
|||
Image {
|
||||
id: image;
|
||||
source: (pushToTalk) ? pushToTalkIcon : muted ? mutedIcon :
|
||||
clipping ? clippingIcon : gated ? gatedIcon : unmutedIcon;
|
||||
clipping ? clippingIcon : root.gated ? gatedIcon : unmutedIcon;
|
||||
width: 29;
|
||||
height: 32;
|
||||
anchors {
|
||||
|
|
|
@ -362,8 +362,8 @@ Rectangle {
|
|||
id: displayModeImage
|
||||
source: HMD.active ? "./images/desktopMode.svg" : "./images/vrMode.svg"
|
||||
anchors.centerIn: parent
|
||||
width: HMD.active ? 25 : 43
|
||||
height: 22
|
||||
width: HMD.active ? 25 : 26
|
||||
height: HMD.active ? 22 : 14
|
||||
visible: false
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2824,6 +2824,7 @@ void Application::cleanupBeforeQuit() {
|
|||
|
||||
// destroy Audio so it and its threads have a chance to go down safely
|
||||
// this must happen after QML, as there are unexplained audio crashes originating in qtwebengine
|
||||
AudioInjector::setLocalAudioInterface(nullptr);
|
||||
DependencyManager::destroy<AudioClient>();
|
||||
DependencyManager::destroy<AudioScriptingInterface>();
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ protected:
|
|||
|
||||
protected slots:
|
||||
/**jsdoc
|
||||
* Prompts the user to delete a bookmark. The user can select the bookmark to delete in the dialog that is opened.
|
||||
* @function LocationBookmarks.deleteBookmark
|
||||
*/
|
||||
virtual void deleteBookmark();
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
#include "Bookmarks.h"
|
||||
|
||||
/**jsdoc
|
||||
* The <code>LocationBookmarks</code> API provides facilities for working with location bookmarks. A location bookmark
|
||||
* associates a name with a metaverse address.
|
||||
*
|
||||
* @namespace LocationBookmarks
|
||||
*
|
||||
* @hifi-client-entity
|
||||
|
@ -35,28 +38,35 @@ public:
|
|||
static const QString HOME_BOOKMARK;
|
||||
|
||||
/**jsdoc
|
||||
* Gets the metaverse address associated with a bookmark.
|
||||
* @function LocationBookmarks.getAddress
|
||||
* @param {string} bookmarkName Name of the bookmark to get the address for.
|
||||
* @returns {string} The url for the specified bookmark. If the bookmark does not exist, the empty string will be returned.
|
||||
* @param {string} bookmarkName - Name of the bookmark to get the metaverse address for (case sensitive).
|
||||
* @returns {string} The metaverse address for the bookmark. If the bookmark does not exist, <code>""</code> is returned.
|
||||
* @example <caption>Report the "Home" bookmark's metaverse address.</caption>
|
||||
* print("Home bookmark's address: " + LocationBookmarks.getAddress("Home"));
|
||||
*/
|
||||
Q_INVOKABLE QString getAddress(const QString& bookmarkName);
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* Prompts the user to bookmark their current location. The user can specify the name of the bookmark in the dialog that is
|
||||
* opened.
|
||||
* @function LocationBookmarks.addBookmark
|
||||
*/
|
||||
void addBookmark();
|
||||
|
||||
/**jsdoc
|
||||
* Sets the metaverse address associated with the "Home" bookmark.
|
||||
* @function LocationBookmarks.setHomeLocationToAddress
|
||||
* @param {string} address
|
||||
* @param {string} address - The metaverse address to set the "Home" bookmark to.
|
||||
*/
|
||||
void setHomeLocationToAddress(const QVariant& address);
|
||||
|
||||
/**jsdoc
|
||||
* Gets the metaverse address associated with the "Home" bookmark.
|
||||
* @function LocationBookmarks.getHomeLocationAddress
|
||||
* @returns {string} The url for the home location bookmark
|
||||
* @returns {string} The metaverse address for the "Home" bookmark.
|
||||
*/
|
||||
QString getHomeLocationAddress();
|
||||
|
||||
|
|
|
@ -125,6 +125,18 @@ QString userRecenterModelToString(MyAvatar::SitStandModelType model) {
|
|||
}
|
||||
}
|
||||
|
||||
static const QStringList REACTION_NAMES = {
|
||||
QString("positive"),
|
||||
QString("negative"),
|
||||
QString("raiseHand"),
|
||||
QString("applaud"),
|
||||
QString("point")
|
||||
};
|
||||
|
||||
static int reactionNameToIndex(const QString& reactionName) {
|
||||
return REACTION_NAMES.indexOf(reactionName);
|
||||
}
|
||||
|
||||
MyAvatar::MyAvatar(QThread* thread) :
|
||||
Avatar(thread),
|
||||
_yawSpeed(YAW_SPEED_DEFAULT),
|
||||
|
@ -5812,6 +5824,53 @@ void MyAvatar::setModelScale(float scale) {
|
|||
}
|
||||
}
|
||||
|
||||
QStringList MyAvatar::getReactions() const {
|
||||
return REACTION_NAMES;
|
||||
}
|
||||
|
||||
bool MyAvatar::triggerReaction(QString reactionName) {
|
||||
int reactionIndex = reactionNameToIndex(reactionName);
|
||||
if (reactionIndex >= 0 && reactionIndex < (int)NUM_AVATAR_REACTIONS) {
|
||||
std::lock_guard<std::mutex> guard(_reactionLock);
|
||||
_reactionTriggers[reactionIndex] = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MyAvatar::beginReaction(QString reactionName) {
|
||||
int reactionIndex = reactionNameToIndex(reactionName);
|
||||
if (reactionIndex >= 0 && reactionIndex < (int)NUM_AVATAR_REACTIONS) {
|
||||
std::lock_guard<std::mutex> guard(_reactionLock);
|
||||
_reactionEnabledRefCounts[reactionIndex]++;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MyAvatar::endReaction(QString reactionName) {
|
||||
int reactionIndex = reactionNameToIndex(reactionName);
|
||||
if (reactionIndex >= 0 && reactionIndex < (int)NUM_AVATAR_REACTIONS) {
|
||||
std::lock_guard<std::mutex> guard(_reactionLock);
|
||||
_reactionEnabledRefCounts[reactionIndex]--;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void MyAvatar::updateRigControllerParameters(Rig::ControllerParameters& params) {
|
||||
std::lock_guard<std::mutex> guard(_reactionLock);
|
||||
for (int i = 0; i < NUM_AVATAR_REACTIONS; i++) {
|
||||
|
||||
// copy current state into params.
|
||||
params.reactionEnabledFlags[i] = _reactionEnabledRefCounts[i] > 0;
|
||||
params.reactionTriggers[i] = _reactionTriggers[i];
|
||||
|
||||
// clear reaction triggers here as well
|
||||
_reactionTriggers[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
SpatialParentTree* MyAvatar::getParentTree() const {
|
||||
auto entityTreeRenderer = qApp->getEntities();
|
||||
EntityTreePointer entityTree = entityTreeRenderer ? entityTreeRenderer->getTree() : nullptr;
|
||||
|
|
|
@ -1839,6 +1839,10 @@ public:
|
|||
bool getFlowActive() const;
|
||||
bool getNetworkGraphActive() const;
|
||||
|
||||
// sets the reaction enabled and triggered parameters of the passed in params
|
||||
// also clears internal reaction triggers
|
||||
void updateRigControllerParameters(Rig::ControllerParameters& params);
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
|
@ -2192,6 +2196,33 @@ public slots:
|
|||
*/
|
||||
virtual void setModelScale(float scale) override;
|
||||
|
||||
/**jsdoc
|
||||
* MyAvatar.getReactions
|
||||
* @returns {string[]} Array of reaction names.
|
||||
*/
|
||||
QStringList getReactions() const;
|
||||
|
||||
/**jsdoc
|
||||
* MyAvatar.triggerReaction
|
||||
* @param {string} reactionName - reaction name
|
||||
* @returns {bool} false if the given reaction is not supported.
|
||||
*/
|
||||
bool triggerReaction(QString reactionName);
|
||||
|
||||
/**jsdoc
|
||||
* MyAvatar.beginReaction
|
||||
* @param {string} reactionName - reaction name
|
||||
* @returns {bool} false if the given reaction is not supported.
|
||||
*/
|
||||
bool beginReaction(QString reactionName);
|
||||
|
||||
/**jsdoc
|
||||
* MyAvatar.endReaction
|
||||
* @param {string} reactionName - reaction name
|
||||
* @returns {bool} false if the given reaction is not supported.
|
||||
*/
|
||||
bool endReaction(QString reactionName);
|
||||
|
||||
signals:
|
||||
|
||||
/**jsdoc
|
||||
|
@ -2823,6 +2854,10 @@ private:
|
|||
mutable std::mutex _scriptEngineLock;
|
||||
QScriptEngine* _scriptEngine { nullptr };
|
||||
bool _needToSaveAvatarEntitySettings { false };
|
||||
|
||||
int _reactionEnabledRefCounts[NUM_AVATAR_REACTIONS] { 0, 0, 0, 0, 0 };
|
||||
bool _reactionTriggers[NUM_AVATAR_REACTIONS] { false, false, false, false, false };
|
||||
mutable std::mutex _reactionLock;
|
||||
};
|
||||
|
||||
QScriptValue audioListenModeToScriptValue(QScriptEngine* engine, const AudioListenerMode& audioListenerMode);
|
||||
|
|
|
@ -294,8 +294,6 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
|||
_prevIsEstimatingHips = false;
|
||||
}
|
||||
|
||||
params.isTalking = head->getTimeWithoutTalking() <= 1.5f;
|
||||
|
||||
// pass detailed torso k-dops to rig.
|
||||
int hipsJoint = _rig.indexOfJoint("Hips");
|
||||
if (hipsJoint >= 0) {
|
||||
|
@ -314,6 +312,10 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
|||
params.spine2ShapeInfo = hfmModel.joints[spine2Joint].shapeInfo;
|
||||
}
|
||||
|
||||
params.isTalking = head->getTimeWithoutTalking() <= 1.5f;
|
||||
|
||||
myAvatar->updateRigControllerParameters(params);
|
||||
|
||||
_rig.updateFromControllerParameters(params, deltaTime);
|
||||
|
||||
Rig::CharacterControllerState ccState = convertCharacterControllerState(myAvatar->getCharacterController()->getState());
|
||||
|
|
|
@ -69,6 +69,14 @@ void QmlWindowProxy::parentNativeWindowToMainWindow() {
|
|||
#endif
|
||||
}
|
||||
|
||||
void InteractiveWindowProxy::emitScriptEvent(const QVariant& scriptMessage){
|
||||
emit scriptEventReceived(scriptMessage);
|
||||
}
|
||||
|
||||
void InteractiveWindowProxy::emitWebEvent(const QVariant& webMessage) {
|
||||
emit webEventReceived(webMessage);
|
||||
}
|
||||
|
||||
static void qmlWindowProxyDeleter(QmlWindowProxy* qmlWindowProxy) {
|
||||
qmlWindowProxy->deleteLater();
|
||||
}
|
||||
|
@ -129,6 +137,12 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
|||
presentationMode = (InteractiveWindowPresentationMode) properties[PRESENTATION_MODE_PROPERTY].toInt();
|
||||
}
|
||||
|
||||
if (!_interactiveWindowProxy) {
|
||||
_interactiveWindowProxy = new InteractiveWindowProxy();
|
||||
QObject::connect(_interactiveWindowProxy, &InteractiveWindowProxy::webEventReceived, this, &InteractiveWindow::emitWebEvent, Qt::QueuedConnection);
|
||||
QObject::connect(this, &InteractiveWindow::scriptEventReceived, _interactiveWindowProxy, &InteractiveWindowProxy::emitScriptEvent, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
if (properties.contains(DOCKED_PROPERTY) && presentationMode == InteractiveWindowPresentationMode::Native) {
|
||||
QVariantMap nativeWindowInfo = properties[DOCKED_PROPERTY].toMap();
|
||||
Qt::DockWidgetArea dockArea = Qt::TopDockWidgetArea;
|
||||
|
@ -182,13 +196,17 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
QObject::connect(quickView.get(), &QQuickView::statusChanged, [&, this] (QQuickView::Status status) {
|
||||
if (status == QQuickView::Ready) {
|
||||
QQuickItem* rootItem = _dockWidget->getRootItem();
|
||||
_dockWidget->getQuickView()->rootContext()->setContextProperty(EVENT_BRIDGE_PROPERTY, this);
|
||||
_dockWidget->getQuickView()->rootContext()->setContextProperty(EVENT_BRIDGE_PROPERTY, _interactiveWindowProxy);
|
||||
// The qmlToScript method handles the thread-safety of this call. Because the QVariant argument
|
||||
// passed to the sendToScript signal may wrap an externally managed and thread-unsafe QJSValue,
|
||||
// qmlToScript needs to be called directly, so the QJSValue can be immediately converted to a plain QVariant.
|
||||
QObject::connect(rootItem, SIGNAL(sendToScript(QVariant)), this, SLOT(qmlToScript(const QVariant&)),
|
||||
Qt::QueuedConnection);
|
||||
Qt::DirectConnection);
|
||||
QObject::connect(rootItem, SIGNAL(keyPressEvent(int, int)), this, SLOT(forwardKeyPressEvent(int, int)),
|
||||
Qt::QueuedConnection);
|
||||
QObject::connect(rootItem, SIGNAL(keyReleaseEvent(int, int)), this, SLOT(forwardKeyReleaseEvent(int, int)),
|
||||
|
@ -204,7 +222,7 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
|||
// Build the event bridge and wrapper on the main thread
|
||||
offscreenUi->loadInNewContext(CONTENT_WINDOW_QML, [&](QQmlContext* context, QObject* object) {
|
||||
_qmlWindowProxy = std::shared_ptr<QmlWindowProxy>(new QmlWindowProxy(object, nullptr), qmlWindowProxyDeleter);
|
||||
context->setContextProperty(EVENT_BRIDGE_PROPERTY, this);
|
||||
context->setContextProperty(EVENT_BRIDGE_PROPERTY, _interactiveWindowProxy);
|
||||
if (properties.contains(ADDITIONAL_FLAGS_PROPERTY)) {
|
||||
object->setProperty(ADDITIONAL_FLAGS_PROPERTY, properties[ADDITIONAL_FLAGS_PROPERTY].toUInt());
|
||||
}
|
||||
|
@ -229,7 +247,10 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
|||
object->setProperty(VISIBLE_PROPERTY, properties[INTERACTIVE_WINDOW_VISIBLE_PROPERTY].toBool());
|
||||
}
|
||||
|
||||
connect(object, SIGNAL(sendToScript(QVariant)), this, SLOT(qmlToScript(const QVariant&)), Qt::QueuedConnection);
|
||||
// The qmlToScript method handles the thread-safety of this call. Because the QVariant argument
|
||||
// passed to the sendToScript signal may wrap an externally managed and thread-unsafe QJSValue,
|
||||
// qmlToScript needs to be called directly, so the QJSValue can be immediately converted to a plain QVariant.
|
||||
connect(object, SIGNAL(sendToScript(QVariant)), this, SLOT(qmlToScript(const QVariant&)), Qt::DirectConnection);
|
||||
QObject::connect(object, SIGNAL(keyPressEvent(int, int)), this, SLOT(forwardKeyPressEvent(int, int)),
|
||||
Qt::QueuedConnection);
|
||||
QObject::connect(object, SIGNAL(keyReleaseEvent(int, int)), this, SLOT(forwardKeyReleaseEvent(int, int)),
|
||||
|
@ -263,6 +284,7 @@ InteractiveWindow::~InteractiveWindow() {
|
|||
}
|
||||
|
||||
void InteractiveWindow::sendToQml(const QVariant& message) {
|
||||
|
||||
// Forward messages received from the script on to QML
|
||||
if (_dockWidget) {
|
||||
QQuickItem* rootItem = _dockWidget->getRootItem();
|
||||
|
@ -291,6 +313,10 @@ void InteractiveWindow::close() {
|
|||
_qmlWindowProxy->deleteLater();
|
||||
}
|
||||
|
||||
if (_interactiveWindowProxy) {
|
||||
_interactiveWindowProxy->deleteLater();
|
||||
}
|
||||
|
||||
if (_dockWidget) {
|
||||
auto window = qApp->getWindow();
|
||||
if (QThread::currentThread() != window->thread()) {
|
||||
|
@ -301,6 +327,7 @@ void InteractiveWindow::close() {
|
|||
}
|
||||
_dockWidget = nullptr;
|
||||
_qmlWindowProxy = nullptr;
|
||||
_interactiveWindowProxy = nullptr;
|
||||
}
|
||||
|
||||
void InteractiveWindow::show() {
|
||||
|
@ -315,13 +342,21 @@ void InteractiveWindow::raise() {
|
|||
}
|
||||
}
|
||||
|
||||
void InteractiveWindow::qmlToScript(const QVariant& message) {
|
||||
void InteractiveWindow::qmlToScript(const QVariant& originalMessage) {
|
||||
QVariant message = originalMessage;
|
||||
if (message.canConvert<QJSValue>()) {
|
||||
emit fromQml(qvariant_cast<QJSValue>(message).toVariant());
|
||||
message = qvariant_cast<QJSValue>(message).toVariant();
|
||||
} else if (message.canConvert<QString>()) {
|
||||
emit fromQml(message.toString());
|
||||
message = message.toString();
|
||||
} else {
|
||||
qWarning() << "Unsupported message type " << message;
|
||||
return;
|
||||
}
|
||||
|
||||
if (thread() != QThread::currentThread()) {
|
||||
QMetaObject::invokeMethod(this, "fromQml", Q_ARG(const QVariant&, message));
|
||||
} else {
|
||||
emit fromQml(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,23 @@ public:
|
|||
QObject* getQmlWindow() const { return _qmlWindow; }
|
||||
private:
|
||||
QObject* _qmlWindow;
|
||||
};
|
||||
|
||||
|
||||
class InteractiveWindowProxy : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
InteractiveWindowProxy(){}
|
||||
|
||||
public slots:
|
||||
|
||||
void emitScriptEvent(const QVariant& scriptMessage);
|
||||
void emitWebEvent(const QVariant& webMessage);
|
||||
|
||||
signals:
|
||||
|
||||
void scriptEventReceived(const QVariant& message);
|
||||
void webEventReceived(const QVariant& message);
|
||||
};
|
||||
|
||||
|
||||
|
@ -309,6 +325,7 @@ protected slots:
|
|||
private:
|
||||
std::shared_ptr<QmlWindowProxy> _qmlWindowProxy;
|
||||
std::shared_ptr<DockWidget> _dockWidget { nullptr };
|
||||
InteractiveWindowProxy *_interactiveWindowProxy{ nullptr };
|
||||
};
|
||||
|
||||
typedef InteractiveWindow* InteractiveWindowPointer;
|
||||
|
|
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.0)
|
|||
set(ENV{MACOSX_DEPLOYMENT_TARGET} 10.9)
|
||||
project(HQLauncher)
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
|
||||
include("cmake/macros/SetPackagingParameters.cmake")
|
||||
set(src_files
|
||||
src/Launcher.h
|
||||
src/Launcher.m
|
||||
|
@ -59,43 +60,27 @@ set_target_properties(${this_target} PROPERTIES
|
|||
set(MACOSX_BUNDLE_ICON_FILE "interface.icns")
|
||||
|
||||
function(set_from_env _RESULT_NAME _ENV_VAR_NAME _DEFAULT_VALUE)
|
||||
if (NOT DEFINED ${_RESULT_NAME})
|
||||
if ("$ENV{${_ENV_VAR_NAME}}" STREQUAL "")
|
||||
set (${_RESULT_NAME} ${_DEFAULT_VALUE} PARENT_SCOPE)
|
||||
else()
|
||||
set (${_RESULT_NAME} $ENV{${_ENV_VAR_NAME}} PARENT_SCOPE)
|
||||
endif()
|
||||
if (NOT DEFINED ${_RESULT_NAME})
|
||||
if ("$ENV{${_ENV_VAR_NAME}}" STREQUAL "")
|
||||
set (${_RESULT_NAME} ${_DEFAULT_VALUE} PARENT_SCOPE)
|
||||
else()
|
||||
set (${_RESULT_NAME} $ENV{${_ENV_VAR_NAME}} PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
set_packaging_parameters()
|
||||
|
||||
add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${src_files})
|
||||
|
||||
set_from_env(XCODE_DEVELOPMENT_TEAM XCODE_DEVELOPMENT_TEAM "")
|
||||
if ("${XCODE_DEVELOPMENT_TEAM}" STREQUAL "")
|
||||
message(WARNING "XCODE_DEVELOPMENT_TEAM environmental variable is not set. Not signing build.")
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${APP_NAME}
|
||||
MACOSX_BUNDLE_BUNDLE_NAME ${APP_NAME}
|
||||
)
|
||||
else()
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${APP_NAME}
|
||||
MACOSX_BUNDLE_BUNDLE_NAME ${APP_NAME}
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "HQ Launcher.entitlements"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Developer ID Application"
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTS NO
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_STYLE "Manual"
|
||||
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${XCODE_DEVELOPMENT_TEAM}"
|
||||
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES
|
||||
XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--timestamp"
|
||||
XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER ""
|
||||
)
|
||||
endif()
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${APP_NAME}
|
||||
MACOSX_BUNDLE_BUNDLE_NAME ${APP_NAME})
|
||||
set_from_env(LAUNCHER_HMAC_SECRET LAUNCHER_HMAC_SECRET "")
|
||||
if ("${LAUNCHER_HMAC_SECRET}" STREQUAL "")
|
||||
message(FATAL_ERROR "LAUNCHER_HMAC_SECRET is not set")
|
||||
endif()
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE LAUNCHER_HMAC_SECRET="${LAUNCHER_HMAC_SECRET}")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE LAUNCHER_BUILD_VERSION="${BUILD_VERSION}")
|
||||
|
||||
file(GLOB NIB_FILES "nib/*.xib")
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>high-fidelity.hifi</string>
|
||||
</array>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
45
launchers/darwin/cmake/macros/SetPackagingParameters.cmake
Normal file
45
launchers/darwin/cmake/macros/SetPackagingParameters.cmake
Normal file
|
@ -0,0 +1,45 @@
|
|||
#
|
||||
# SetPackagingParameters.cmake
|
||||
# cmake/macros
|
||||
#
|
||||
# Created by Leonardo Murillo on 07/14/2015.
|
||||
# Copyright 2015 High Fidelity, Inc.
|
||||
#
|
||||
# Distributed under the Apache License, Version 2.0.
|
||||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
# This macro checks some Jenkins defined environment variables to determine the origin of this build
|
||||
# and decides how targets should be packaged.
|
||||
|
||||
macro(SET_PACKAGING_PARAMETERS)
|
||||
set(PR_BUILD 0)
|
||||
set(PRODUCTION_BUILD 0)
|
||||
set(DEV_BUILD 0)
|
||||
set(BUILD_NUMBER 0)
|
||||
|
||||
set_from_env(RELEASE_TYPE RELEASE_TYPE "DEV")
|
||||
set_from_env(RELEASE_NUMBER RELEASE_NUMBER "")
|
||||
set_from_env(STABLE_BUILD STABLE_BUILD 0)
|
||||
|
||||
message(STATUS "The RELEASE_TYPE variable is: ${RELEASE_TYPE}")
|
||||
set(BUILD_NUMBER ${RELEASE_NUMBER})
|
||||
|
||||
if (RELEASE_TYPE STREQUAL "PRODUCTION")
|
||||
set(PRODUCTION_BUILD 1)
|
||||
set(BUILD_VERSION ${RELEASE_NUMBER})
|
||||
|
||||
# add definition for this release type
|
||||
add_definitions(-DPRODUCTION_BUILD)
|
||||
|
||||
elseif (RELEASE_TYPE STREQUAL "PR")
|
||||
set(PR_BUILD 1)
|
||||
set(BUILD_VERSION "PR${RELEASE_NUMBER}")
|
||||
|
||||
# add definition for this release type
|
||||
add_definitions(-DPR_BUILD)
|
||||
else ()
|
||||
set(DEV_BUILD 1)
|
||||
set(BUILD_VERSION "dev")
|
||||
endif ()
|
||||
|
||||
endmacro(SET_PACKAGING_PARAMETERS)
|
|
@ -102,12 +102,22 @@
|
|||
<action selector="termsOfService:" target="YVh-OH-vU8" id="bgc-08-8Lj"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oJs-u5-OOJ">
|
||||
<rect key="frame" x="380" y="0.0" width="130" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Label" id="H6o-Xs-wK1">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="systemGrayColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="138.5" y="154"/>
|
||||
</customView>
|
||||
<customObject id="YVh-OH-vU8" customClass="DisplayNameScreen">
|
||||
<connections>
|
||||
<outlet property="backgroundImage" destination="aus-lo-eVi" id="SRc-pV-lXG"/>
|
||||
<outlet property="buildVersion" destination="oJs-u5-OOJ" id="avj-j2-5P6"/>
|
||||
<outlet property="displayName" destination="Vhg-rq-xUH" id="Fb5-im-2hx"/>
|
||||
<outlet property="smallLogo" destination="j8K-TD-h7e" id="OVd-p3-nu6"/>
|
||||
</connections>
|
||||
|
|
|
@ -69,12 +69,22 @@
|
|||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="CBD-Vk-Xd4"/>
|
||||
</imageView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Omk-5j-C6r">
|
||||
<rect key="frame" x="381" y="0.0" width="130" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Label" id="xpG-oP-agI">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="systemGrayColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="138.5" y="152"/>
|
||||
</customView>
|
||||
<customObject id="nWn-x7-LxT" customClass="ErrorViewController">
|
||||
<connections>
|
||||
<outlet property="backgroundImage" destination="eih-a8-Pqa" id="2xh-8r-1Qu"/>
|
||||
<outlet property="buildVersion" destination="Omk-5j-C6r" id="aTp-c3-RVy"/>
|
||||
<outlet property="smallLogo" destination="ugn-Hk-gWL" id="EVI-d3-mf5"/>
|
||||
<outlet property="voxelImage" destination="jmW-5q-Mf3" id="NiI-cY-tAf"/>
|
||||
</connections>
|
||||
|
|
|
@ -119,12 +119,22 @@
|
|||
<action selector="havingTrouble:" target="NkF-nk-81S" id="tsf-tC-aqq"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EsT-hn-six">
|
||||
<rect key="frame" x="380" y="0.0" width="130" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Label" id="AGt-jH-mX2">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="systemGrayColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="138.5" y="154"/>
|
||||
</customView>
|
||||
<customObject id="NkF-nk-81S" customClass="LoginScreen">
|
||||
<connections>
|
||||
<outlet property="backgroundImage" destination="L56-Jv-0N8" id="INT-rB-YtG"/>
|
||||
<outlet property="buildVersion" destination="EsT-hn-six" id="Z4k-Gv-U5g"/>
|
||||
<outlet property="button" destination="jKE-fV-Tjv" id="or6-tG-r6R"/>
|
||||
<outlet property="header" destination="hIC-qf-Abj" id="sVQ-rl-cvR"/>
|
||||
<outlet property="orginization" destination="L7W-3n-OKy" id="TiL-wn-Z2b"/>
|
||||
|
|
|
@ -53,6 +53,15 @@
|
|||
<rect key="frame" x="68" y="78" width="394" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="U3I-TA-xRz">
|
||||
<rect key="frame" x="380" y="0.0" width="130" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Label" id="8YH-Td-daK">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="systemGrayColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="138.5" y="154"/>
|
||||
</customView>
|
||||
|
@ -60,6 +69,7 @@
|
|||
<connections>
|
||||
<outlet property="background" destination="kuY-e2-Hqb" id="CBc-bD-ux7"/>
|
||||
<outlet property="boldStatus" destination="EMF-E4-qLL" id="udm-8B-7lt"/>
|
||||
<outlet property="buildVersion" destination="U3I-TA-xRz" id="HDI-tW-1cC"/>
|
||||
<outlet property="progressView" destination="aEr-fi-fkV" id="OUy-Qp-tiP"/>
|
||||
<outlet property="smallLogo" destination="uh2-4K-n56" id="pYg-hP-nr5"/>
|
||||
<outlet property="smallStatus" destination="BSg-lp-njL" id="ziz-ek-Lq4"/>
|
||||
|
|
|
@ -26,11 +26,21 @@
|
|||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="qC6-tI-Uwf"/>
|
||||
</imageView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EgF-VK-Hfo">
|
||||
<rect key="frame" x="380" y="0.0" width="130" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Label" id="gWS-UL-cjB">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="systemGrayColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="systemGrayColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="119.5" y="134"/>
|
||||
</customView>
|
||||
<customObject id="iJ0-FI-XIf" customClass="SplashScreen">
|
||||
<connections>
|
||||
<outlet property="buildVersion" destination="EgF-VK-Hfo" id="lVp-Ua-9Mt"/>
|
||||
<outlet property="imageView" destination="qtD-mb-qqq" id="rCt-Gd-Uux"/>
|
||||
<outlet property="logoImage" destination="2i5-Zw-nH7" id="7tM-sX-cvR"/>
|
||||
</connections>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
@property (nonatomic, assign) IBOutlet NSImageView* backgroundImage;
|
||||
@property (nonatomic, assign) IBOutlet NSImageView* smallLogo;
|
||||
@property (nonatomic, assign) IBOutlet NSTextField* displayName;
|
||||
@property (nonatomic, assign) IBOutlet NSTextField* buildVersion;
|
||||
@end
|
||||
|
||||
@implementation DisplayNameScreen
|
||||
|
@ -13,10 +14,9 @@
|
|||
[self.backgroundImage setImage: [NSImage imageNamed:hifiBackgroundFilename]];
|
||||
[self.smallLogo setImage: [NSImage imageNamed:hifiSmallLogoFilename]];
|
||||
NSMutableAttributedString* displayNameString = [[NSMutableAttributedString alloc] initWithString:@"Display Name"];
|
||||
|
||||
[self.buildVersion setStringValue: [@"V." stringByAppendingString:@LAUNCHER_BUILD_VERSION]];
|
||||
[displayNameString addAttribute:NSForegroundColorAttributeName value:[NSColor grayColor] range:NSMakeRange(0, displayNameString.length)];
|
||||
[displayNameString addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:18] range:NSMakeRange(0,displayNameString.length)];
|
||||
|
||||
[self.displayName setPlaceholderAttributedString:displayNameString];
|
||||
[self.displayName setTarget:self];
|
||||
[self.displayName setAction:@selector(login:)];
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
@property (nonatomic, assign) IBOutlet NSImageView* backgroundImage;
|
||||
@property (nonatomic, assign) IBOutlet NSImageView* smallLogo;
|
||||
@property (nonatomic, assign) IBOutlet NSImageView* voxelImage;
|
||||
@property (nonatomic, assign) IBOutlet NSTextField* buildVersion;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -16,6 +17,7 @@
|
|||
[self.backgroundImage setImage:[NSImage imageNamed:hifiBackgroundFilename]];
|
||||
[self.smallLogo setImage:[NSImage imageNamed:hifiSmallLogoFilename]];
|
||||
[self.voxelImage setImage:[NSImage imageNamed:hifiVoxelFilename]];
|
||||
[self.buildVersion setStringValue: [@"V." stringByAppendingString:@LAUNCHER_BUILD_VERSION]];
|
||||
}
|
||||
|
||||
-(IBAction)resartLauncher:(id)sender
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
@property (nonatomic, assign) IBOutlet NSTextField* smallHeader;
|
||||
@property (nonatomic, assign) IBOutlet NSTextField* trouble;
|
||||
@property (nonatomic, assign) IBOutlet NSButton* button;
|
||||
@property (nonatomic, assign) IBOutlet NSTextField* buildVersion;
|
||||
@end
|
||||
|
||||
@implementation LoginScreen
|
||||
|
@ -36,6 +37,7 @@
|
|||
[self.button setTitle:@"TRY AGAIN"];
|
||||
}
|
||||
|
||||
[self.buildVersion setStringValue: [@"V." stringByAppendingString:@LAUNCHER_BUILD_VERSION]];
|
||||
[self.backgroundImage setImage:[NSImage imageNamed:hifiBackgroundFilename]];
|
||||
[self.smallLogo setImage:[NSImage imageNamed:hifiSmallLogoFilename]];
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
@property (nonatomic, assign) IBOutlet NSTextField* boldStatus;
|
||||
@property (nonatomic, assign) IBOutlet NSTextField* smallStatus;
|
||||
@property (nonatomic, assign) IBOutlet NSProgressIndicator* progressView;
|
||||
@property (nonatomic, assign) IBOutlet NSTextField* buildVersion;
|
||||
@end
|
||||
|
||||
@implementation ProcessScreen
|
||||
|
@ -37,6 +38,7 @@
|
|||
default:
|
||||
break;
|
||||
}
|
||||
[self.buildVersion setStringValue: [@"V." stringByAppendingString:@LAUNCHER_BUILD_VERSION]];
|
||||
[self.background setImage: [NSImage imageNamed:hifiBackgroundFilename]];
|
||||
[self.smallLogo setImage: [NSImage imageNamed:hifiSmallLogoFilename]];
|
||||
[self.voxelImage setImage: [NSImage imageNamed:hifiVoxelFilename]];
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
@property (nonatomic, assign) IBOutlet NSImageView* imageView;
|
||||
@property (nonatomic, assign) IBOutlet NSImageView* logoImage;
|
||||
@property (nonatomic, assign) IBOutlet NSButton* button;
|
||||
@property (nonatomic, assign) IBOutlet NSTextField* buildVersion;
|
||||
@end
|
||||
|
||||
@implementation SplashScreen
|
||||
|
@ -15,5 +16,6 @@
|
|||
-(void)awakeFromNib {
|
||||
[self.imageView setImage:[NSImage imageNamed:hifiBackgroundFilename]];
|
||||
[self.logoImage setImage:[NSImage imageNamed:hifiLargeLogoFilename]];
|
||||
[self.buildVersion setStringValue: [@"V." stringByAppendingString:@LAUNCHER_BUILD_VERSION]];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -10,6 +10,7 @@ set(CMAKE_MFC_FLAG 1)
|
|||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
||||
include("cmake/macros/SetPackagingParameters.cmake")
|
||||
|
||||
add_executable(HQLauncher
|
||||
WIN32
|
||||
|
@ -49,6 +50,8 @@ function(set_from_env _RESULT_NAME _ENV_VAR_NAME _DEFAULT_VALUE)
|
|||
endif()
|
||||
endfunction()
|
||||
|
||||
set_packaging_parameters()
|
||||
|
||||
set_from_env(LAUNCHER_HMAC_SECRET LAUNCHER_HMAC_SECRET "")
|
||||
|
||||
if (LAUNCHER_HMAC_SECRET STREQUAL "")
|
||||
|
@ -56,7 +59,7 @@ if (LAUNCHER_HMAC_SECRET STREQUAL "")
|
|||
endif()
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE LAUNCHER_HMAC_SECRET="${LAUNCHER_HMAC_SECRET}")
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE LAUNCHER_BUILD_VERSION="${BUILD_VERSION}")
|
||||
|
||||
# Preprocessor definitions
|
||||
target_compile_definitions(HQLauncher PRIVATE
|
||||
|
|
|
@ -92,8 +92,8 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
|||
EXSTYLE WS_EX_APPWINDOW
|
||||
FONT 10, "MS Shell Dlg", 400, 0, 0x0
|
||||
BEGIN
|
||||
CONTROL "",IDC_VOXEL,"Static",SS_BLACKRECT,65,3,174,123, NOT WS_VISIBLE
|
||||
CONTROL "", IDC_PROGRESS, "Static", SS_BLACKRECT, 35, 170, 239, 4, NOT WS_VISIBLE
|
||||
CONTROL "",IDC_VOXEL,"Static",SS_BLACKRECT,65,3,174,123
|
||||
CONTROL "",IDC_PROGRESS,"Static",SS_BLACKRECT,35,170,239,4
|
||||
EDITTEXT IDC_ORGNAME,44,68,219,12,ES_AUTOHSCROLL | NOT WS_VISIBLE | NOT WS_BORDER
|
||||
EDITTEXT IDC_USERNAME,44,95,219,12,ES_AUTOHSCROLL | NOT WS_VISIBLE | NOT WS_BORDER
|
||||
EDITTEXT IDC_PASSWORD,44,122,219,12,ES_PASSWORD | ES_AUTOHSCROLL | NOT WS_VISIBLE | NOT WS_BORDER
|
||||
|
@ -107,6 +107,7 @@ BEGIN
|
|||
RTEXT "",IDC_TERMS,15,172,180,15,NOT WS_VISIBLE
|
||||
CONTROL "",IDC_TERMS_LINK,"Button",BS_OWNERDRAW | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,197,172,80,15
|
||||
CTEXT "",IDC_TROUBLE,65,203,174,15,NOT WS_VISIBLE
|
||||
RTEXT "",IDC_VERSION,100,205,205,10
|
||||
CONTROL "NEXT",IDC_BUTTON_NEXT,"Button",BS_OWNERDRAW | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,107,158,94,16
|
||||
CONTROL "Having Trouble?",IDC_TROUBLE_LINK,"Button",BS_OWNERDRAW | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,126,203,56,11
|
||||
END
|
||||
|
|
|
@ -39,16 +39,28 @@ BOOL CLauncherApp::InitInstance() {
|
|||
}
|
||||
int iNumOfArgs;
|
||||
LPWSTR* pArgs = CommandLineToArgvW(GetCommandLine(), &iNumOfArgs);
|
||||
bool isUninstalling = false;
|
||||
bool isRestarting = false;
|
||||
bool uninstalling = false;
|
||||
bool restarting = false;
|
||||
bool noUpdate = false;
|
||||
bool continueUpdating = false;
|
||||
bool skipSplash = false;
|
||||
if (iNumOfArgs > 1) {
|
||||
if (CString(pArgs[1]).Compare(_T("--uninstall")) == 0) {
|
||||
isUninstalling = true;
|
||||
} else if (CString(pArgs[1]).Compare(_T("--restart")) == 0) {
|
||||
isRestarting = true;
|
||||
for (int i = 1; i < iNumOfArgs; i++) {
|
||||
CString curArg = CString(pArgs[i]);
|
||||
if (curArg.Compare(_T("--uninstall")) == 0) {
|
||||
uninstalling = true;
|
||||
} else if (curArg.Compare(_T("--restart")) == 0) {
|
||||
restarting = true;
|
||||
} else if (curArg.Compare(_T("--noUpdate")) == 0) {
|
||||
noUpdate = true;
|
||||
} else if (curArg.Compare(_T("--continueUpdating")) == 0) {
|
||||
continueUpdating = true;
|
||||
} else if (curArg.Compare(_T("--skipSplash")) == 0) {
|
||||
skipSplash = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isRestarting) {
|
||||
if (!restarting) {
|
||||
// don't launch if already running
|
||||
CreateMutex(NULL, TRUE, _T("HQ_Launcher_Mutex"));
|
||||
if (GetLastError() == ERROR_ALREADY_EXISTS) {
|
||||
|
@ -56,10 +68,10 @@ BOOL CLauncherApp::InitInstance() {
|
|||
}
|
||||
}
|
||||
|
||||
if (isUninstalling) {
|
||||
if (uninstalling) {
|
||||
_manager.uninstall();
|
||||
} else {
|
||||
_manager.init();
|
||||
_manager.init(!noUpdate, continueUpdating, skipSplash);
|
||||
}
|
||||
if (!_manager.hasFailed() && !_manager.installLauncher()) {
|
||||
return FALSE;
|
||||
|
|
|
@ -40,6 +40,8 @@ static CString GRAPHIK_SEMIBOLD = _T("Graphik-Semibold");
|
|||
static CString TROUBLE_URL = _T("https://www.highfidelity.com/hq-support");
|
||||
static CString TERMS_URL = _T("https://www.highfidelity.com/termsofservice");
|
||||
|
||||
static int SPLASH_DURATION = 100;
|
||||
|
||||
|
||||
CLauncherDlg::CLauncherDlg(CWnd* pParent)
|
||||
: CDialog(IDD_LAUNCHER_DIALOG, pParent)
|
||||
|
@ -112,6 +114,11 @@ BOOL CLauncherDlg::OnInitDialog() {
|
|||
m_voxel = (CStatic *)GetDlgItem(IDC_VOXEL);
|
||||
m_progress = (CStatic *)GetDlgItem(IDC_PROGRESS);
|
||||
|
||||
m_version = (CStatic *)GetDlgItem(IDC_VERSION);
|
||||
CString version;
|
||||
version.Format(_T("V.%s"), theApp._manager.getLauncherVersion());
|
||||
m_version->SetWindowTextW(version);
|
||||
|
||||
m_voxel->EnableD2DSupport();
|
||||
m_progress->EnableD2DSupport();
|
||||
|
||||
|
@ -230,7 +237,6 @@ void CLauncherDlg::startProcess() {
|
|||
theApp._manager.setFailed(true);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
BOOL CLauncherDlg::getHQInfo(const CString& orgname) {
|
||||
|
@ -322,11 +328,12 @@ void CLauncherDlg::drawLogo(CHwndRenderTarget* pRenderTarget) {
|
|||
void CLauncherDlg::drawSmallLogo(CHwndRenderTarget* pRenderTarget) {
|
||||
CD2DBitmap m_pBitmamLogo(pRenderTarget, IDB_PNG5, _T("PNG"));
|
||||
auto size = pRenderTarget->GetSize();
|
||||
int padding = 6;
|
||||
int xPadding = 6;
|
||||
int yPadding = 22;
|
||||
int logoWidth = 100;
|
||||
int logoHeight = 18;
|
||||
float logoPosX = size.width - logoWidth - padding;
|
||||
float logoPosY = size.height - logoHeight - padding;
|
||||
float logoPosX = size.width - logoWidth - xPadding;
|
||||
float logoPosY = size.height - logoHeight - yPadding;
|
||||
CD2DRectF logoRec(logoPosX, logoPosY, logoPosX + logoWidth, logoPosY + logoHeight);
|
||||
pRenderTarget->DrawBitmap(&m_pBitmamLogo, logoRec);
|
||||
}
|
||||
|
@ -521,6 +528,7 @@ BOOL CLauncherDlg::getTextFormat(int resID, TextFormat& formatOut) {
|
|||
formatOut.size = FIELDS_FONT_SIZE;
|
||||
formatOut.color = COLOR_GREY;
|
||||
break;
|
||||
case IDC_VERSION:
|
||||
case IDC_TERMS:
|
||||
formatOut.size = TERMS_FONT_SIZE;
|
||||
break;
|
||||
|
@ -663,16 +671,46 @@ void CLauncherDlg::OnTimer(UINT_PTR nIDEvent) {
|
|||
// Refresh
|
||||
setDrawDialog(_drawStep, true);
|
||||
}
|
||||
|
||||
if (theApp._manager.needsSelfUpdate()) {
|
||||
if (theApp._manager.needsSelfDownload()) {
|
||||
theApp._manager.downloadNewLauncher();
|
||||
} else {
|
||||
if (_splashStep > SPLASH_DURATION && _splashStep < 2 * SPLASH_DURATION) {
|
||||
float progress = (float)(_splashStep - SPLASH_DURATION) / SPLASH_DURATION;
|
||||
if (theApp._manager.willContinueUpdating()) {
|
||||
progress = CONTINUE_UPDATING_GLOBAL_OFFSET * progress;
|
||||
progress = min(progress, CONTINUE_UPDATING_GLOBAL_OFFSET);
|
||||
}
|
||||
theApp._manager.updateProgress(LauncherManager::ProcessType::Uninstall, progress);
|
||||
_splashStep++;
|
||||
}
|
||||
if (theApp._manager.needsRestartNewLauncher()) {
|
||||
if (_splashStep >= 2 * SPLASH_DURATION) {
|
||||
theApp._manager.restartNewLauncher();
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_showSplash) {
|
||||
if (_splashStep == 0) {
|
||||
if (theApp._manager.needsUninstall()) {
|
||||
theApp._manager.addToLog(_T("Waiting to uninstall"));
|
||||
setDrawDialog(DrawStep::DrawProcessUninstall);
|
||||
} else if (theApp._manager.shouldContinueUpdating()) {
|
||||
_splashStep = SPLASH_DURATION;
|
||||
setDrawDialog(DrawStep::DrawProcessUpdate);
|
||||
theApp._manager.updateProgress(LauncherManager::ProcessType::Uninstall, 0.0f);
|
||||
} else {
|
||||
theApp._manager.addToLog(_T("Start splash screen"));
|
||||
setDrawDialog(DrawStep::DrawLogo);
|
||||
if (theApp._manager.shouldSkipSplashScreen()) {
|
||||
_splashStep = SPLASH_DURATION;
|
||||
} else {
|
||||
theApp._manager.addToLog(_T("Start splash screen"));
|
||||
setDrawDialog(DrawStep::DrawLogo);
|
||||
}
|
||||
}
|
||||
} else if (_splashStep > 100 && !theApp._manager.needsToWait()) {
|
||||
} else if (_splashStep > SPLASH_DURATION && !theApp._manager.needsToWait()) {
|
||||
_showSplash = false;
|
||||
if (theApp._manager.shouldShutDown()) {
|
||||
if (_applicationWND != NULL) {
|
||||
|
@ -692,12 +730,14 @@ void CLauncherDlg::OnTimer(UINT_PTR nIDEvent) {
|
|||
theApp._manager.addToLog(_T("HQ failed to uninstall."));
|
||||
theApp._manager.setFailed(true);
|
||||
}
|
||||
} else if (theApp._manager.needsSelfUpdate()) {
|
||||
setDrawDialog(DrawStep::DrawProcessUpdate);
|
||||
} else {
|
||||
theApp._manager.addToLog(_T("Starting login"));
|
||||
setDrawDialog(DrawStep::DrawLoginLogin);
|
||||
}
|
||||
} else if (theApp._manager.needsUninstall()) {
|
||||
theApp._manager.updateProgress(LauncherManager::ProcessType::Uninstall, (float)_splashStep/100);
|
||||
theApp._manager.updateProgress(LauncherManager::ProcessType::Uninstall, (float)_splashStep / SPLASH_DURATION);
|
||||
}
|
||||
_splashStep++;
|
||||
} else if (theApp._manager.shouldShutDown()) {
|
||||
|
@ -741,12 +781,17 @@ void CLauncherDlg::setDrawDialog(DrawStep step, BOOL isUpdate) {
|
|||
auto m_voxelRenderTarget = m_voxel->GetRenderTarget();
|
||||
auto m_progressRenderTarget = m_progress->GetRenderTarget();
|
||||
switch (_drawStep) {
|
||||
case DrawStep::DrawLogo:
|
||||
case DrawStep::DrawLogo: {
|
||||
m_pRenderTarget->BeginDraw();
|
||||
drawBackground(m_pRenderTarget);
|
||||
drawLogo(m_pRenderTarget);
|
||||
m_pRenderTarget->EndDraw();
|
||||
CRect redrawRec;
|
||||
GetClientRect(redrawRec);
|
||||
redrawRec.top = redrawRec.bottom - 30;
|
||||
RedrawWindow(redrawRec);
|
||||
break;
|
||||
}
|
||||
case DrawStep::DrawLoginLogin:
|
||||
case DrawStep::DrawLoginErrorOrg:
|
||||
case DrawStep::DrawLoginErrorCred:
|
||||
|
|
|
@ -94,6 +94,8 @@ protected:
|
|||
CStatic* m_username_banner;
|
||||
CStatic* m_password_banner;
|
||||
|
||||
CStatic* m_version;
|
||||
|
||||
HWND _applicationWND { 0 };
|
||||
|
||||
void drawBackground(CHwndRenderTarget* pRenderTarget);
|
||||
|
|
|
@ -21,10 +21,20 @@ LauncherManager::LauncherManager() {
|
|||
LauncherManager::~LauncherManager() {
|
||||
}
|
||||
|
||||
void LauncherManager::init() {
|
||||
void LauncherManager::init(BOOL allowUpdate, BOOL continueUpdating, BOOL skipSplashScreen) {
|
||||
initLog();
|
||||
addToLog(_T("Getting most recent build"));
|
||||
getMostRecentBuild(_latestApplicationURL, _latestVersion);
|
||||
int tokenPos = 0;
|
||||
_updateLauncherAllowed = allowUpdate;
|
||||
_continueUpdating = continueUpdating;
|
||||
_skipSplashScreen = skipSplashScreen;
|
||||
_shouldWait = !skipSplashScreen;
|
||||
if (_continueUpdating) {
|
||||
_progressOffset = CONTINUE_UPDATING_GLOBAL_OFFSET;
|
||||
}
|
||||
_launcherVersion = CString(LAUNCHER_BUILD_VERSION).Tokenize(_T("-"), tokenPos);
|
||||
addToLog(_T("Launcher is running version: " + _launcherVersion));
|
||||
addToLog(_T("Getting most recent builds"));
|
||||
getMostRecentBuilds(_latestLauncherURL, _latestLauncherVersion, _latestApplicationURL, _latestVersion);
|
||||
}
|
||||
|
||||
BOOL LauncherManager::initLog() {
|
||||
|
@ -124,6 +134,8 @@ BOOL LauncherManager::restartLauncher() {
|
|||
|
||||
void LauncherManager::updateProgress(ProcessType processType, float progress) {
|
||||
switch (processType) {
|
||||
case ProcessType::DownloadLauncher:
|
||||
break;
|
||||
case ProcessType::Uninstall:
|
||||
_progress = progress;
|
||||
break;
|
||||
|
@ -153,6 +165,7 @@ void LauncherManager::updateProgress(ProcessType processType, float progress) {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
_progress = _progressOffset + (1.0f - _progressOffset) * _progress;
|
||||
TRACE("progress = %f\n", _progress);
|
||||
}
|
||||
|
||||
|
@ -200,11 +213,11 @@ BOOL LauncherManager::isApplicationInstalled(CString& version, CString& domain,
|
|||
CString applicationDir;
|
||||
getAndCreatePaths(PathType::Launcher_Directory, applicationDir);
|
||||
CString applicationPath = applicationDir + "interface\\interface.exe";
|
||||
BOOL isApplicationInstalled = PathFileExistsW(applicationPath);
|
||||
BOOL isInstalled = PathFileExistsW(applicationPath);
|
||||
BOOL configFileExist = PathFileExistsW(applicationDir + _T("interface\\config.json"));
|
||||
if (configFileExist) {
|
||||
LauncherUtils::ResponseError status = readConfigJSON(version, domain, content, loggedIn);
|
||||
return isApplicationInstalled && status == LauncherUtils::ResponseError::NoError;
|
||||
return isInstalled && status == LauncherUtils::ResponseError::NoError;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -359,14 +372,23 @@ LauncherUtils::ResponseError LauncherManager::readOrganizationJSON(const CString
|
|||
return LauncherUtils::ResponseError::ParsingJSON;
|
||||
}
|
||||
|
||||
void LauncherManager::getMostRecentBuild(CString& urlOut, CString& versionOut) {
|
||||
void LauncherManager::getMostRecentBuilds(CString& launcherUrlOut, CString& launcherVersionOut,
|
||||
CString& interfaceUrlOut, CString& interfaceVersionOut) {
|
||||
CString contentTypeJson = L"content-type:application/json";
|
||||
std::function<void(CString, int)> httpCallback = [&](CString response, int err) {
|
||||
LauncherUtils::ResponseError error = LauncherUtils::ResponseError(err);
|
||||
if (error == LauncherUtils::ResponseError::NoError) {
|
||||
Json::Value json;
|
||||
error = LauncherUtils::ResponseError::ParsingJSON;
|
||||
if (LauncherUtils::parseJSON(response, json)) {
|
||||
if (json["launcher"].isObject()) {
|
||||
if (json["launcher"]["windows"].isObject() && json["launcher"]["windows"]["url"].isString()) {
|
||||
launcherUrlOut = json["launcher"]["windows"]["url"].asCString();
|
||||
}
|
||||
if (json["launcher"]["version"].isInt()) {
|
||||
std::string version = std::to_string(json["launcher"]["version"].asInt());
|
||||
launcherVersionOut = CString(version.c_str());
|
||||
}
|
||||
}
|
||||
int count = json["count"].isInt() ? json["count"].asInt() : 0;
|
||||
if (count > 0 && json["results"].isArray()) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
@ -374,19 +396,21 @@ void LauncherManager::getMostRecentBuild(CString& urlOut, CString& versionOut) {
|
|||
Json::Value result = json["results"][i];
|
||||
if (result["latest_version"].isInt()) {
|
||||
std::string version = std::to_string(result["latest_version"].asInt());
|
||||
versionOut = CString(version.c_str());
|
||||
interfaceVersionOut = CString(version.c_str());
|
||||
}
|
||||
if (result["installers"].isObject() &&
|
||||
result["installers"]["windows"].isObject() &&
|
||||
result["installers"]["windows"]["zip_url"].isString()) {
|
||||
urlOut = result["installers"]["windows"]["zip_url"].asCString();
|
||||
error = LauncherUtils::ResponseError::NoError;
|
||||
interfaceUrlOut = result["installers"]["windows"]["zip_url"].asCString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (launcherUrlOut.IsEmpty() || launcherVersionOut.IsEmpty() || interfaceUrlOut.IsEmpty() || interfaceVersionOut.IsEmpty()) {
|
||||
error = LauncherUtils::ResponseError::ParsingJSON;
|
||||
}
|
||||
}
|
||||
onMostRecentBuildReceived(response, error);
|
||||
onMostRecentBuildsReceived(response, error);
|
||||
}
|
||||
};
|
||||
LauncherUtils::httpCallOnThread(L"HQ Launcher",
|
||||
|
@ -395,31 +419,49 @@ void LauncherManager::getMostRecentBuild(CString& urlOut, CString& versionOut) {
|
|||
contentTypeJson, CStringA(), false, httpCallback);
|
||||
}
|
||||
|
||||
void LauncherManager::onMostRecentBuildReceived(const CString& response, LauncherUtils::ResponseError error) {
|
||||
void LauncherManager::onMostRecentBuildsReceived(const CString& response, LauncherUtils::ResponseError error) {
|
||||
if (error == LauncherUtils::ResponseError::NoError) {
|
||||
addToLog(_T("Latest version: ") + _latestVersion);
|
||||
addToLog(_T("Latest launcher version: ") + _latestLauncherVersion);
|
||||
CString currentVersion;
|
||||
if (isApplicationInstalled(currentVersion, _domainURL, _contentURL, _loggedIn) && _loggedIn) {
|
||||
addToLog(_T("Installed version: ") + currentVersion);
|
||||
if (_latestVersion.Compare(currentVersion) == 0) {
|
||||
addToLog(_T("Already running most recent build. Launching interface.exe"));
|
||||
_shouldLaunch = TRUE;
|
||||
_shouldShutdown = TRUE;
|
||||
} else {
|
||||
addToLog(_T("New build found. Updating"));
|
||||
_shouldUpdate = TRUE;
|
||||
}
|
||||
} else if (_loggedIn) {
|
||||
addToLog(_T("Interface not found but logged in. Reinstalling"));
|
||||
_shouldUpdate = TRUE;
|
||||
BOOL isInstalled = (isApplicationInstalled(currentVersion, _domainURL, _contentURL, _loggedIn) && _loggedIn);
|
||||
bool newInterfaceVersion = _latestVersion.Compare(currentVersion) != 0;
|
||||
bool newLauncherVersion = _latestLauncherVersion.Compare(_launcherVersion) != 0 && _updateLauncherAllowed;
|
||||
if (newLauncherVersion) {
|
||||
CString updatingMsg;
|
||||
updatingMsg.Format(_T("Updating Launcher from version: %s to version: %s"), _launcherVersion, _latestLauncherVersion);
|
||||
addToLog(updatingMsg);
|
||||
_shouldUpdateLauncher = TRUE;
|
||||
_shouldDownloadLauncher = TRUE;
|
||||
_willContinueUpdating = isInstalled && newInterfaceVersion;
|
||||
} else {
|
||||
_shouldInstall = TRUE;
|
||||
if (_updateLauncherAllowed) {
|
||||
addToLog(_T("Already running most recent build. Launching interface.exe"));
|
||||
} else {
|
||||
addToLog(_T("Updating the launcher was not allowed --noUpdate"));
|
||||
}
|
||||
if (isInstalled) {
|
||||
addToLog(_T("Installed version: ") + currentVersion);
|
||||
if (!newInterfaceVersion) {
|
||||
addToLog(_T("Already running most recent build. Launching interface.exe"));
|
||||
_shouldLaunch = TRUE;
|
||||
_shouldShutdown = TRUE;
|
||||
} else {
|
||||
addToLog(_T("New build found. Updating"));
|
||||
_shouldUpdate = TRUE;
|
||||
}
|
||||
} else if (_loggedIn) {
|
||||
addToLog(_T("Interface not found but logged in. Reinstalling"));
|
||||
_shouldUpdate = TRUE;
|
||||
} else {
|
||||
_shouldInstall = TRUE;
|
||||
}
|
||||
}
|
||||
_shouldWait = FALSE;
|
||||
|
||||
} else {
|
||||
_hasFailed = true;
|
||||
CString msg;
|
||||
msg.Format(_T("Getting most recent build has failed with error: %d"), error);
|
||||
msg.Format(_T("Getting most recent builds has failed with error: %d"), error);
|
||||
addToLog(msg);
|
||||
msg.Format(_T("Response: %s"), response);
|
||||
addToLog(msg);
|
||||
|
@ -521,7 +563,7 @@ BOOL LauncherManager::extractApplication() {
|
|||
}
|
||||
};
|
||||
std::function<void(float)> onProgress = [&](float progress) {
|
||||
updateProgress(ProcessType::UnzipApplication, progress);
|
||||
updateProgress(ProcessType::UnzipApplication, max(progress, 0.0f));
|
||||
};
|
||||
_currentProcess = ProcessType::UnzipApplication;
|
||||
BOOL success = LauncherUtils::unzipFileOnThread(ProcessType::UnzipApplication,
|
||||
|
@ -563,9 +605,21 @@ void LauncherManager::onFileDownloaded(ProcessType type) {
|
|||
setFailed(true);
|
||||
}
|
||||
});
|
||||
} else if (type == ProcessType::DownloadLauncher) {
|
||||
_shouldRestartNewLauncher = true;
|
||||
}
|
||||
}
|
||||
|
||||
void LauncherManager::restartNewLauncher() {
|
||||
closeLog();
|
||||
if (_willContinueUpdating) {
|
||||
LauncherUtils::launchApplication(_tempLauncherPath, _T(" --restart --noUpdate --continueUpdating"));
|
||||
} else {
|
||||
LauncherUtils::launchApplication(_tempLauncherPath, _T(" --restart --noUpdate --skipSplash"));
|
||||
}
|
||||
Sleep(500);
|
||||
}
|
||||
|
||||
|
||||
BOOL LauncherManager::installContent() {
|
||||
std::string contentZipFile = LauncherUtils::cStringToStd(_contentZipPath);
|
||||
|
@ -582,7 +636,7 @@ BOOL LauncherManager::installContent() {
|
|||
}
|
||||
};
|
||||
std::function<void(float)> onProgress = [&](float progress) {
|
||||
updateProgress(ProcessType::UnzipContent, progress);
|
||||
updateProgress(ProcessType::UnzipContent, max(progress, 0.0f));
|
||||
};
|
||||
_currentProcess = ProcessType::UnzipContent;
|
||||
BOOL success = LauncherUtils::unzipFileOnThread(ProcessType::UnzipContent, contentZipFile,
|
||||
|
@ -597,10 +651,13 @@ BOOL LauncherManager::installContent() {
|
|||
|
||||
|
||||
BOOL LauncherManager::downloadFile(ProcessType type, const CString& url, CString& outPath) {
|
||||
CString fileName = url.Mid(url.ReverseFind('/') + 1);
|
||||
CString downloadDirectory;
|
||||
BOOL success = getAndCreatePaths(LauncherManager::PathType::Download_Directory, downloadDirectory);
|
||||
outPath = downloadDirectory + fileName;
|
||||
BOOL success = TRUE;
|
||||
if (outPath.IsEmpty()) {
|
||||
CString fileName = url.Mid(url.ReverseFind('/') + 1);
|
||||
CString downloadDirectory;
|
||||
BOOL success = getAndCreatePaths(LauncherManager::PathType::Download_Directory, downloadDirectory);
|
||||
outPath = downloadDirectory + fileName;
|
||||
}
|
||||
_currentProcess = type;
|
||||
if (success) {
|
||||
addToLog(_T("Downloading: ") + url);
|
||||
|
@ -610,18 +667,18 @@ BOOL LauncherManager::downloadFile(ProcessType type, const CString& url, CString
|
|||
} else {
|
||||
if (type == ProcessType::DownloadApplication) {
|
||||
addToLog(_T("Error downloading content."));
|
||||
} else if (type == ProcessType::DownloadLauncher) {
|
||||
addToLog(_T("Error downloading launcher."));
|
||||
} else {
|
||||
addToLog(_T("Error downloading application."));
|
||||
}
|
||||
_hasFailed = true;
|
||||
}
|
||||
};
|
||||
std::function<void(float)> onProgress = [&](float progress) {
|
||||
updateProgress(_currentProcess, progress);
|
||||
std::function<void(float)> onProgress = [&, type](float progress) {
|
||||
updateProgress(_currentProcess, max(progress, 0.0f));
|
||||
};
|
||||
if (!LauncherUtils::downloadFileOnThread(type, url, outPath, onDownloadFinished, onProgress)) {
|
||||
success = FALSE;
|
||||
}
|
||||
success = LauncherUtils::downloadFileOnThread(type, url, outPath, onDownloadFinished, onProgress);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
@ -637,6 +694,14 @@ BOOL LauncherManager::downloadApplication() {
|
|||
return downloadFile(ProcessType::DownloadApplication, applicationURL, _applicationZipPath);
|
||||
}
|
||||
|
||||
BOOL LauncherManager::downloadNewLauncher() {
|
||||
_shouldDownloadLauncher = FALSE;
|
||||
getAndCreatePaths(PathType::Temp_Directory, _tempLauncherPath);
|
||||
CString tempName = _T("HQLauncher") + _launcherVersion + _T(".exe");
|
||||
_tempLauncherPath += tempName;
|
||||
return downloadFile(ProcessType::DownloadLauncher, _latestLauncherURL, _tempLauncherPath);
|
||||
}
|
||||
|
||||
void LauncherManager::onCancel() {
|
||||
if (_currentProcess == ProcessType::UnzipApplication) {
|
||||
_latestVersion = _T("");
|
||||
|
|
|
@ -25,6 +25,7 @@ const float DOWNLOAD_APPLICATION_INSTALL_WEIGHT = 0.5f;
|
|||
const float EXTRACT_APPLICATION_INSTALL_WEIGHT = 0.2f;
|
||||
const float DOWNLOAD_APPLICATION_UPDATE_WEIGHT = 0.75f;
|
||||
const float EXTRACT_APPLICATION_UPDATE_WEIGHT = 0.25f;
|
||||
const float CONTINUE_UPDATING_GLOBAL_OFFSET = 0.2f;
|
||||
|
||||
class LauncherManager
|
||||
{
|
||||
|
@ -49,6 +50,7 @@ public:
|
|||
ErrorIOFiles
|
||||
};
|
||||
enum ProcessType {
|
||||
DownloadLauncher = 0,
|
||||
DownloadContent,
|
||||
DownloadApplication,
|
||||
UnzipContent,
|
||||
|
@ -57,7 +59,7 @@ public:
|
|||
};
|
||||
LauncherManager();
|
||||
~LauncherManager();
|
||||
void init();
|
||||
void init(BOOL allowUpdate, BOOL continueUpdating, BOOL skipSplashScreen);
|
||||
BOOL initLog();
|
||||
BOOL addToLog(const CString& line);
|
||||
void closeLog();
|
||||
|
@ -67,7 +69,8 @@ public:
|
|||
BOOL isApplicationInstalled(CString& version, CString& domain,
|
||||
CString& content, bool& loggedIn);
|
||||
LauncherUtils::ResponseError getAccessTokenForCredentials(const CString& username, const CString& password);
|
||||
void getMostRecentBuild(CString& urlOut, CString& versionOut);
|
||||
void getMostRecentBuilds(CString& launcherUrlOut, CString& launcherVersionOut,
|
||||
CString& interfaceUrlOut, CString& interfaceVersionOut);
|
||||
LauncherUtils::ResponseError readOrganizationJSON(const CString& hash);
|
||||
LauncherUtils::ResponseError readConfigJSON(CString& version, CString& domain,
|
||||
CString& content, bool& loggedIn);
|
||||
|
@ -87,13 +90,19 @@ public:
|
|||
const CString& getVersion() const { return _version; }
|
||||
BOOL shouldShutDown() const { return _shouldShutdown; }
|
||||
BOOL shouldLaunch() const { return _shouldLaunch; }
|
||||
BOOL needsUpdate() { return _shouldUpdate; }
|
||||
BOOL needsUninstall() { return _shouldUninstall; }
|
||||
BOOL needsInstall() { return _shouldInstall; }
|
||||
BOOL needsToWait() { return _shouldWait; }
|
||||
BOOL shouldSkipSplashScreen() const { return _skipSplashScreen; }
|
||||
BOOL needsUpdate() const { return _shouldUpdate; }
|
||||
BOOL needsSelfUpdate() const { return _shouldUpdateLauncher; }
|
||||
BOOL needsSelfDownload() const { return _shouldDownloadLauncher; }
|
||||
BOOL needsUninstall() const { return _shouldUninstall; }
|
||||
BOOL needsInstall() const { return _shouldInstall; }
|
||||
BOOL needsToWait() const { return _shouldWait; }
|
||||
BOOL needsRestartNewLauncher() const { return _shouldRestartNewLauncher; }
|
||||
BOOL shouldContinueUpdating() const { return _continueUpdating; }
|
||||
BOOL willContinueUpdating() const { return _willContinueUpdating; }
|
||||
void setDisplayName(const CString& displayName) { _displayName = displayName; }
|
||||
bool isLoggedIn() { return _loggedIn; }
|
||||
bool hasFailed() { return _hasFailed; }
|
||||
bool isLoggedIn() const { return _loggedIn; }
|
||||
bool hasFailed() const { return _hasFailed; }
|
||||
void setFailed(bool hasFailed) { _hasFailed = hasFailed; }
|
||||
const CString& getLatestInterfaceURL() const { return _latestApplicationURL; }
|
||||
void uninstall() { _shouldUninstall = true; _shouldWait = false; };
|
||||
|
@ -101,19 +110,24 @@ public:
|
|||
BOOL downloadFile(ProcessType type, const CString& url, CString& localPath);
|
||||
BOOL downloadContent();
|
||||
BOOL downloadApplication();
|
||||
BOOL downloadNewLauncher();
|
||||
BOOL installContent();
|
||||
BOOL extractApplication();
|
||||
void restartNewLauncher();
|
||||
void onZipExtracted(ProcessType type, int size);
|
||||
void onFileDownloaded(ProcessType type);
|
||||
float getProgress() { return _progress; }
|
||||
float getProgress() const { return _progress; }
|
||||
void updateProgress(ProcessType processType, float progress);
|
||||
void onCancel();
|
||||
const CString& getLauncherVersion() const { return _launcherVersion; }
|
||||
|
||||
private:
|
||||
ProcessType _currentProcess { ProcessType::DownloadApplication };
|
||||
void onMostRecentBuildReceived(const CString& response, LauncherUtils::ResponseError error);
|
||||
void onMostRecentBuildsReceived(const CString& response, LauncherUtils::ResponseError error);
|
||||
CString _latestApplicationURL;
|
||||
CString _latestVersion;
|
||||
CString _latestLauncherURL;
|
||||
CString _latestLauncherVersion;
|
||||
CString _contentURL;
|
||||
CString _domainURL;
|
||||
CString _version;
|
||||
|
@ -121,6 +135,8 @@ private:
|
|||
CString _tokensJSON;
|
||||
CString _applicationZipPath;
|
||||
CString _contentZipPath;
|
||||
CString _launcherVersion;
|
||||
CString _tempLauncherPath;
|
||||
bool _loggedIn { false };
|
||||
bool _hasFailed { false };
|
||||
BOOL _shouldUpdate { FALSE };
|
||||
|
@ -129,6 +145,14 @@ private:
|
|||
BOOL _shouldShutdown { FALSE };
|
||||
BOOL _shouldLaunch { FALSE };
|
||||
BOOL _shouldWait { TRUE };
|
||||
BOOL _shouldUpdateLauncher { FALSE };
|
||||
BOOL _shouldDownloadLauncher { FALSE };
|
||||
BOOL _updateLauncherAllowed { TRUE };
|
||||
BOOL _shouldRestartNewLauncher { FALSE };
|
||||
BOOL _continueUpdating { FALSE };
|
||||
BOOL _willContinueUpdating { FALSE };
|
||||
BOOL _skipSplashScreen { FALSE };
|
||||
float _progressOffset { 0.0f };
|
||||
float _progress { 0.0f };
|
||||
CStdioFile _logFile;
|
||||
};
|
||||
|
|
45
launchers/win32/cmake/macros/SetPackagingParameters.cmake
Normal file
45
launchers/win32/cmake/macros/SetPackagingParameters.cmake
Normal file
|
@ -0,0 +1,45 @@
|
|||
#
|
||||
# SetPackagingParameters.cmake
|
||||
# cmake/macros
|
||||
#
|
||||
# Created by Leonardo Murillo on 07/14/2015.
|
||||
# Copyright 2015 High Fidelity, Inc.
|
||||
#
|
||||
# Distributed under the Apache License, Version 2.0.
|
||||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
# This macro checks some Jenkins defined environment variables to determine the origin of this build
|
||||
# and decides how targets should be packaged.
|
||||
|
||||
macro(SET_PACKAGING_PARAMETERS)
|
||||
set(PR_BUILD 0)
|
||||
set(PRODUCTION_BUILD 0)
|
||||
set(DEV_BUILD 0)
|
||||
set(BUILD_NUMBER 0)
|
||||
|
||||
set_from_env(RELEASE_TYPE RELEASE_TYPE "DEV")
|
||||
set_from_env(RELEASE_NUMBER RELEASE_NUMBER "")
|
||||
set_from_env(STABLE_BUILD STABLE_BUILD 0)
|
||||
|
||||
message(STATUS "The RELEASE_TYPE variable is: ${RELEASE_TYPE}")
|
||||
set(BUILD_NUMBER ${RELEASE_NUMBER})
|
||||
|
||||
if (RELEASE_TYPE STREQUAL "PRODUCTION")
|
||||
set(PRODUCTION_BUILD 1)
|
||||
set(BUILD_VERSION ${RELEASE_NUMBER})
|
||||
|
||||
# add definition for this release type
|
||||
add_definitions(-DPRODUCTION_BUILD)
|
||||
|
||||
elseif (RELEASE_TYPE STREQUAL "PR")
|
||||
set(PR_BUILD 1)
|
||||
set(BUILD_VERSION "PR${RELEASE_NUMBER}")
|
||||
|
||||
# add definition for this release type
|
||||
add_definitions(-DPR_BUILD)
|
||||
else ()
|
||||
set(DEV_BUILD 1)
|
||||
set(BUILD_VERSION "dev")
|
||||
endif ()
|
||||
|
||||
endmacro(SET_PACKAGING_PARAMETERS)
|
|
@ -27,6 +27,7 @@
|
|||
#define IDC_TROUBLE 1023
|
||||
#define IDC_VOXEL 1024
|
||||
#define IDC_PROGRESS 1025
|
||||
#define IDC_VERSION 1026
|
||||
#define IDC_TROUBLE_LINK 1027
|
||||
|
||||
// Next default values for new objects
|
||||
|
|
|
@ -1873,6 +1873,61 @@ void Rig::updateFeet(bool leftFootEnabled, bool rightFootEnabled, bool headEnabl
|
|||
}
|
||||
}
|
||||
|
||||
void Rig::updateReactions(const ControllerParameters& params) {
|
||||
|
||||
// enable/disable animVars
|
||||
bool enabled = params.reactionEnabledFlags[AVATAR_REACTION_POSITIVE];
|
||||
_animVars.set("reactionPositiveEnabled", enabled);
|
||||
_animVars.set("reactionPositiveDisabled", !enabled);
|
||||
|
||||
enabled = params.reactionEnabledFlags[AVATAR_REACTION_NEGATIVE];
|
||||
_animVars.set("reactionNegativeEnabled", enabled);
|
||||
_animVars.set("reactionNegativeDisabled", !enabled);
|
||||
|
||||
enabled = params.reactionEnabledFlags[AVATAR_REACTION_RAISE_HAND];
|
||||
_animVars.set("reactionRaiseHandEnabled", enabled);
|
||||
_animVars.set("reactionRaiseHandDisabled", !enabled);
|
||||
|
||||
enabled = params.reactionEnabledFlags[AVATAR_REACTION_APPLAUD];
|
||||
_animVars.set("reactionApplaudEnabled", enabled);
|
||||
_animVars.set("reactionApplaudDisabled", !enabled);
|
||||
|
||||
enabled = params.reactionEnabledFlags[AVATAR_REACTION_POINT];
|
||||
_animVars.set("reactionPointEnabled", enabled);
|
||||
_animVars.set("reactionPointDisabled", !enabled);
|
||||
|
||||
// trigger animVars
|
||||
if (params.reactionTriggers[AVATAR_REACTION_POSITIVE]) {
|
||||
_animVars.set("reactionPositiveTrigger", true);
|
||||
} else {
|
||||
_animVars.set("reactionPositiveTrigger", false);
|
||||
}
|
||||
|
||||
if (params.reactionTriggers[AVATAR_REACTION_NEGATIVE]) {
|
||||
_animVars.set("reactionNegativeTrigger", true);
|
||||
} else {
|
||||
_animVars.set("reactionNegativeTrigger", false);
|
||||
}
|
||||
|
||||
if (params.reactionTriggers[AVATAR_REACTION_RAISE_HAND]) {
|
||||
_animVars.set("reactionRaiseHandTrigger", true);
|
||||
} else {
|
||||
_animVars.set("reactionRaiseHandTrigger", false);
|
||||
}
|
||||
|
||||
if (params.reactionTriggers[AVATAR_REACTION_APPLAUD]) {
|
||||
_animVars.set("reactionApplaudTrigger", true);
|
||||
} else {
|
||||
_animVars.set("reactionApplaudTrigger", false);
|
||||
}
|
||||
|
||||
if (params.reactionTriggers[AVATAR_REACTION_POINT]) {
|
||||
_animVars.set("reactionPointTrigger", true);
|
||||
} else {
|
||||
_animVars.set("reactionPointTrigger", false);
|
||||
}
|
||||
}
|
||||
|
||||
void Rig::updateEyeJoint(int index, const glm::vec3& modelTranslation, const glm::quat& modelRotation, const glm::vec3& lookAtSpot, const glm::vec3& saccade) {
|
||||
|
||||
// TODO: does not properly handle avatar scale.
|
||||
|
@ -2152,6 +2207,8 @@ void Rig::updateFromControllerParameters(const ControllerParameters& params, flo
|
|||
}
|
||||
}
|
||||
|
||||
updateReactions(params);
|
||||
|
||||
_previousControllerParameters = params;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,6 +88,8 @@ public:
|
|||
AnimPose secondaryControllerPoses[NumSecondaryControllerTypes]; // rig space
|
||||
uint8_t secondaryControllerFlags[NumSecondaryControllerTypes];
|
||||
bool isTalking;
|
||||
bool reactionEnabledFlags[NUM_AVATAR_REACTIONS];
|
||||
bool reactionTriggers[NUM_AVATAR_REACTIONS];
|
||||
HFMJointShapeInfo hipsShapeInfo;
|
||||
HFMJointShapeInfo spineShapeInfo;
|
||||
HFMJointShapeInfo spine1ShapeInfo;
|
||||
|
@ -268,6 +270,7 @@ protected:
|
|||
void updateFeet(bool leftFootEnabled, bool rightFootEnabled, bool headEnabled,
|
||||
const AnimPose& leftFootPose, const AnimPose& rightFootPose,
|
||||
const glm::mat4& rigToSensorMatrix, const glm::mat4& sensorToRigMatrix);
|
||||
void updateReactions(const ControllerParameters& params);
|
||||
|
||||
void updateEyeJoint(int index, const glm::vec3& modelTranslation, const glm::quat& modelRotation, const glm::vec3& lookAt, const glm::vec3& saccade);
|
||||
void calcAnimAlpha(float speed, const std::vector<float>& referenceSpeeds, float* alphaOut) const;
|
||||
|
|
|
@ -40,6 +40,8 @@ const Element Element::COLOR_COMPRESSED_EAC_RED_SIGNED { TILE4x4, COMPRESSED, CO
|
|||
const Element Element::COLOR_COMPRESSED_EAC_XY { TILE4x4, COMPRESSED, COMPRESSED_EAC_XY };
|
||||
const Element Element::COLOR_COMPRESSED_EAC_XY_SIGNED { TILE4x4, COMPRESSED, COMPRESSED_EAC_XY_SIGNED };
|
||||
|
||||
const Element Element::DEPTH24_STENCIL8 { SCALAR, UINT32, DEPTH_STENCIL };
|
||||
|
||||
const Element Element::VEC2NU8_XY{ VEC2, NUINT8, XY };
|
||||
|
||||
const Element Element::COLOR_R11G11B10{ SCALAR, FLOAT, R11G11B10 };
|
||||
|
|
|
@ -358,6 +358,7 @@ public:
|
|||
static const Element COLOR_COMPRESSED_EAC_RED_SIGNED;
|
||||
static const Element COLOR_COMPRESSED_EAC_XY;
|
||||
static const Element COLOR_COMPRESSED_EAC_XY_SIGNED;
|
||||
static const Element DEPTH24_STENCIL8;
|
||||
static const Element VEC2NU8_XY;
|
||||
static const Element VEC4F_COLOR_RGBA;
|
||||
static const Element VEC2F_UV;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "UserActivityLogger.h"
|
||||
#include "udt/PacketHeaders.h"
|
||||
|
||||
const QString DEFAULT_HIFI_ADDRESS = "hifi://welcome";
|
||||
const QString DEFAULT_HIFI_ADDRESS = "file:///~/serverless/tutorial.json";
|
||||
const QString DEFAULT_HOME_ADDRESS = "file:///~/serverless/tutorial.json";
|
||||
const QString REDIRECT_HIFI_ADDRESS = "file:///~/serverless/redirect.json";
|
||||
const QString ADDRESS_MANAGER_SETTINGS_GROUP = "AddressManager";
|
||||
|
|
|
@ -107,7 +107,8 @@ void Instance::enumerateNics() {
|
|||
|
||||
json Instance::getCPU(int index) {
|
||||
assert(index <(int) _cpus.size());
|
||||
if (index >= (int)_cpus.size())
|
||||
|
||||
if (index < 0 || (int) _cpus.size() <= index)
|
||||
return json();
|
||||
|
||||
return _cpus.at(index);
|
||||
|
@ -116,7 +117,7 @@ json Instance::getCPU(int index) {
|
|||
json Instance::getGPU(int index) {
|
||||
assert(index <(int) _gpus.size());
|
||||
|
||||
if (index >=(int) _gpus.size())
|
||||
if (index < 0 || (int) _gpus.size() <= index)
|
||||
return json();
|
||||
|
||||
return _gpus.at(index);
|
||||
|
@ -126,7 +127,7 @@ json Instance::getGPU(int index) {
|
|||
json Instance::getDisplay(int index) {
|
||||
assert(index <(int) _displays.size());
|
||||
|
||||
if (index >=(int) _displays.size())
|
||||
if (index < 0 || (int) _displays.size() <= index)
|
||||
return json();
|
||||
|
||||
return _displays.at(index);
|
||||
|
|
|
@ -44,10 +44,10 @@ using namespace render;
|
|||
static void loadLightProgram(int programId, bool lightVolume, gpu::PipelinePointer& program);
|
||||
|
||||
void DeferredLightingEffect::init() {
|
||||
loadLightProgram(shader::render_utils::program::directional_ambient_light, false, _directionalAmbientSphereLight);
|
||||
loadLightProgram(shader::render_utils::program::directional_skybox_light_ambient, false, _directionalAmbientSphereLight);
|
||||
loadLightProgram(shader::render_utils::program::directional_skybox_light, false, _directionalSkyboxLight);
|
||||
|
||||
loadLightProgram(shader::render_utils::program::directional_ambient_light_shadow, false, _directionalAmbientSphereLightShadow);
|
||||
loadLightProgram(shader::render_utils::program::directional_skybox_light_ambient_shadow, false, _directionalAmbientSphereLightShadow);
|
||||
loadLightProgram(shader::render_utils::program::directional_skybox_light_shadow, false, _directionalSkyboxLightShadow);
|
||||
|
||||
loadLightProgram(shader::render_utils::program::local_lights_shading, true, _localLight);
|
||||
|
|
|
@ -38,7 +38,7 @@ void FramebufferCache::createPrimaryFramebuffer() {
|
|||
gpu::FramebufferPointer FramebufferCache::getFramebuffer() {
|
||||
std::unique_lock<std::mutex> lock(_mutex);
|
||||
if (_cachedFramebuffers.empty()) {
|
||||
_cachedFramebuffers.push_back(gpu::FramebufferPointer(gpu::Framebuffer::create("cached", gpu::Element::COLOR_SRGBA_32, _frameBufferSize.width(), _frameBufferSize.height())));
|
||||
_cachedFramebuffers.push_back(gpu::FramebufferPointer(gpu::Framebuffer::create("cached", gpu::Element::COLOR_SRGBA_32, gpu::Element::DEPTH24_STENCIL8, _frameBufferSize.width(), _frameBufferSize.height())));
|
||||
}
|
||||
gpu::FramebufferPointer result = _cachedFramebuffers.front();
|
||||
_cachedFramebuffers.pop_front();
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// directional_ambient_light.frag
|
||||
// fragment shader
|
||||
//
|
||||
// Created by Andrzej Kapolka on 9/3/14.
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
<@include DeferredBufferRead.slh@>
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
<@include GlobalLight.slh@>
|
||||
<$declareEvalAmbientSphereGlobalColor(supportScattering)$>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
||||
#define _texCoord0 _texCoord01.xy
|
||||
#define _texCoord1 _texCoord01.zw
|
||||
layout(location=0) out vec4 _fragColor;
|
||||
|
||||
void main(void) {
|
||||
DeferredFrameTransform deferredTransform = getDeferredFrameTransform();
|
||||
DeferredFragment frag = unpackDeferredFragment(deferredTransform, _texCoord0);
|
||||
|
||||
float shadowAttenuation = 1.0;
|
||||
|
||||
if (frag.mode == FRAG_MODE_UNLIT || frag.mode == FRAG_MODE_LIGHTMAPPED) {
|
||||
discard;
|
||||
} else {
|
||||
vec4 midNormalCurvature = vec4(0);
|
||||
vec4 lowNormalCurvature = vec4(0);
|
||||
unpackMidLowNormalCurvature(_texCoord0, midNormalCurvature, lowNormalCurvature);
|
||||
float check = float(frag.mode == FRAG_MODE_SCATTERING);
|
||||
midNormalCurvature = check * midNormalCurvature;
|
||||
lowNormalCurvature = check * lowNormalCurvature;
|
||||
|
||||
vec3 color = evalAmbientSphereGlobalColor(
|
||||
getViewInverse(),
|
||||
shadowAttenuation,
|
||||
frag.obscurance,
|
||||
frag.position.xyz,
|
||||
frag.normal,
|
||||
frag.albedo,
|
||||
frag.fresnel,
|
||||
frag.metallic,
|
||||
frag.roughness,
|
||||
frag.scattering,
|
||||
midNormalCurvature,
|
||||
lowNormalCurvature);
|
||||
_fragColor = vec4(color, 1.0);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// directional_ambient_light_shadow.frag
|
||||
// fragment shader
|
||||
//
|
||||
// Created by Zach Pomerantz on 1/18/2016.
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
<@include DeferredBufferRead.slh@>
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
<@include GlobalLight.slh@>
|
||||
<$declareEvalAmbientSphereGlobalColor(isScattering)$>
|
||||
|
||||
<@include Shadow.slh@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
||||
#define _texCoord0 _texCoord01.xy
|
||||
#define _texCoord1 _texCoord01.zw
|
||||
layout(location=0) out vec4 _fragColor;
|
||||
|
||||
void main(void) {
|
||||
DeferredFrameTransform deferredTransform = getDeferredFrameTransform();
|
||||
DeferredFragment frag = unpackDeferredFragment(deferredTransform, _texCoord0);
|
||||
|
||||
vec4 viewPos = vec4(frag.position.xyz, 1.0);
|
||||
vec4 worldPos = getViewInverse() * viewPos;
|
||||
Light shadowLight = getKeyLight();
|
||||
vec3 worldLightDirection = getLightDirection(shadowLight);
|
||||
float shadowAttenuation = evalShadowAttenuation(worldLightDirection, worldPos, -viewPos.z, frag.normal);
|
||||
|
||||
if (frag.mode == FRAG_MODE_UNLIT || frag.mode == FRAG_MODE_LIGHTMAPPED) {
|
||||
discard;
|
||||
} else {
|
||||
vec4 midNormalCurvature = vec4(0);
|
||||
vec4 lowNormalCurvature = vec4(0);
|
||||
unpackMidLowNormalCurvature(_texCoord0, midNormalCurvature, lowNormalCurvature);
|
||||
float check = float(frag.mode == FRAG_MODE_SCATTERING);
|
||||
midNormalCurvature = check * midNormalCurvature;
|
||||
lowNormalCurvature = check * lowNormalCurvature;
|
||||
|
||||
vec3 color = evalAmbientSphereGlobalColor(
|
||||
getViewInverse(),
|
||||
shadowAttenuation,
|
||||
frag.obscurance,
|
||||
frag.position.xyz,
|
||||
frag.normal,
|
||||
frag.albedo,
|
||||
frag.fresnel,
|
||||
frag.metallic,
|
||||
frag.roughness,
|
||||
frag.scattering,
|
||||
midNormalCurvature,
|
||||
lowNormalCurvature);
|
||||
|
||||
_fragColor = vec4(color, 1.0);
|
||||
}
|
||||
}
|
|
@ -1,10 +1,8 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// <$_SCRIBE_FILENAME$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// directional_skybox_light.frag
|
||||
// fragment shader
|
||||
//
|
||||
// Created by Sam Gateau on 5/8/2015.
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
|
@ -15,20 +13,36 @@
|
|||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
<@include GlobalLight.slh@>
|
||||
<$declareEvalSkyboxGlobalColor(isScattering, _SCRIBE_NULL)$>
|
||||
<@if HIFI_USE_AMBIENT@>
|
||||
<$declareEvalAmbientSphereGlobalColor(supportScattering)$>
|
||||
<@else@>
|
||||
<$declareEvalSkyboxGlobalColor(supportScattering, _SCRIBE_NULL)$>
|
||||
<@endif@>
|
||||
|
||||
<@if HIFI_USE_SHADOW@>
|
||||
<@include Shadow.slh@>
|
||||
<@endif@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
||||
#define _texCoord0 _texCoord01.xy
|
||||
#define _texCoord1 _texCoord01.zw
|
||||
|
||||
layout(location=0) out vec4 _fragColor;
|
||||
|
||||
void main(void) {
|
||||
DeferredFrameTransform deferredTransform = getDeferredFrameTransform();
|
||||
DeferredFragment frag = unpackDeferredFragment(deferredTransform, _texCoord0);
|
||||
|
||||
<@if HIFI_USE_SHADOW@>
|
||||
vec4 viewPos = vec4(frag.position.xyz, 1.0);
|
||||
vec4 worldPos = getViewInverse() * viewPos;
|
||||
Light shadowLight = getKeyLight();
|
||||
vec3 worldLightDirection = getLightDirection(shadowLight);
|
||||
float shadowAttenuation = evalShadowAttenuation(worldLightDirection, worldPos, -viewPos.z, frag.normal);
|
||||
<@else@>
|
||||
float shadowAttenuation = 1.0;
|
||||
<@endif@>
|
||||
|
||||
// Light mapped or not ?
|
||||
if (frag.mode == FRAG_MODE_UNLIT || frag.mode == FRAG_MODE_LIGHTMAPPED) {
|
||||
discard;
|
||||
} else {
|
||||
|
@ -39,6 +53,21 @@ void main(void) {
|
|||
midNormalCurvature = check * midNormalCurvature;
|
||||
lowNormalCurvature = check * lowNormalCurvature;
|
||||
|
||||
<@if HIFI_USE_AMBIENT@>
|
||||
vec3 color = evalAmbientSphereGlobalColor(
|
||||
getViewInverse(),
|
||||
shadowAttenuation,
|
||||
frag.obscurance,
|
||||
frag.position.xyz,
|
||||
frag.normal,
|
||||
frag.albedo,
|
||||
frag.fresnel,
|
||||
frag.metallic,
|
||||
frag.roughness,
|
||||
frag.scattering,
|
||||
midNormalCurvature,
|
||||
lowNormalCurvature);
|
||||
<@else@>
|
||||
vec3 color = evalSkyboxGlobalColor(
|
||||
getViewInverse(),
|
||||
shadowAttenuation,
|
||||
|
@ -52,6 +81,7 @@ void main(void) {
|
|||
frag.scattering,
|
||||
midNormalCurvature,
|
||||
lowNormalCurvature);
|
||||
<@endif@>
|
||||
|
||||
_fragColor = vec4(color, 1.0);
|
||||
}
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// directional_skybox_light_shadow.frag
|
||||
// fragment shader
|
||||
//
|
||||
// Created by Zach Pomerantz on 1/18/2016.
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//!>
|
||||
<@include DeferredBufferRead.slh@>
|
||||
<@include render-utils/ShaderConstants.h@>
|
||||
|
||||
<@include GlobalLight.slh@>
|
||||
<$declareEvalSkyboxGlobalColor(isScattering, _SCRIBE_NULL)$>
|
||||
|
||||
<@include Shadow.slh@>
|
||||
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
||||
#define _texCoord0 _texCoord01.xy
|
||||
#define _texCoord1 _texCoord01.zw
|
||||
layout(location=0) out vec4 _fragColor;
|
||||
|
||||
void main(void) {
|
||||
DeferredFrameTransform deferredTransform = getDeferredFrameTransform();
|
||||
DeferredFragment frag = unpackDeferredFragment(deferredTransform, _texCoord0);
|
||||
|
||||
vec4 viewPos = vec4(frag.position.xyz, 1.0);
|
||||
vec4 worldPos = getViewInverse() * viewPos;
|
||||
Light shadowLight = getKeyLight();
|
||||
vec3 worldLightDirection = getLightDirection(shadowLight);
|
||||
float shadowAttenuation = evalShadowAttenuation(worldLightDirection, worldPos, -viewPos.z, frag.normal);
|
||||
|
||||
if (frag.mode == FRAG_MODE_UNLIT || frag.mode == FRAG_MODE_LIGHTMAPPED) {
|
||||
discard;
|
||||
} else {
|
||||
vec4 midNormalCurvature = vec4(0);
|
||||
vec4 lowNormalCurvature = vec4(0);
|
||||
unpackMidLowNormalCurvature(_texCoord0, midNormalCurvature, lowNormalCurvature);
|
||||
float check = float(frag.mode == FRAG_MODE_SCATTERING);
|
||||
midNormalCurvature = check * midNormalCurvature;
|
||||
lowNormalCurvature = check * lowNormalCurvature;
|
||||
|
||||
vec3 color = evalSkyboxGlobalColor(
|
||||
getViewInverse(),
|
||||
shadowAttenuation,
|
||||
frag.obscurance,
|
||||
frag.position.xyz,
|
||||
frag.normal,
|
||||
frag.albedo,
|
||||
frag.fresnel,
|
||||
frag.metallic,
|
||||
frag.roughness,
|
||||
frag.scattering,
|
||||
midNormalCurvature,
|
||||
lowNormalCurvature);
|
||||
|
||||
|
||||
_fragColor = vec4(color, 1.0);
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
VERTEX deferred_light
|
|
@ -1 +0,0 @@
|
|||
VERTEX deferred_light
|
|
@ -1 +1,2 @@
|
|||
VERTEX deferred_light
|
||||
DEFINES ambient:f shadow:f
|
|
@ -1 +0,0 @@
|
|||
VERTEX deferred_light
|
|
@ -34,5 +34,9 @@ ScriptAudioInjector::ScriptAudioInjector(const AudioInjectorPointer& injector) :
|
|||
}
|
||||
|
||||
ScriptAudioInjector::~ScriptAudioInjector() {
|
||||
DependencyManager::get<AudioInjectorManager>()->stop(_injector);
|
||||
}
|
||||
const auto audioInjectorManager = DependencyManager::get<AudioInjectorManager>();
|
||||
// AudioInjectorManager may have been destroyed on application shutdown.
|
||||
if (audioInjectorManager) {
|
||||
audioInjectorManager->stop(_injector);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,4 +106,13 @@ static const float AVATAR_WALK_SPEED_SCALAR = 1.0f;
|
|||
static const float AVATAR_DESKTOP_SPRINT_SPEED_SCALAR = 3.0f;
|
||||
static const float AVATAR_HMD_SPRINT_SPEED_SCALAR = 2.0f;
|
||||
|
||||
enum AvatarReaction {
|
||||
AVATAR_REACTION_POSITIVE = 0,
|
||||
AVATAR_REACTION_NEGATIVE,
|
||||
AVATAR_REACTION_RAISE_HAND,
|
||||
AVATAR_REACTION_APPLAUD,
|
||||
AVATAR_REACTION_POINT,
|
||||
NUM_AVATAR_REACTIONS
|
||||
};
|
||||
|
||||
#endif // hifi_AvatarConstants_h
|
||||
|
|
|
@ -82,39 +82,22 @@ std::vector<CPUIdent::Feature> CPUIdent::getAllFeatures() {
|
|||
};
|
||||
|
||||
|
||||
CPUIdent::CPUIdent_Internal::CPUIdent_Internal()
|
||||
: nIds_{ 0 },
|
||||
nExIds_{ 0 },
|
||||
isIntel_{ false },
|
||||
isAMD_{ false },
|
||||
f_1_ECX_{ 0 },
|
||||
f_1_EDX_{ 0 },
|
||||
f_7_EBX_{ 0 },
|
||||
f_7_ECX_{ 0 },
|
||||
f_81_ECX_{ 0 },
|
||||
f_81_EDX_{ 0 },
|
||||
data_{},
|
||||
extdata_{}
|
||||
{
|
||||
CPUIdent::CPUIdent_Internal::CPUIdent_Internal() {
|
||||
//int cpuInfo[4] = {-1};
|
||||
std::array<uint32_t, 4> cpui;
|
||||
uint32_t cpui[4];
|
||||
|
||||
// Calling __cpuid with 0x0 as the function_id argument
|
||||
// gets the number of the highest valid function ID.
|
||||
getCPUID(cpui.data(), 0);
|
||||
getCPUID(cpui, 0);
|
||||
nIds_ = cpui[0];
|
||||
|
||||
for (uint32_t i = 0; i <= nIds_; ++i) {
|
||||
getCPUIDEX(cpui.data(), i, 0);
|
||||
data_.push_back(cpui);
|
||||
}
|
||||
|
||||
// Capture vendor string
|
||||
char vendor[0x20];
|
||||
memset(vendor, 0, sizeof(vendor));
|
||||
*reinterpret_cast<int*>(vendor) = data_[0][1];
|
||||
*reinterpret_cast<int*>(vendor + 4) = data_[0][3];
|
||||
*reinterpret_cast<int*>(vendor + 8) = data_[0][2];
|
||||
getCPUIDEX(cpui, 0, 0);
|
||||
*reinterpret_cast<int*>(vendor) = cpui[1];
|
||||
*reinterpret_cast<int*>(vendor + 4) = cpui[3];
|
||||
*reinterpret_cast<int*>(vendor + 8) = cpui[2];
|
||||
vendor_ = vendor;
|
||||
if (vendor_ == "GenuineIntel") {
|
||||
isIntel_ = true;
|
||||
|
@ -125,40 +108,41 @@ CPUIdent::CPUIdent_Internal::CPUIdent_Internal()
|
|||
|
||||
// load bitset with flags for function 0x00000001
|
||||
if (nIds_ >= 1) {
|
||||
f_1_ECX_ = data_[1][2];
|
||||
f_1_EDX_ = data_[1][3];
|
||||
getCPUIDEX(cpui, 1, 0);
|
||||
f_1_ECX_ = cpui[2];
|
||||
f_1_EDX_ = cpui[3];
|
||||
}
|
||||
|
||||
// load bitset with flags for function 0x00000007
|
||||
if (nIds_ >= 7) {
|
||||
f_7_EBX_ = data_[7][1];
|
||||
f_7_ECX_ = data_[7][2];
|
||||
getCPUIDEX(cpui, 7, 0);
|
||||
f_7_EBX_ = cpui[1];
|
||||
f_7_ECX_ = cpui[2];
|
||||
}
|
||||
|
||||
// Calling __cpuid with 0x80000000 as the function_id argument
|
||||
// gets the number of the highest valid extended ID.
|
||||
getCPUID(cpui.data(), 0x80000000);
|
||||
getCPUID(cpui, 0x80000000);
|
||||
nExIds_ = cpui[0];
|
||||
|
||||
char brand[0x40];
|
||||
memset(brand, 0, sizeof(brand));
|
||||
|
||||
for (uint32_t i = 0x80000000; i <= nExIds_; ++i) {
|
||||
getCPUIDEX(cpui.data(), i, 0);
|
||||
extdata_.push_back(cpui);
|
||||
}
|
||||
|
||||
// load bitset with flags for function 0x80000001
|
||||
if (nExIds_ >= 0x80000001) {
|
||||
f_81_ECX_ = extdata_[1][2];
|
||||
f_81_EDX_ = extdata_[1][3];
|
||||
getCPUIDEX(cpui, 0x80000001, 0);
|
||||
f_81_ECX_ = cpui[2];
|
||||
f_81_EDX_ = cpui[3];
|
||||
}
|
||||
|
||||
// Interpret CPU brand string if reported
|
||||
if (nExIds_ >= 0x80000004) {
|
||||
memcpy(brand, extdata_[2].data(), sizeof(cpui));
|
||||
memcpy(brand + 16, extdata_[3].data(), sizeof(cpui));
|
||||
memcpy(brand + 32, extdata_[4].data(), sizeof(cpui));
|
||||
getCPUIDEX(cpui, 0x80000002, 0);
|
||||
memcpy(brand, cpui, sizeof(cpui));
|
||||
getCPUIDEX(cpui, 0x80000003, 0);
|
||||
memcpy(brand + 16, cpui, sizeof(cpui));
|
||||
getCPUIDEX(cpui, 0x80000004, 0);
|
||||
memcpy(brand + 32, cpui, sizeof(cpui));
|
||||
brand_ = brand;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,25 +100,22 @@ public:
|
|||
private:
|
||||
static const CPUIdent_Internal CPU_Rep;
|
||||
|
||||
class CPUIdent_Internal
|
||||
{
|
||||
class CPUIdent_Internal {
|
||||
public:
|
||||
CPUIdent_Internal();
|
||||
|
||||
uint32_t nIds_;
|
||||
uint32_t nExIds_;
|
||||
uint32_t nIds_{ 0 };
|
||||
uint32_t nExIds_{ 0 };
|
||||
std::string vendor_;
|
||||
std::string brand_;
|
||||
bool isIntel_;
|
||||
bool isAMD_;
|
||||
std::bitset<32> f_1_ECX_;
|
||||
std::bitset<32> f_1_EDX_;
|
||||
std::bitset<32> f_7_EBX_;
|
||||
std::bitset<32> f_7_ECX_;
|
||||
std::bitset<32> f_81_ECX_;
|
||||
std::bitset<32> f_81_EDX_;
|
||||
std::vector<std::array<uint32_t, 4>> data_;
|
||||
std::vector<std::array<uint32_t, 4>> extdata_;
|
||||
bool isIntel_{ false };
|
||||
bool isAMD_{ false };
|
||||
std::bitset<32> f_1_ECX_{ 0 };
|
||||
std::bitset<32> f_1_EDX_{ 0 };
|
||||
std::bitset<32> f_7_EBX_{ 0 };
|
||||
std::bitset<32> f_7_ECX_{ 0 };
|
||||
std::bitset<32> f_81_ECX_{ 0 };
|
||||
std::bitset<32> f_81_EDX_{ 0 };
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -285,6 +285,21 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
}
|
||||
}
|
||||
|
||||
// Enable/disable controller raypicking depending on whether we are in HMD
|
||||
if (HMD.active) {
|
||||
Pointers.enablePointer(_this.leftPointer);
|
||||
Pointers.enablePointer(_this.rightPointer);
|
||||
Pointers.enablePointer(_this.leftHudPointer);
|
||||
Pointers.enablePointer(_this.rightHudPointer);
|
||||
Pointers.enablePointer(_this.mouseRayPointer);
|
||||
} else {
|
||||
Pointers.disablePointer(_this.leftPointer);
|
||||
Pointers.disablePointer(_this.rightPointer);
|
||||
Pointers.disablePointer(_this.leftHudPointer);
|
||||
Pointers.disablePointer(_this.rightHudPointer);
|
||||
Pointers.disablePointer(_this.mouseRayPointer);
|
||||
}
|
||||
|
||||
// raypick for each controller
|
||||
var rayPicks = [
|
||||
Pointers.getPrevPickResult(_this.leftPointer),
|
||||
|
@ -294,7 +309,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
Pointers.getPrevPickResult(_this.leftHudPointer),
|
||||
Pointers.getPrevPickResult(_this.rightHudPointer)
|
||||
];
|
||||
var mouseRayPick = Pointers.getPrevPickResult(_this.mouseRayPick);
|
||||
var mouseRayPointer = Pointers.getPrevPickResult(_this.mouseRayPointer);
|
||||
// if the pickray hit something very nearby, put it into the nearby entities list
|
||||
for (h = LEFT_HAND; h <= RIGHT_HAND; h++) {
|
||||
|
||||
|
@ -365,7 +380,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
nearbyOverlayIDs: nearbyOverlayIDs,
|
||||
rayPicks: rayPicks,
|
||||
hudRayPicks: hudRayPicks,
|
||||
mouseRayPick: mouseRayPick
|
||||
mouseRayPointer: mouseRayPointer
|
||||
};
|
||||
if (PROFILE) {
|
||||
Script.endProfileRange("dispatch.gather");
|
||||
|
@ -530,7 +545,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
hand: RIGHT_HAND
|
||||
});
|
||||
|
||||
this.mouseRayPick = Pointers.createPointer(PickType.Ray, {
|
||||
this.mouseRayPointer = Pointers.createPointer(PickType.Ray, {
|
||||
joint: "Mouse",
|
||||
filter: Picks.PICK_OVERLAYS | Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_NONCOLLIDABLE,
|
||||
enabled: true
|
||||
|
@ -579,7 +594,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
this.cleanup = function () {
|
||||
Controller.disableMapping(MAPPING_NAME);
|
||||
_this.pointerManager.removePointers();
|
||||
Pointers.removePointer(this.mouseRayPick);
|
||||
Pointers.removePointer(this.mouseRayPointer);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
Reticle.depth = Vec3.distance(reticlePositionOnHUD, HMD.position);
|
||||
} else {
|
||||
var APPARENT_MAXIMUM_DEPTH = 100.0;
|
||||
var result = controllerData.mouseRayPick;
|
||||
var result = controllerData.mouseRayPointer;
|
||||
Reticle.depth = result.intersects ? result.distance : APPARENT_MAXIMUM_DEPTH;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -366,7 +366,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
var offset = _this.pickHeightOffset * capsuleRatio;
|
||||
|
||||
_this.teleportHandCollisionPick = Picks.createPick(PickType.Collision, {
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
parentID: Pointers.getPointerProperties(_this.teleportParabolaHandCollisions).renderStates["collision"].end,
|
||||
filter: Picks.PICK_ENTITIES | Picks.PICK_AVATARS,
|
||||
shape: {
|
||||
|
@ -382,7 +382,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
});
|
||||
|
||||
_this.teleportHeadCollisionPick = Picks.createPick(PickType.Collision, {
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
parentID: Pointers.getPointerProperties(_this.teleportParabolaHeadCollisions).renderStates["collision"].end,
|
||||
filter: Picks.PICK_ENTITIES | Picks.PICK_AVATARS,
|
||||
shape: {
|
||||
|
|
|
@ -221,6 +221,20 @@ function Grabber() {
|
|||
});
|
||||
}
|
||||
|
||||
Grabber.prototype.setPicksAndPointersEnabled = function(enabled) {
|
||||
if (enabled) {
|
||||
Picks.enablePick(this.mouseRayOverlays);
|
||||
Pointers.enablePointer(this.mouseRayEntities);
|
||||
} else {
|
||||
Picks.disablePick(this.mouseRayOverlays);
|
||||
Pointers.disablePointer(this.mouseRayEntities);
|
||||
}
|
||||
}
|
||||
|
||||
Grabber.prototype.displayModeChanged = function(isHMDMode) {
|
||||
this.setPicksAndPointersEnabled(!isHMDMode);
|
||||
}
|
||||
|
||||
Grabber.prototype.computeNewGrabPlane = function() {
|
||||
if (!this.isGrabbing) {
|
||||
return;
|
||||
|
@ -488,6 +502,10 @@ Grabber.prototype.cleanup = function() {
|
|||
|
||||
var grabber = new Grabber();
|
||||
|
||||
function displayModeChanged(isHMDMode) {
|
||||
grabber.displayModeChanged(isHMDMode);
|
||||
}
|
||||
|
||||
function pressEvent(event) {
|
||||
grabber.pressEvent(event);
|
||||
}
|
||||
|
@ -517,6 +535,7 @@ Controller.mouseMoveEvent.connect(moveEvent);
|
|||
Controller.mouseReleaseEvent.connect(releaseEvent);
|
||||
Controller.keyPressEvent.connect(keyPressEvent);
|
||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||
HMD.displayModeChanged.connect(displayModeChanged);
|
||||
Script.scriptEnding.connect(cleanup);
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import uuid
|
||||
import zipfile
|
||||
import base64
|
||||
|
||||
|
@ -14,33 +11,6 @@ sys.path.append(SOURCE_PATH)
|
|||
|
||||
import hifi_utils
|
||||
|
||||
|
||||
class ZipAttrs:
|
||||
""" A readable wrapper for ZipInfo's external attributes bit field """
|
||||
|
||||
S_IFREG = 0x8
|
||||
S_IFLNK = 0xa
|
||||
S_IFDIR = 0x4
|
||||
MODE_MASK = 0xfff0000
|
||||
|
||||
def __init__(self, zip_info):
|
||||
# File stats are the 4 high bits of external_attr, a 32 bit field.
|
||||
self._stat = zip_info.external_attr >> 28
|
||||
self.mode = (zip_info.external_attr & self.MODE_MASK) >> 16
|
||||
|
||||
@property
|
||||
def is_symlink(self):
|
||||
return self._stat == self.S_IFLNK
|
||||
|
||||
@property
|
||||
def is_dir(self):
|
||||
return self._stat == self.S_IFDIR
|
||||
|
||||
@property
|
||||
def is_regular(self):
|
||||
return self._stat == self.S_IFREG
|
||||
|
||||
|
||||
BUILD_PATH = os.path.join(SOURCE_PATH, 'build')
|
||||
INTERFACE_BUILD_PATH = os.path.join(BUILD_PATH, 'interface', 'Release')
|
||||
WIPE_PATHS = []
|
||||
|
@ -95,12 +65,8 @@ def fixupMacZip(filename):
|
|||
fullPath = os.path.join(BUILD_PATH, "{}.zip".format(filename))
|
||||
outFullPath = "{}.zip".format(fullPath)
|
||||
print("Fixup mac ZIP file {}".format(fullPath))
|
||||
tmpDir = os.path.join(tempfile.gettempdir(),
|
||||
'com.highfidelity.launcher.postbuild',
|
||||
str(uuid.uuid4()))
|
||||
|
||||
try:
|
||||
with zipfile.ZipFile(fullPath) as inzip:
|
||||
with zipfile.ZipFile(fullPath) as inzip:
|
||||
with zipfile.ZipFile(outFullPath, 'w') as outzip:
|
||||
rootPath = inzip.infolist()[0].filename
|
||||
for entry in inzip.infolist():
|
||||
if entry.filename == rootPath:
|
||||
|
@ -120,51 +86,11 @@ def fixupMacZip(filename):
|
|||
continue
|
||||
# if we made it here, include the file in the output
|
||||
buffer = inzip.read(entry.filename)
|
||||
newFilename = os.path.join(tmpDir, newFilename)
|
||||
|
||||
attrs = ZipAttrs(entry)
|
||||
if attrs.is_dir:
|
||||
os.makedirs(newFilename)
|
||||
elif attrs.is_regular:
|
||||
with open(newFilename, mode='wb') as _file:
|
||||
_file.write(buffer)
|
||||
os.chmod(newFilename, mode=attrs.mode)
|
||||
elif attrs.is_symlink:
|
||||
os.symlink(buffer, newFilename)
|
||||
else:
|
||||
raise IOError('Invalid file stat')
|
||||
|
||||
if 'XCODE_DEVELOPMENT_TEAM' in os.environ:
|
||||
print('XCODE_DEVELOPMENT_TEAM environment variable is not set. '
|
||||
'Not signing build.', file=sys.stderr)
|
||||
else:
|
||||
# The interface.app bundle must be signed again after being
|
||||
# stripped.
|
||||
print('Signing interface.app bundle')
|
||||
entitlementsPath = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
'../../interface/interface.entitlements')
|
||||
subprocess.run([
|
||||
'codesign', '-s', 'Developer ID Application', '--deep',
|
||||
'--timestamp', '--force', '--entitlements', entitlementsPath,
|
||||
os.path.join(tmpDir, 'interface.app')
|
||||
], check=True)
|
||||
|
||||
# Repackage the zip including the signed version of interface.app
|
||||
print('Replacing {} with fixed {}'.format(fullPath, outFullPath))
|
||||
if os.path.exists(outFullPath):
|
||||
print('fixed zip already exists, deleting it', file=sys.stderr)
|
||||
os.unlink(outFullPath)
|
||||
previous_cwd = os.getcwd()
|
||||
os.chdir(tmpDir)
|
||||
try:
|
||||
subprocess.run(['zip', '--symlink', '-r', outFullPath, './.'],
|
||||
stdout=subprocess.DEVNULL, check=True)
|
||||
finally:
|
||||
os.chdir(previous_cwd)
|
||||
|
||||
finally:
|
||||
shutil.rmtree(tmpDir)
|
||||
entry.filename = newFilename
|
||||
outzip.writestr(entry, buffer)
|
||||
outzip.close()
|
||||
print("Replacing {} with fixed {}".format(fullPath, outFullPath))
|
||||
shutil.move(outFullPath, fullPath)
|
||||
|
||||
def fixupWinZip(filename):
|
||||
fullPath = os.path.join(BUILD_PATH, "{}.zip".format(filename))
|
||||
|
@ -222,9 +148,30 @@ def signBuild(executablePath):
|
|||
])
|
||||
|
||||
|
||||
def zipDarwinLauncher():
|
||||
launcherSourcePath = os.path.join(SOURCE_PATH, 'launchers', sys.platform)
|
||||
launcherBuildPath = os.path.join(BUILD_PATH, 'launcher')
|
||||
|
||||
archiveName = computeArchiveName('HQ Launcher')
|
||||
|
||||
cpackCommand = [
|
||||
'cpack',
|
||||
'-G', 'ZIP',
|
||||
'-D', "CPACK_PACKAGE_FILE_NAME={}".format(archiveName),
|
||||
'-D', "CPACK_INCLUDE_TOPLEVEL_DIRECTORY=OFF"
|
||||
]
|
||||
print("Create ZIP version of installer archive")
|
||||
print(cpackCommand)
|
||||
hifi_utils.executeSubprocess(cpackCommand, folder=launcherBuildPath)
|
||||
launcherZipDestFile = os.path.join(BUILD_PATH, "{}.zip".format(archiveName))
|
||||
launcherZipSourceFile = os.path.join(launcherBuildPath, "{}.zip".format(archiveName))
|
||||
print("Moving {} to {}".format(launcherZipSourceFile, launcherZipDestFile))
|
||||
shutil.move(launcherZipSourceFile, launcherZipDestFile)
|
||||
|
||||
|
||||
def buildLightLauncher():
|
||||
launcherSourcePath = os.path.join(SOURCE_PATH, 'launchers', sys.platform)
|
||||
launcherBuildPath = os.path.join(BUILD_PATH, 'launcher')
|
||||
launcherBuildPath = os.path.join(BUILD_PATH, 'launcher')
|
||||
if not os.path.exists(launcherBuildPath):
|
||||
os.makedirs(launcherBuildPath)
|
||||
# configure launcher build
|
||||
|
@ -243,12 +190,13 @@ def buildLightLauncher():
|
|||
if sys.platform == 'win32':
|
||||
buildTarget = 'ALL_BUILD'
|
||||
hifi_utils.executeSubprocess([
|
||||
'cmake',
|
||||
'cmake',
|
||||
'--build', launcherBuildPath,
|
||||
'--config', 'Release',
|
||||
'--config', 'Release',
|
||||
'--target', buildTarget
|
||||
], folder=launcherBuildPath)
|
||||
if sys.platform == 'darwin':
|
||||
zipDarwinLauncher()
|
||||
launcherDestFile = os.path.join(BUILD_PATH, "{}.dmg".format(computeArchiveName('Launcher')))
|
||||
launcherSourceFile = os.path.join(launcherBuildPath, "HQ Launcher.dmg")
|
||||
elif sys.platform == 'win32':
|
||||
|
|
|
@ -167,6 +167,19 @@ local unsourced_packet_types = {
|
|||
["ICEServerHeartbeatACK"] = true
|
||||
}
|
||||
|
||||
local nonverified_packet_types = {
|
||||
["NodeJsonStats"] = true,
|
||||
["EntityQuery"] = true,
|
||||
["OctreeDataNack"] = true,
|
||||
["EntityEditNack"] = true,
|
||||
["DomainListRequest"] = true,
|
||||
["StopNode"] = true,
|
||||
["DomainDisconnectRequest"] = true,
|
||||
["UsernameFromIDRequest"] = true,
|
||||
["NodeKickRequest"] = true,
|
||||
["NodeMuteRequest"] = true,
|
||||
}
|
||||
|
||||
local fragments = {}
|
||||
|
||||
local RFC_5389_MAGIC_COOKIE = 0x2112A442
|
||||
|
@ -304,9 +317,11 @@ function p_hfudt.dissector(buf, pinfo, tree)
|
|||
subtree:add_le(f_sender_id, sender_id)
|
||||
i = i + 2
|
||||
|
||||
-- read HMAC MD5 hash
|
||||
subtree:add(f_hmac_hash, buf(i, 16))
|
||||
i = i + 16
|
||||
if nonverified_packet_types[packet_type_text] == nil then
|
||||
-- read HMAC MD5 hash
|
||||
subtree:add(f_hmac_hash, buf(i, 16))
|
||||
i = i + 16
|
||||
end
|
||||
end
|
||||
|
||||
local payload_to_dissect = nil
|
||||
|
|
Loading…
Reference in a new issue