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

This commit is contained in:
Zach Fox 2018-04-30 12:36:00 -07:00
commit aafcf056c4
37 changed files with 394 additions and 98 deletions

View file

@ -254,7 +254,7 @@ ModalWindow {
text: root.warning;
wrapMode: Text.WordWrap;
font.italic: true;
maximumLineCount: 2;
maximumLineCount: 3;
}
HiFiGlyphs {

View file

@ -254,7 +254,7 @@ ModalWindow {
text: root.warning;
wrapMode: Text.WordWrap;
font.italic: true;
maximumLineCount: 2;
maximumLineCount: 3;
}
HiFiGlyphs {

View file

@ -282,7 +282,7 @@ TabletModalWindow {
text: root.warning;
wrapMode: Text.WordWrap;
font.italic: true;
maximumLineCount: 2;
maximumLineCount: 3;
}
HiFiGlyphs {

View file

@ -124,6 +124,14 @@ Rectangle {
root.numUpdatesAvailable = result.data.updates.length;
}
}
onAppInstalled: {
root.installedApps = Commerce.getInstalledApps();
}
onAppUninstalled: {
root.installedApps = Commerce.getInstalledApps();
}
}
Timer {
@ -249,6 +257,145 @@ Rectangle {
Commerce.getWalletStatus();
}
}
Item {
id: installedAppsContainer;
z: 998;
visible: false;
anchors.top: titleBarContainer.bottom;
anchors.topMargin: -titleBarContainer.additionalDropdownHeight;
anchors.left: parent.left;
anchors.bottom: parent.bottom;
width: parent.width;
RalewayRegular {
id: installedAppsHeader;
anchors.top: parent.top;
anchors.topMargin: 10;
anchors.left: parent.left;
anchors.leftMargin: 12;
height: 80;
width: paintedWidth;
text: "All Installed Marketplace Apps";
color: hifi.colors.black;
size: 22;
}
ListView {
id: installedAppsList;
clip: true;
model: installedAppsModel;
snapMode: ListView.SnapToItem;
// Anchors
anchors.top: installedAppsHeader.bottom;
anchors.left: parent.left;
anchors.bottom: sideloadAppButton.top;
width: parent.width;
delegate: Item {
width: parent.width;
height: 40;
RalewayRegular {
text: model.appUrl;
// Text size
size: 16;
// Anchors
anchors.left: parent.left;
anchors.leftMargin: 12;
height: parent.height;
anchors.right: sideloadAppOpenButton.left;
anchors.rightMargin: 8;
elide: Text.ElideRight;
// Style
color: hifi.colors.black;
// Alignment
verticalAlignment: Text.AlignVCenter;
MouseArea {
anchors.fill: parent;
onClicked: {
Window.copyToClipboard((model.appUrl).slice(0, -9));
}
}
}
HifiControlsUit.Button {
id: sideloadAppOpenButton;
text: "OPEN";
color: hifi.buttons.blue;
colorScheme: hifi.colorSchemes.dark;
anchors.top: parent.top;
anchors.topMargin: 2;
anchors.bottom: parent.bottom;
anchors.bottomMargin: 2;
anchors.right: uninstallGlyph.left;
anchors.rightMargin: 8;
width: 80;
onClicked: {
Commerce.openApp(model.appUrl);
}
}
HiFiGlyphs {
id: uninstallGlyph;
text: hifi.glyphs.close;
color: hifi.colors.black;
size: 22;
anchors.top: parent.top;
anchors.right: parent.right;
anchors.rightMargin: 6;
width: 35;
height: parent.height;
horizontalAlignment: Text.AlignHCenter;
MouseArea {
anchors.fill: parent;
hoverEnabled: true;
onEntered: {
parent.text = hifi.glyphs.closeInverted;
}
onExited: {
parent.text = hifi.glyphs.close;
}
onClicked: {
Commerce.uninstallApp(model.appUrl);
}
}
}
}
}
HifiControlsUit.Button {
id: sideloadAppButton;
color: hifi.buttons.blue;
colorScheme: hifi.colorSchemes.dark;
anchors.bottom: parent.bottom;
anchors.bottomMargin: 8;
anchors.left: parent.left;
anchors.leftMargin: 8;
anchors.right: closeAppListButton.left;
anchors.rightMargin: 8;
height: 40;
text: "SIDELOAD APP FROM LOCAL DISK";
onClicked: {
Window.browseChanged.connect(onFileOpenChanged);
Window.browseAsync("Locate your app's .app.json file", "", "*.app.json");
}
}
HifiControlsUit.Button {
id: closeAppListButton;
color: hifi.buttons.white;
colorScheme: hifi.colorSchemes.dark;
anchors.bottom: parent.bottom;
anchors.bottomMargin: 8;
anchors.right: parent.right;
anchors.rightMargin: 8;
width: 100;
height: 40;
text: "BACK";
onClicked: {
installedAppsContainer.visible = false;
}
}
}
HifiWallet.NeedsLogIn {
id: needsLogIn;
@ -317,7 +464,7 @@ Rectangle {
//
Item {
id: purchasesContentsContainer;
visible: root.activeView === "purchasesMain";
visible: root.activeView === "purchasesMain" && !installedAppsList.visible;
// Anchors
anchors.left: parent.left;
anchors.right: parent.right;
@ -959,6 +1106,39 @@ Rectangle {
}
}
Keys.onPressed: {
if ((event.key == Qt.Key_F) && (event.modifiers & Qt.ControlModifier)) {
installedAppsContainer.visible = !installedAppsContainer.visible;
console.log("User changed visibility of installedAppsContainer to " + installedAppsContainer.visible);
}
}
function onFileOpenChanged(filename) {
// disconnect the event, otherwise the requests will stack up
try { // Not all calls to onFileOpenChanged() connect an event.
Window.browseChanged.disconnect(onFileOpenChanged);
} catch (e) {
console.log('Purchases.qml ignoring', e);
}
if (filename) {
Commerce.installApp(filename);
}
}
ListModel {
id: installedAppsModel;
}
onInstalledAppsChanged: {
installedAppsModel.clear();
var installedAppsArray = root.installedApps.split(",");
var installedAppsObject = [];
// "- 1" because the last app string ends with ","
for (var i = 0; i < installedAppsArray.length - 1; i++) {
installedAppsObject[i] = {
"appUrl": installedAppsArray[i]
}
}
installedAppsModel.append(installedAppsObject);
}
//
// Function Name: fromScript()
//

View file

@ -145,6 +145,16 @@
#include <avatars-renderer/ScriptAvatar.h>
#include <RenderableEntityItem.h>
#include <AnimationLogging.h>
#include <AvatarLogging.h>
#include <ScriptEngineLogging.h>
#include <ModelFormatLogging.h>
#include <controllers/Logging.h>
#include <NetworkLogging.h>
#include <shared/StorageLogging.h>
#include <ScriptEngineLogging.h>
#include <ui/Logging.h>
#include "AudioClient.h"
#include "audio/AudioScope.h"
#include "avatar/AvatarManager.h"
@ -1060,6 +1070,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
if (steamClient) {
qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID();
}
setCrashAnnotation("steam", property(hifi::properties::STEAM).toBool() ? "1" : "0");
qCDebug(interfaceapp) << "[VERSION] Build sequence:" << qPrintable(applicationVersion());
qCDebug(interfaceapp) << "[VERSION] MODIFIED_ORGANIZATION:" << BuildInfo::MODIFIED_ORGANIZATION;
qCDebug(interfaceapp) << "[VERSION] VERSION:" << BuildInfo::VERSION;
@ -1145,6 +1157,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
const DomainHandler& domainHandler = nodeList->getDomainHandler();
connect(&domainHandler, SIGNAL(domainURLChanged(QUrl)), SLOT(domainURLChanged(QUrl)));
connect(&domainHandler, &DomainHandler::domainURLChanged, [](QUrl domainURL){
setCrashAnnotation("domain", domainURL.toString().toStdString());
});
connect(&domainHandler, SIGNAL(resetting()), SLOT(resettingDomain()));
connect(&domainHandler, SIGNAL(connectedToDomain(QUrl)), SLOT(updateWindowTitle()));
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
@ -1190,6 +1205,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
auto dialogsManager = DependencyManager::get<DialogsManager>();
connect(accountManager.data(), &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog);
connect(accountManager.data(), &AccountManager::usernameChanged, this, &Application::updateWindowTitle);
connect(accountManager.data(), &AccountManager::usernameChanged, [](QString username){
setCrashAnnotation("username", username.toStdString());
});
// set the account manager's root URL and trigger a login request if we don't have the access token
accountManager->setIsAgent(true);
@ -1207,6 +1225,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
connect(this, &Application::activeDisplayPluginChanged, this, &Application::updateThreadPoolCount);
connect(this, &Application::activeDisplayPluginChanged, this, [](){
qApp->setProperty(hifi::properties::HMD, qApp->isHMDMode());
auto displayPlugin = qApp->getActiveDisplayPlugin();
setCrashAnnotation("display_plugin", displayPlugin->getName().toStdString());
setCrashAnnotation("hmd", displayPlugin->isHmd() ? "1" : "0");
});
connect(this, &Application::activeDisplayPluginChanged, this, &Application::updateSystemTabletMode);
@ -1214,6 +1235,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
connect(myAvatar.get(), &MyAvatar::positionGoneTo,
DependencyManager::get<AddressManager>().data(), &AddressManager::storeCurrentAddress);
connect(myAvatar.get(), &MyAvatar::skeletonModelURLChanged, [](){
QUrl avatarURL = qApp->getMyAvatar()->getSkeletonModelURL();
setCrashAnnotation("avatar", avatarURL.toString().toStdString());
});
// Inititalize sample before registering
_sampleSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/sample.wav"));
@ -1306,6 +1333,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
// Needs to happen AFTER the render engine initialization to access its configuration
initializeUi();
updateVerboseLogging();
init();
qCDebug(interfaceapp, "init() complete.");
@ -1376,6 +1405,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
userActivityLogger.disable(false);
}
QString machineFingerPrint = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint());
if (userActivityLogger.isEnabled()) {
// sessionRunTime will be reset soon by loadSettings. Grab it now to get previous session value.
// The value will be 0 if the user blew away settings this session, which is both a feature and a bug.
@ -1425,11 +1456,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
properties["first_run"] = firstRun.get();
// add the user's machine ID to the launch event
properties["machine_fingerprint"] = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint());
properties["machine_fingerprint"] = machineFingerPrint;
userActivityLogger.logAction("launch", properties);
}
setCrashAnnotation("machine_fingerprint", machineFingerPrint.toStdString());
_entityEditSender.setMyAvatar(myAvatar.get());
// The entity octree will have to know about MyAvatar for the parentJointName import
@ -2174,6 +2207,46 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
qCDebug(interfaceapp) << "Metaverse session ID is" << uuidStringWithoutCurlyBraces(accountManager->getSessionID());
}
void Application::updateVerboseLogging() {
bool enable = Menu::getInstance()->isOptionChecked(MenuOption::VerboseLogging);
const_cast<QLoggingCategory*>(&animation())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&animation())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&avatars())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&avatars())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&scriptengine())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&scriptengine())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&modelformat())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&modelformat())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&controllers())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&controllers())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&resourceLog())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&resourceLog())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&networking())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&networking())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&asset_client())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&asset_client())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&messages_client())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&messages_client())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&storagelogging())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&storagelogging())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&uiLogging())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&uiLogging())->setEnabled(QtInfoMsg, enable);
const_cast<QLoggingCategory*>(&glLogging())->setEnabled(QtDebugMsg, enable);
const_cast<QLoggingCategory*>(&glLogging())->setEnabled(QtInfoMsg, enable);
}
void Application::domainConnectionRefused(const QString& reasonMessage, int reasonCodeInt, const QString& extraInfo) {
DomainHandler::ConnectionRefusedReason reasonCode = static_cast<DomainHandler::ConnectionRefusedReason>(reasonCodeInt);
@ -3042,7 +3115,6 @@ void Application::handleSandboxStatus(QNetworkReply* reply) {
PROFILE_RANGE(render, __FUNCTION__);
bool sandboxIsRunning = SandboxUtils::readStatus(reply->readAll());
qDebug() << "HandleSandboxStatus" << sandboxIsRunning;
enum HandControllerType {
Vive,

View file

@ -400,6 +400,8 @@ public slots:
Q_INVOKABLE bool askBeforeSetAvatarUrl(const QString& avatarUrl) { return askToSetAvatarUrl(avatarUrl); }
void updateVerboseLogging();
private slots:
void onDesktopRootItemCreated(QQuickItem* qmlContext);
void onDesktopRootContextCreated(QQmlContext* qmlContext);

View file

@ -43,12 +43,10 @@ void ConnectionMonitor::init() {
}
void ConnectionMonitor::startTimer() {
qDebug() << "ConnectionMonitor: Starting timer";
_timer.start(DISPLAY_AFTER_DISCONNECTED_FOR_X_MS);
}
void ConnectionMonitor::stopTimer() {
qDebug() << "ConnectionMonitor: Stopping timer";
_timer.stop();
DependencyManager::get<DialogsManager>()->setDomainConnectionFailureVisibility(false);
}

View file

@ -15,6 +15,8 @@
#if HAS_CRASHPAD
#include <mutex>
#include <QStandardPaths>
#include <QDir>
@ -23,8 +25,8 @@
#include <client/crashpad_client.h>
#include <client/crash_report_database.h>
#include <client/settings.h>
// #include <client/annotation_list.h>
// #include <client/crashpad_info.h>
#include <client/annotation_list.h>
#include <client/crashpad_info.h>
using namespace crashpad;
@ -35,7 +37,8 @@ static std::wstring gIPCPipe;
extern QString qAppFileName();
// crashpad::AnnotationList* crashpadAnnotations { nullptr };
std::mutex annotationMutex;
crashpad::SimpleStringDictionary* crashpadAnnotations { nullptr };
#include <Windows.h>
@ -102,12 +105,14 @@ bool startCrashHandler() {
}
void setCrashAnnotation(std::string name, std::string value) {
// if (!crashpadAnnotations) {
// crashpadAnnotations = new crashpad::AnnotationList(); // don't free this, let it leak
// crashpad::CrashpadInfo* crashpad_info = crashpad::GetCrashpadInfo();
// crashpad_info->set_simple_annotations(crashpadAnnotations);
// }
// crashpadAnnotations->SetKeyValue(name, value);
std::lock_guard<std::mutex> guard(annotationMutex);
if (!crashpadAnnotations) {
crashpadAnnotations = new crashpad::SimpleStringDictionary(); // don't free this, let it leak
crashpad::CrashpadInfo* crashpad_info = crashpad::CrashpadInfo::GetCrashpadInfo();
crashpad_info->set_simple_annotations(crashpadAnnotations);
}
std::replace(value.begin(), value.end(), ',', ';');
crashpadAnnotations->SetKeyValue(name, value);
}
#else

View file

@ -20,6 +20,7 @@
#include <UserActivityLogger.h>
#include <UUID.h>
#include "Crashpad.h"
#include "DiscoverabilityManager.h"
#include "Menu.h"
@ -127,10 +128,12 @@ void DiscoverabilityManager::updateLocation() {
QNetworkAccessManager::PutOperation, callbackParameters);
}
// Update Steam
// Update Steam and crash logger
QUrl currentAddress = addressManager->currentFacingPublicAddress();
if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
steamClient->updateLocation(domainHandler.getHostname(), addressManager->currentFacingPublicAddress());
steamClient->updateLocation(domainHandler.getHostname(), currentAddress);
}
setCrashAnnotation("address", currentAddress.toString().toStdString());
}
void DiscoverabilityManager::handleHeartbeatResponse(QNetworkReply& requestReply) {

View file

@ -810,6 +810,9 @@ Menu::Menu() {
scriptEngines->loadScript(defaultScriptsLoc.toString());
});
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::VerboseLogging, 0, false,
qApp, SLOT(updateVerboseLogging()));
#if 0 /// -------------- REMOVED FOR NOW --------------
addDisabledActionAndSeparator(navigateMenu, "History");
QAction* backAction = addActionToQMenuAndActionHash(navigateMenu, MenuOption::Back, 0, addressManager.data(), SLOT(goBack()));

View file

@ -142,6 +142,7 @@ namespace MenuOption {
const QString Pair = "Pair";
const QString PhysicsShowHulls = "Draw Collision Shapes";
const QString PhysicsShowOwned = "Highlight Simulation Ownership";
const QString VerboseLogging = "Verbose Logging";
const QString PipelineWarnings = "Log Render Pipeline Warnings";
const QString Preferences = "General...";
const QString Quit = "Quit";

View file

@ -108,11 +108,9 @@ AudioDeviceList::~AudioDeviceList() {
// store the selected device
foreach(std::shared_ptr<AudioDevice> adevice, _devices) {
if (adevice->selectedDesktop) {
qDebug() << "Saving Desktop for" << _mode << "name" << adevice->info.deviceName();
settingDesktop.set(adevice->info.deviceName());
}
if (adevice->selectedHMD) {
qDebug() << "Saving HMD for" << _mode << "name" << adevice->info.deviceName();
settingHMD.set(adevice->info.deviceName());
}
}
@ -311,7 +309,6 @@ void AudioDeviceList::onDevicesChanged(const QList<QAudioDeviceInfo>& devices) {
}
}
qDebug() << "adding audio device:" << device.display << device.selectedDesktop << device.selectedHMD << _mode;
newDevices.push_back(newDevice(device));
}

View file

@ -80,7 +80,6 @@ void DialogsManager::showFeed() {
}
void DialogsManager::setDomainConnectionFailureVisibility(bool visible) {
qDebug() << "DialogsManager::setDomainConnectionFailureVisibility: visible" << visible;
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));

View file

@ -588,6 +588,7 @@ void AnimExpression::evalUnaryMinus(const AnimVariantMap& map, std::stack<OpCode
PUSH(false);
break;
}
break;
}
case OpCode::Int:
PUSH(-rhs.intVal);

View file

@ -10,6 +10,7 @@
// Inline functions to implement audio dynamics processing
//
#include <stddef.h>
#include <math.h>
#include <stdint.h>

View file

@ -390,17 +390,18 @@ public slots:
/**jsdoc
* Find all entities of a particular name that intersect a sphere defined by a center point and radius.
* @function Entities.findEntitiesByName
* @param {Entities.EntityType} entityName - The name of the entity to search for.
* @param {string} entityName - The name of the entity to search for.
* @param {Vec3} center - The point about which to search.
* @param {number} radius - The radius within which to search.
* @param {boolean} caseSensitiveSearch - Choose whether to to return case sensitive results back.
* @returns {Uuid[]} An array of entity IDs of the specified type that intersect the search sphere. The array is empty if
* no entities could be found.
* @example <caption>Get back a list of entities</caption>
* @param {boolean} [caseSensitive=false] - If <code>true</code> then the search is case-sensitive.
* @returns {Uuid[]} An array of entity IDs that have the specified name and intersect the search sphere. The array is empty
* if no entities could be found.
* @example <caption>Report the number of entities with the name, "Light-Target".</caption>
* var entityIDs = Entities.findEntitiesByName("Light-Target", MyAvatar.position, 10, false);
* print("Number of Entities with the name Light-Target " + entityIDs.length);
* print("Number of entities with the name "Light-Target": " + entityIDs.length);
*/
Q_INVOKABLE QVector<QUuid> findEntitiesByName(const QString entityName, const glm::vec3& center, float radius, bool caseSensitiveSearch = false ) const;
Q_INVOKABLE QVector<QUuid> findEntitiesByName(const QString entityName, const glm::vec3& center, float radius,
bool caseSensitiveSearch = false ) const;
/**jsdoc
* Find the first entity intersected by a {@link PickRay}. <code>Light</code> and <code>Zone</code> entities are not

View file

@ -996,14 +996,12 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS
QByteArray filename = subobject.properties.at(0).toByteArray();
QByteArray filepath = filename.replace('\\', '/');
filename = fileOnUrl(filepath, url);
qDebug() << "Filename" << filepath << filename;
_textureFilepaths.insert(getID(object.properties), filepath);
_textureFilenames.insert(getID(object.properties), filename);
} else if (subobject.name == "TextureName" && subobject.properties.length() >= TEXTURE_NAME_MIN_SIZE) {
// trim the name from the timestamp
QString name = QString(subobject.properties.at(0).toByteArray());
name = name.left(name.indexOf('['));
qDebug() << "Filename" << name;
_textureNames.insert(getID(object.properties), name);
} else if (subobject.name == "Texture_Alpha_Source" && subobject.properties.length() >= TEXTURE_ALPHA_SOURCE_MIN_SIZE) {
tex.assign<uint8_t>(tex.alphaSource, subobject.properties.at(0).value<int>());

View file

@ -333,12 +333,14 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
return false;
}
static const QString LOCALHOST = "localhost";
bool isPossiblePlaceName(QString possiblePlaceName) {
bool result { false };
int length = possiblePlaceName.length();
static const int MINIMUM_PLACENAME_LENGTH = 1;
static const int MAXIMUM_PLACENAME_LENGTH = 64;
if (possiblePlaceName.toLower() != "localhost" &&
if (possiblePlaceName.toLower() != LOCALHOST &&
length >= MINIMUM_PLACENAME_LENGTH && length <= MAXIMUM_PLACENAME_LENGTH) {
const QRegExp PLACE_NAME_REGEX = QRegExp("^[0-9A-Za-z](([0-9A-Za-z]|-(?!-))*[^\\W_]$|$)");
result = PLACE_NAME_REGEX.indexIn(possiblePlaceName) == 0;
@ -358,7 +360,7 @@ void AddressManager::handleLookupString(const QString& lookupString, bool fromSu
sanitizedString = sanitizedString.remove(HIFI_SCHEME_REGEX);
lookupURL = QUrl(sanitizedString);
if (lookupURL.scheme().isEmpty()) {
if (lookupURL.scheme().isEmpty() || lookupURL.scheme().toLower() == LOCALHOST) {
lookupURL = QUrl("hifi://" + sanitizedString);
}
} else {
@ -607,7 +609,7 @@ bool AddressManager::handleNetworkAddress(const QString& lookupString, LookupTri
if (ipAddressRegex.indexIn(lookupString) != -1) {
QString domainIPString = ipAddressRegex.cap(1);
quint16 domainPort = DEFAULT_DOMAIN_SERVER_PORT;
quint16 domainPort = 0;
if (!ipAddressRegex.cap(2).isEmpty()) {
domainPort = (quint16) ipAddressRegex.cap(2).toInt();
}
@ -629,7 +631,7 @@ bool AddressManager::handleNetworkAddress(const QString& lookupString, LookupTri
if (hostnameRegex.indexIn(lookupString) != -1) {
QString domainHostname = hostnameRegex.cap(1);
quint16 domainPort = DEFAULT_DOMAIN_SERVER_PORT;
quint16 domainPort = 0;
if (!hostnameRegex.cap(2).isEmpty()) {
domainPort = (quint16)hostnameRegex.cap(2).toInt();

View file

@ -166,7 +166,12 @@ void DomainHandler::setURLAndID(QUrl domainURL, QUuid domainID) {
}
}
if (_domainURL != domainURL || _sockAddr.getPort() != domainURL.port()) {
auto domainPort = domainURL.port();
if (domainPort == -1) {
domainPort = DEFAULT_DOMAIN_SERVER_PORT;
}
if (_domainURL != domainURL || _sockAddr.getPort() != domainPort) {
// re-set the domain info so that auth information is reloaded
hardReset();
@ -192,12 +197,10 @@ void DomainHandler::setURLAndID(QUrl domainURL, QUuid domainID) {
emit domainURLChanged(_domainURL);
if (_sockAddr.getPort() != domainURL.port()) {
qCDebug(networking) << "Updated domain port to" << domainURL.port();
if (_sockAddr.getPort() != domainPort) {
qCDebug(networking) << "Updated domain port to" << domainPort;
_sockAddr.setPort(domainPort);
}
// grab the port by reading the string after the colon
_sockAddr.setPort(domainURL.port());
}
}

View file

@ -192,8 +192,6 @@ void EntityScriptClient::handleNodeClientConnectionReset(SharedNodePointer node)
return;
}
//qCDebug(entity_script_client) << "EntityScriptClient detected client connection reset handshake with Asset Server - failing any pending requests";
forceFailureOfPendingRequests(node);
}

View file

@ -17,7 +17,6 @@
Q_DECLARE_LOGGING_CATEGORY(resourceLog)
Q_DECLARE_LOGGING_CATEGORY(networking)
Q_DECLARE_LOGGING_CATEGORY(asset_client)
Q_DECLARE_LOGGING_CATEGORY(entity_script_client)
Q_DECLARE_LOGGING_CATEGORY(messages_client)
#endif // hifi_NetworkLogging_h

View file

@ -16,6 +16,7 @@
#include "AbstractViewStateInterface.h"
#include "RenderUtilsLogging.h"
#include "DebugDraw.h"
#include "StencilMaskPass.h"
#include "animdebugdraw_vert.h"
#include "animdebugdraw_frag.h"
@ -70,7 +71,7 @@ public:
typedef render::Payload<AnimDebugDrawData> AnimDebugDrawPayload;
namespace render {
template <> const ItemKey payloadGetKey(const AnimDebugDrawData::Pointer& data) { return (data->_isVisible ? ItemKey::Builder::opaqueShape() : ItemKey::Builder::opaqueShape().withInvisible()).withTagBits(ItemKey::TAG_BITS_ALL); }
template <> const ItemKey payloadGetKey(const AnimDebugDrawData::Pointer& data) { return (data->_isVisible ? ItemKey::Builder::transparentShape() : ItemKey::Builder::transparentShape().withInvisible()).withTagBits(ItemKey::TAG_BITS_ALL); }
template <> const Item::Bound payloadGetBound(const AnimDebugDrawData::Pointer& data) { return data->_bound; }
template <> void payloadRender(const AnimDebugDrawData::Pointer& data, RenderArgs* args) {
data->render(args);
@ -104,6 +105,7 @@ AnimDebugDraw::AnimDebugDraw() :
state->setBlendFunction(false, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD,
gpu::State::INV_SRC_ALPHA, gpu::State::FACTOR_ALPHA,
gpu::State::BLEND_OP_ADD, gpu::State::ONE);
PrepareStencil::testMaskDrawShape(*state.get());
auto vertShader = animdebugdraw_vert::getShader();
auto fragShader = animdebugdraw_frag::getShader();
auto program = gpu::Shader::createProgram(vertShader, fragShader);

View file

@ -198,7 +198,7 @@ Antialiasing::~Antialiasing() {
_antialiasingTextures[1].reset();
}
const gpu::PipelinePointer& Antialiasing::getAntialiasingPipeline() {
const gpu::PipelinePointer& Antialiasing::getAntialiasingPipeline(const render::RenderContextPointer& renderContext) {
if (!_antialiasingPipeline) {
@ -207,17 +207,6 @@ const gpu::PipelinePointer& Antialiasing::getAntialiasingPipeline() {
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
gpu::Shader::BindingSet slotBindings;
slotBindings.insert(gpu::Shader::Binding(std::string("taaParamsBuffer"), AntialiasingPass_ParamsSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("deferredFrameTransformBuffer"), AntialiasingPass_FrameTransformSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("historyMap"), AntialiasingPass_HistoryMapSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("sourceMap"), AntialiasingPass_SourceMapSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("velocityMap"), AntialiasingPass_VelocityMapSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("depthMap"), AntialiasingPass_DepthMapSlot));
gpu::Shader::makeProgram(*program, slotBindings);
gpu::StatePointer state = gpu::StatePointer(new gpu::State());
@ -225,6 +214,21 @@ const gpu::PipelinePointer& Antialiasing::getAntialiasingPipeline() {
// Good to go add the brand new pipeline
_antialiasingPipeline = gpu::Pipeline::create(program, state);
gpu::doInBatch("SurfaceGeometryPass::CurvaturePipeline", renderContext->args->_context, [program](gpu::Batch& batch) {
batch.runLambda([program]() {
gpu::Shader::BindingSet slotBindings;
slotBindings.insert(gpu::Shader::Binding(std::string("taaParamsBuffer"), AntialiasingPass_ParamsSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("deferredFrameTransformBuffer"), AntialiasingPass_FrameTransformSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("historyMap"), AntialiasingPass_HistoryMapSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("sourceMap"), AntialiasingPass_SourceMapSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("velocityMap"), AntialiasingPass_VelocityMapSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("depthMap"), AntialiasingPass_DepthMapSlot));
gpu::Shader::makeProgram(*program, slotBindings);
});
});
}
return _antialiasingPipeline;
@ -347,7 +351,7 @@ void Antialiasing::run(const render::RenderContextPointer& renderContext, const
batch.setViewportTransform(args->_viewport);
// TAA step
getAntialiasingPipeline();
getAntialiasingPipeline(renderContext);
batch.setResourceFramebufferSwapChainTexture(AntialiasingPass_HistoryMapSlot, _antialiasingBuffers, 0);
batch.setResourceTexture(AntialiasingPass_SourceMapSlot, sourceBuffer->getRenderBuffer(0));
batch.setResourceTexture(AntialiasingPass_VelocityMapSlot, velocityBuffer->getVelocityTexture());
@ -358,7 +362,7 @@ void Antialiasing::run(const render::RenderContextPointer& renderContext, const
batch.setUniformBuffer(AntialiasingPass_FrameTransformSlot, deferredFrameTransform->getFrameTransformBuffer());
batch.setFramebufferSwapChain(_antialiasingBuffers, 1);
batch.setPipeline(getAntialiasingPipeline());
batch.setPipeline(getAntialiasingPipeline(renderContext));
batch.draw(gpu::TRIANGLE_STRIP, 4);
// Blend step

View file

@ -174,7 +174,7 @@ public:
void configure(const Config& config);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
const gpu::PipelinePointer& getAntialiasingPipeline();
const gpu::PipelinePointer& getAntialiasingPipeline(const render::RenderContextPointer& renderContext);
const gpu::PipelinePointer& getBlendPipeline();
const gpu::PipelinePointer& getDebugBlendPipeline();

View file

@ -168,7 +168,7 @@ void LinearDepthPass::run(const render::RenderContextPointer& renderContext, con
outputs.edit4() = halfNormalTexture;
auto linearDepthPipeline = getLinearDepthPipeline(renderContext);
auto downsamplePipeline = getDownsamplePipeline();
auto downsamplePipeline = getDownsamplePipeline(renderContext);
auto depthViewport = args->_viewport;
auto halfViewport = depthViewport >> 1;
@ -241,19 +241,12 @@ const gpu::PipelinePointer& LinearDepthPass::getLinearDepthPipeline(const render
}
const gpu::PipelinePointer& LinearDepthPass::getDownsamplePipeline() {
const gpu::PipelinePointer& LinearDepthPass::getDownsamplePipeline(const render::RenderContextPointer& renderContext) {
if (!_downsamplePipeline) {
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
auto ps = surfaceGeometry_downsampleDepthNormal_frag::getShader();
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
gpu::Shader::BindingSet slotBindings;
slotBindings.insert(gpu::Shader::Binding(std::string("deferredFrameTransformBuffer"), DepthLinearPass_FrameTransformSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("linearDepthMap"), DepthLinearPass_DepthMapSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("normalMap"), DepthLinearPass_NormalMapSlot));
gpu::Shader::makeProgram(*program, slotBindings);
gpu::StatePointer state = gpu::StatePointer(new gpu::State());
PrepareStencil::testShape(*state);
@ -261,6 +254,16 @@ const gpu::PipelinePointer& LinearDepthPass::getDownsamplePipeline() {
// Good to go add the brand new pipeline
_downsamplePipeline = gpu::Pipeline::create(program, state);
gpu::doInBatch("LinearDepthPass::run", renderContext->args->_context, [program](gpu::Batch& batch) {
batch.runLambda([program]() {
gpu::Shader::BindingSet slotBindings;
slotBindings.insert(gpu::Shader::Binding("deferredFrameTransformBuffer", DepthLinearPass_FrameTransformSlot));
slotBindings.insert(gpu::Shader::Binding("linearDepthMap", DepthLinearPass_DepthMapSlot));
slotBindings.insert(gpu::Shader::Binding("normalMap", DepthLinearPass_NormalMapSlot));
gpu::Shader::makeProgram(*program, slotBindings);
});
});
}
return _downsamplePipeline;

View file

@ -84,7 +84,7 @@ private:
const gpu::PipelinePointer& getLinearDepthPipeline(const render::RenderContextPointer& renderContext);
gpu::PipelinePointer _linearDepthPipeline;
const gpu::PipelinePointer& getDownsamplePipeline();
const gpu::PipelinePointer& getDownsamplePipeline(const render::RenderContextPointer& renderContext);
gpu::PipelinePointer _downsamplePipeline;
gpu::RangeTimerPointer _gpuTimer;

View file

@ -113,7 +113,7 @@ void VelocityBufferPass::run(const render::RenderContextPointer& renderContext,
outputs.edit1() = velocityFBO;
outputs.edit2() = velocityTexture;
auto cameraMotionPipeline = getCameraMotionPipeline();
auto cameraMotionPipeline = getCameraMotionPipeline(renderContext);
auto fullViewport = args->_viewport;
@ -143,18 +143,12 @@ void VelocityBufferPass::run(const render::RenderContextPointer& renderContext,
}
const gpu::PipelinePointer& VelocityBufferPass::getCameraMotionPipeline() {
const gpu::PipelinePointer& VelocityBufferPass::getCameraMotionPipeline(const render::RenderContextPointer& renderContext) {
if (!_cameraMotionPipeline) {
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
auto ps = velocityBuffer_cameraMotion_frag::getShader();
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
gpu::Shader::BindingSet slotBindings;
slotBindings.insert(gpu::Shader::Binding(std::string("deferredFrameTransformBuffer"), VelocityBufferPass_FrameTransformSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("depthMap"), VelocityBufferPass_DepthMapSlot));
gpu::Shader::makeProgram(*program, slotBindings);
gpu::StatePointer state = gpu::StatePointer(new gpu::State());
// Stencil test the curvature pass for objects pixels only, not the background
@ -164,6 +158,16 @@ const gpu::PipelinePointer& VelocityBufferPass::getCameraMotionPipeline() {
// Good to go add the brand new pipeline
_cameraMotionPipeline = gpu::Pipeline::create(program, state);
gpu::doInBatch("VelocityBufferPass::CameraMotionPipeline", renderContext->args->_context,
[program](gpu::Batch& batch) {
batch.runLambda([program]() {
gpu::Shader::BindingSet slotBindings;
slotBindings.insert(gpu::Shader::Binding(std::string("deferredFrameTransformBuffer"), VelocityBufferPass_FrameTransformSlot));
slotBindings.insert(gpu::Shader::Binding(std::string("depthMap"), VelocityBufferPass_DepthMapSlot));
gpu::Shader::makeProgram(*program, slotBindings);
});
});
}
return _cameraMotionPipeline;

View file

@ -79,7 +79,7 @@ private:
VelocityFramebufferPointer _velocityFramebuffer;
const gpu::PipelinePointer& getCameraMotionPipeline();
const gpu::PipelinePointer& getCameraMotionPipeline(const render::RenderContextPointer& renderContext);
gpu::PipelinePointer _cameraMotionPipeline;
gpu::RangeTimerPointer _gpuTimer;

View file

@ -538,7 +538,6 @@ int ScriptEngines::runScriptInitializers(ScriptEnginePointer scriptEngine) {
int ii=0;
for (auto initializer : _scriptInitializers) {
ii++;
qDebug() << "initializer" << ii;
initializer(scriptEngine);
}
return ii;

View file

@ -213,7 +213,7 @@ void setOctalCodeSectionValue(unsigned char* octalCode, int section, char sectio
int byteForSection = (BITS_IN_OCTAL * section / BITS_IN_BYTE);
unsigned char* byteAt = octalCode + 1 + byteForSection;
char bitInByte = (BITS_IN_OCTAL * section) % BITS_IN_BYTE;
char shiftBy = BITS_IN_BYTE - bitInByte - BITS_IN_OCTAL;
int8_t shiftBy = BITS_IN_BYTE - bitInByte - BITS_IN_OCTAL;
const unsigned char UNSHIFTED_MASK = 0x07;
unsigned char shiftedMask;
unsigned char shiftedValue;

View file

@ -22,6 +22,5 @@ namespace {
}
void MiniPromise::registerMetaTypes(QObject* engine) {
auto scriptEngine = qobject_cast<QScriptEngine*>(engine);
qDebug() << "----------------------- MiniPromise::registerMetaTypes ------------" << scriptEngine;
qScriptRegisterMetaType(scriptEngine, promiseToScriptValue, promiseFromScriptValue);
}

View file

@ -10,7 +10,7 @@
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
#include <QtCore/QLoggingCategory>
#include "StorageLogging.h"
Q_LOGGING_CATEGORY(storagelogging, "hifi.core.storage")
@ -102,4 +102,4 @@ FileStorage::~FileStorage() {
if (_file.isOpen()) {
_file.close();
}
}
}

View file

@ -0,0 +1,18 @@
//
// StorageLogging.h
//
// Created by Seth Alves on 2018-4-20
// Copyright 2018 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
//
#ifndef hifi_StorageLogging_h
#define hifi_StorageLogging_h
#include <QtCore/QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(storagelogging)
#endif // hifi_StorageLogging_h

View file

@ -6,8 +6,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_Controllers_Logging_h
#define hifi_Controllers_Logging_h
#ifndef hifi_UI_Logging_h
#define hifi_UI_Logging_h
#include <QLoggingCategory>

View file

@ -102,7 +102,7 @@ class AudioHandler : public QObject, QRunnable {
public:
AudioHandler(OffscreenQmlSurface* surface, const QString& deviceName, QObject* parent = nullptr);
virtual ~AudioHandler() { qDebug() << "Audio Handler Destroyed"; }
virtual ~AudioHandler() { }
void run() override;

View file

@ -321,7 +321,8 @@
{
id: "alpha",
name: "Alpha",
type: "SliderFloat"
type: "SliderFloat",
max: 1.0
},
{
type: "Row"
@ -329,7 +330,8 @@
{
id: "alphaSpread",
name: "Alpha Spread",
type: "SliderFloat"
type: "SliderFloat",
max: 1.0
},
{
type: "Row"
@ -337,7 +339,8 @@
{
id: "alphaStart",
name: "Alpha Start",
type: "SliderFloat"
type: "SliderFloat",
max: 1.0
},
{
type: "Row"
@ -345,7 +348,8 @@
{
id: "alphaFinish",
name: "Alpha Finish",
type: "SliderFloat"
type: "SliderFloat",
max: 1.0
},
{
type: "Row"

View file

@ -94,20 +94,20 @@ exports.handlers = {
if (e.doclet.hifiInterface) {
rows.push("Interface Scripts");
}
if (e.doclet.hifiAssignmentClient) {
rows.push("Assignment Client Scripts");
}
if (e.doclet.hifiClientEntity) {
rows.push("Client Entity Scripts");
}
if (e.doclet.hifiServerEntity) {
rows.push("Server Entity Scripts");
}
if (e.doclet.hifiAssignmentClient) {
rows.push("Assignment Client Scripts");
}
// Append an Available In: table at the end of the namespace description.
if (rows.length > 0) {
var table = "<br><br><table><td>Available In:<td>" + rows.join("<td>") + "</table>";
e.doclet.description = e.doclet.description + table;
var table = "<br><br><table><tr><th>Available in:</th><td>" + rows.join("</td><td>") + "</td></tr></table>";
e.doclet.description = (e.doclet.description ? e.doclet.description : "") + table;
}
}
}
@ -124,7 +124,7 @@ exports.defineTags = function (dictionary) {
});
// @hifi-assignment-client
dictionary.defineTag("hifi-assigment-client", {
dictionary.defineTag("hifi-assignment-client", {
onTagged: function (doclet, tag) {
doclet.hifiAssignmentClient = true;
}