mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into yellow
This commit is contained in:
commit
3ebab3b017
8 changed files with 69 additions and 75 deletions
|
@ -4625,11 +4625,15 @@ void Application::resetSensors(bool andReload) {
|
||||||
|
|
||||||
void Application::updateWindowTitle() const {
|
void Application::updateWindowTitle() const {
|
||||||
|
|
||||||
QString buildVersion = " (build " + applicationVersion() + ")";
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
|
|
||||||
QString connectionStatus = nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED) ";
|
QString buildVersion = " (build " + applicationVersion() + ")";
|
||||||
QString username = DependencyManager::get<AccountManager>()->getAccountInfo().getUsername();
|
|
||||||
|
QString loginStatus = accountManager->isLoggedIn() ? "" : " (NOT LOGGED IN)";
|
||||||
|
|
||||||
|
QString connectionStatus = nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED)";
|
||||||
|
QString username = accountManager->getAccountInfo().getUsername();
|
||||||
QString currentPlaceName = DependencyManager::get<AddressManager>()->getHost();
|
QString currentPlaceName = DependencyManager::get<AddressManager>()->getHost();
|
||||||
|
|
||||||
if (currentPlaceName.isEmpty()) {
|
if (currentPlaceName.isEmpty()) {
|
||||||
|
@ -4637,7 +4641,7 @@ void Application::updateWindowTitle() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString title = QString() + (!username.isEmpty() ? username + " @ " : QString())
|
QString title = QString() + (!username.isEmpty() ? username + " @ " : QString())
|
||||||
+ currentPlaceName + connectionStatus + buildVersion;
|
+ currentPlaceName + connectionStatus + loginStatus + buildVersion;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
// crashes with vs2013/win32
|
// crashes with vs2013/win32
|
||||||
|
|
|
@ -867,6 +867,10 @@ void AudioClient::handleLocalEchoAndReverb(QByteArray& inputByteArray) {
|
||||||
|
|
||||||
void AudioClient::handleAudioInput() {
|
void AudioClient::handleAudioInput() {
|
||||||
|
|
||||||
|
if (!_inputDevice) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// input samples required to produce exactly NETWORK_FRAME_SAMPLES of output
|
// input samples required to produce exactly NETWORK_FRAME_SAMPLES of output
|
||||||
const int inputSamplesRequired = (_inputToNetworkResampler ?
|
const int inputSamplesRequired = (_inputToNetworkResampler ?
|
||||||
_inputToNetworkResampler->getMinInput(AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL) :
|
_inputToNetworkResampler->getMinInput(AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL) :
|
||||||
|
|
|
@ -192,6 +192,11 @@ void GLBackend::resetResourceStage() {
|
||||||
|
|
||||||
void GLBackend::do_setResourceTexture(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setResourceTexture(const Batch& batch, size_t paramOffset) {
|
||||||
GLuint slot = batch._params[paramOffset + 1]._uint;
|
GLuint slot = batch._params[paramOffset + 1]._uint;
|
||||||
|
if (slot >= (GLuint) MAX_NUM_RESOURCE_TEXTURES) {
|
||||||
|
// "GLBackend::do_setResourceTexture: Trying to set a resource Texture at slot #" + slot + " which doesn't exist. MaxNumResourceTextures = " + getMaxNumResourceTextures());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
TexturePointer resourceTexture = batch._textures.get(batch._params[paramOffset + 0]._uint);
|
TexturePointer resourceTexture = batch._textures.get(batch._params[paramOffset + 0]._uint);
|
||||||
|
|
||||||
if (!resourceTexture) {
|
if (!resourceTexture) {
|
||||||
|
|
|
@ -11,10 +11,20 @@
|
||||||
|
|
||||||
#include "AssetResourceRequest.h"
|
#include "AssetResourceRequest.h"
|
||||||
|
|
||||||
|
#include <QtCore/QLoggingCategory>
|
||||||
|
|
||||||
#include "AssetClient.h"
|
#include "AssetClient.h"
|
||||||
#include "AssetUtils.h"
|
#include "AssetUtils.h"
|
||||||
#include "MappingRequest.h"
|
#include "MappingRequest.h"
|
||||||
#include <QtCore/qloggingcategory.h>
|
#include "NetworkLogging.h"
|
||||||
|
|
||||||
|
static const int DOWNLOAD_PROGRESS_LOG_INTERVAL_SECONDS = 5;
|
||||||
|
|
||||||
|
AssetResourceRequest::AssetResourceRequest(const QUrl& url) :
|
||||||
|
ResourceRequest(url)
|
||||||
|
{
|
||||||
|
_lastProgressDebug = p_high_resolution_clock::now() - std::chrono::seconds(DOWNLOAD_PROGRESS_LOG_INTERVAL_SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
AssetResourceRequest::~AssetResourceRequest() {
|
AssetResourceRequest::~AssetResourceRequest() {
|
||||||
if (_assetMappingRequest) {
|
if (_assetMappingRequest) {
|
||||||
|
@ -24,10 +34,6 @@ AssetResourceRequest::~AssetResourceRequest() {
|
||||||
if (_assetRequest) {
|
if (_assetRequest) {
|
||||||
_assetRequest->deleteLater();
|
_assetRequest->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_sendTimer) {
|
|
||||||
cleanupTimer();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AssetResourceRequest::urlIsAssetHash() const {
|
bool AssetResourceRequest::urlIsAssetHash() const {
|
||||||
|
@ -37,24 +43,6 @@ bool AssetResourceRequest::urlIsAssetHash() const {
|
||||||
return hashRegex.exactMatch(_url.toString());
|
return hashRegex.exactMatch(_url.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssetResourceRequest::setupTimer() {
|
|
||||||
Q_ASSERT(!_sendTimer);
|
|
||||||
static const int TIMEOUT_MS = 2000;
|
|
||||||
|
|
||||||
_sendTimer = new QTimer(this);
|
|
||||||
connect(_sendTimer, &QTimer::timeout, this, &AssetResourceRequest::onTimeout);
|
|
||||||
|
|
||||||
_sendTimer->setSingleShot(true);
|
|
||||||
_sendTimer->start(TIMEOUT_MS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AssetResourceRequest::cleanupTimer() {
|
|
||||||
Q_ASSERT(_sendTimer);
|
|
||||||
disconnect(_sendTimer, 0, this, 0);
|
|
||||||
_sendTimer->deleteLater();
|
|
||||||
_sendTimer = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AssetResourceRequest::doSend() {
|
void AssetResourceRequest::doSend() {
|
||||||
// We'll either have a hash or an ATP path to a file (that maps to a hash)
|
// We'll either have a hash or an ATP path to a file (that maps to a hash)
|
||||||
if (urlIsAssetHash()) {
|
if (urlIsAssetHash()) {
|
||||||
|
@ -81,8 +69,6 @@ void AssetResourceRequest::requestMappingForPath(const AssetPath& path) {
|
||||||
Q_ASSERT(_state == InProgress);
|
Q_ASSERT(_state == InProgress);
|
||||||
Q_ASSERT(request == _assetMappingRequest);
|
Q_ASSERT(request == _assetMappingRequest);
|
||||||
|
|
||||||
cleanupTimer();
|
|
||||||
|
|
||||||
switch (request->getError()) {
|
switch (request->getError()) {
|
||||||
case MappingRequest::NoError:
|
case MappingRequest::NoError:
|
||||||
// we have no error, we should have a resulting hash - use that to send of a request for that asset
|
// we have no error, we should have a resulting hash - use that to send of a request for that asset
|
||||||
|
@ -118,7 +104,6 @@ void AssetResourceRequest::requestMappingForPath(const AssetPath& path) {
|
||||||
_assetMappingRequest = nullptr;
|
_assetMappingRequest = nullptr;
|
||||||
});
|
});
|
||||||
|
|
||||||
setupTimer();
|
|
||||||
_assetMappingRequest->start();
|
_assetMappingRequest->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,8 +118,6 @@ void AssetResourceRequest::requestHash(const AssetHash& hash) {
|
||||||
Q_ASSERT(_state == InProgress);
|
Q_ASSERT(_state == InProgress);
|
||||||
Q_ASSERT(req == _assetRequest);
|
Q_ASSERT(req == _assetRequest);
|
||||||
Q_ASSERT(req->getState() == AssetRequest::Finished);
|
Q_ASSERT(req->getState() == AssetRequest::Finished);
|
||||||
|
|
||||||
cleanupTimer();
|
|
||||||
|
|
||||||
switch (req->getError()) {
|
switch (req->getError()) {
|
||||||
case AssetRequest::Error::NoError:
|
case AssetRequest::Error::NoError:
|
||||||
|
@ -162,35 +145,29 @@ void AssetResourceRequest::requestHash(const AssetHash& hash) {
|
||||||
_assetRequest = nullptr;
|
_assetRequest = nullptr;
|
||||||
});
|
});
|
||||||
|
|
||||||
setupTimer();
|
|
||||||
_assetRequest->start();
|
_assetRequest->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssetResourceRequest::onDownloadProgress(qint64 bytesReceived, qint64 bytesTotal) {
|
void AssetResourceRequest::onDownloadProgress(qint64 bytesReceived, qint64 bytesTotal) {
|
||||||
Q_ASSERT(_state == InProgress);
|
Q_ASSERT(_state == InProgress);
|
||||||
|
|
||||||
// We've received data, so reset the timer
|
|
||||||
_sendTimer->start();
|
|
||||||
|
|
||||||
emit progress(bytesReceived, bytesTotal);
|
emit progress(bytesReceived, bytesTotal);
|
||||||
|
|
||||||
|
auto now = p_high_resolution_clock::now();
|
||||||
|
|
||||||
|
// if we haven't received the full asset check if it is time to output progress to log
|
||||||
|
// we do so every X seconds to assist with ATP download tracking
|
||||||
|
|
||||||
|
if (bytesReceived != bytesTotal
|
||||||
|
&& now - _lastProgressDebug > std::chrono::seconds(DOWNLOAD_PROGRESS_LOG_INTERVAL_SECONDS)) {
|
||||||
|
|
||||||
|
int percentage = roundf((float) bytesReceived / (float) bytesTotal * 100.0f);
|
||||||
|
|
||||||
|
qCDebug(networking).nospace() << "Progress for " << _url.path() << " - "
|
||||||
|
<< bytesReceived << " of " << bytesTotal << " bytes - " << percentage << "%";
|
||||||
|
|
||||||
|
_lastProgressDebug = now;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssetResourceRequest::onTimeout() {
|
|
||||||
if (_state == InProgress) {
|
|
||||||
qWarning() << "Asset request timed out: " << _url;
|
|
||||||
if (_assetRequest) {
|
|
||||||
disconnect(_assetRequest, 0, this, 0);
|
|
||||||
_assetRequest->deleteLater();
|
|
||||||
_assetRequest = nullptr;
|
|
||||||
}
|
|
||||||
if (_assetMappingRequest) {
|
|
||||||
disconnect(_assetMappingRequest, 0, this, 0);
|
|
||||||
_assetMappingRequest->deleteLater();
|
|
||||||
_assetMappingRequest = nullptr;
|
|
||||||
}
|
|
||||||
_result = Timeout;
|
|
||||||
_state = Finished;
|
|
||||||
emit finished();
|
|
||||||
}
|
|
||||||
cleanupTimer();
|
|
||||||
}
|
|
||||||
|
|
|
@ -14,13 +14,15 @@
|
||||||
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
|
#include <PortableHighResolutionClock.h>
|
||||||
|
|
||||||
#include "AssetRequest.h"
|
#include "AssetRequest.h"
|
||||||
#include "ResourceRequest.h"
|
#include "ResourceRequest.h"
|
||||||
|
|
||||||
class AssetResourceRequest : public ResourceRequest {
|
class AssetResourceRequest : public ResourceRequest {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AssetResourceRequest(const QUrl& url) : ResourceRequest(url) { }
|
AssetResourceRequest(const QUrl& url);
|
||||||
virtual ~AssetResourceRequest() override;
|
virtual ~AssetResourceRequest() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -28,21 +30,17 @@ protected:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
|
void onDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
|
||||||
void onTimeout();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupTimer();
|
|
||||||
void cleanupTimer();
|
|
||||||
|
|
||||||
bool urlIsAssetHash() const;
|
bool urlIsAssetHash() const;
|
||||||
|
|
||||||
void requestMappingForPath(const AssetPath& path);
|
void requestMappingForPath(const AssetPath& path);
|
||||||
void requestHash(const AssetHash& hash);
|
void requestHash(const AssetHash& hash);
|
||||||
|
|
||||||
QTimer* _sendTimer { nullptr };
|
|
||||||
|
|
||||||
GetMappingRequest* _assetMappingRequest { nullptr };
|
GetMappingRequest* _assetMappingRequest { nullptr };
|
||||||
AssetRequest* _assetRequest { nullptr };
|
AssetRequest* _assetRequest { nullptr };
|
||||||
|
|
||||||
|
p_high_resolution_clock::time_point _lastProgressDebug;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -54,7 +54,7 @@ void ReceivedMessage::appendPacket(NLPacket& packet) {
|
||||||
"We should not be appending to a complete message");
|
"We should not be appending to a complete message");
|
||||||
|
|
||||||
// Limit progress signal to every X packets
|
// Limit progress signal to every X packets
|
||||||
const int EMIT_PROGRESS_EVERY_X_PACKETS = 100;
|
const int EMIT_PROGRESS_EVERY_X_PACKETS = 50;
|
||||||
|
|
||||||
++_numPackets;
|
++_numPackets;
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ void OculusBaseDisplayPlugin::customizeContext() {
|
||||||
|
|
||||||
void OculusBaseDisplayPlugin::uncustomizeContext() {
|
void OculusBaseDisplayPlugin::uncustomizeContext() {
|
||||||
Parent::uncustomizeContext();
|
Parent::uncustomizeContext();
|
||||||
internalPresent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OculusBaseDisplayPlugin::internalActivate() {
|
bool OculusBaseDisplayPlugin::internalActivate() {
|
||||||
|
|
|
@ -469,7 +469,7 @@ var usersWindow = (function () {
|
||||||
|
|
||||||
Overlays.editOverlay(minimizeButton, {
|
Overlays.editOverlay(minimizeButton, {
|
||||||
x: windowLeft + WINDOW_WIDTH - WINDOW_MARGIN / 2 - MIN_MAX_BUTTON_WIDTH,
|
x: windowLeft + WINDOW_WIDTH - WINDOW_MARGIN / 2 - MIN_MAX_BUTTON_WIDTH,
|
||||||
y: windowTop + WINDOW_MARGIN / 2
|
y: windowTop + WINDOW_MARGIN
|
||||||
});
|
});
|
||||||
|
|
||||||
scrollbarBackgroundPosition.x = windowLeft + WINDOW_WIDTH - 0.5 * WINDOW_MARGIN - SCROLLBAR_BACKGROUND_WIDTH;
|
scrollbarBackgroundPosition.x = windowLeft + WINDOW_WIDTH - 0.5 * WINDOW_MARGIN - SCROLLBAR_BACKGROUND_WIDTH;
|
||||||
|
@ -559,34 +559,34 @@ var usersWindow = (function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
Overlays.editOverlay(windowHeading, {
|
Overlays.editOverlay(windowHeading, {
|
||||||
text: linesOfUsers.length > 0 ? "Users online" : "No users online"
|
text: isLoggedIn ? (linesOfUsers.length > 0 ? "Users online" : "No users online") : "Users online - log in to view"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateOverlayVisibility() {
|
function updateOverlayVisibility() {
|
||||||
Overlays.editOverlay(windowBorder, {
|
Overlays.editOverlay(windowBorder, {
|
||||||
visible: isLoggedIn && isVisible && isBorderVisible
|
visible: isVisible && isBorderVisible
|
||||||
});
|
});
|
||||||
Overlays.editOverlay(windowPane, {
|
Overlays.editOverlay(windowPane, {
|
||||||
visible: isLoggedIn && isVisible
|
visible: isVisible
|
||||||
});
|
});
|
||||||
Overlays.editOverlay(windowHeading, {
|
Overlays.editOverlay(windowHeading, {
|
||||||
visible: isLoggedIn && isVisible
|
visible: isVisible
|
||||||
});
|
});
|
||||||
Overlays.editOverlay(minimizeButton, {
|
Overlays.editOverlay(minimizeButton, {
|
||||||
visible: isLoggedIn && isVisible
|
visible: isLoggedIn && isVisible
|
||||||
});
|
});
|
||||||
Overlays.editOverlay(scrollbarBackground, {
|
Overlays.editOverlay(scrollbarBackground, {
|
||||||
visible: isLoggedIn && isVisible && isUsingScrollbars && !isMinimized
|
visible: isVisible && isUsingScrollbars && !isMinimized
|
||||||
});
|
});
|
||||||
Overlays.editOverlay(scrollbarBar, {
|
Overlays.editOverlay(scrollbarBar, {
|
||||||
visible: isLoggedIn && isVisible && isUsingScrollbars && !isMinimized
|
visible: isVisible && isUsingScrollbars && !isMinimized
|
||||||
});
|
});
|
||||||
Overlays.editOverlay(friendsButton, {
|
Overlays.editOverlay(friendsButton, {
|
||||||
visible: isLoggedIn && isVisible && !isMinimized
|
visible: isVisible && !isMinimized
|
||||||
});
|
});
|
||||||
displayControl.setVisible(isLoggedIn && isVisible && !isMinimized);
|
displayControl.setVisible(isVisible && !isMinimized);
|
||||||
visibilityControl.setVisible(isLoggedIn && isVisible && !isMinimized);
|
visibilityControl.setVisible(isVisible && !isMinimized);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkLoggedIn() {
|
function checkLoggedIn() {
|
||||||
|
@ -594,6 +594,13 @@ var usersWindow = (function () {
|
||||||
|
|
||||||
isLoggedIn = Account.isLoggedIn();
|
isLoggedIn = Account.isLoggedIn();
|
||||||
if (isLoggedIn !== wasLoggedIn) {
|
if (isLoggedIn !== wasLoggedIn) {
|
||||||
|
if (wasLoggedIn) {
|
||||||
|
setMinimized(true);
|
||||||
|
calculateWindowHeight();
|
||||||
|
updateOverlayPositions();
|
||||||
|
updateUsersDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
updateOverlayVisibility();
|
updateOverlayVisibility();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1021,7 +1028,7 @@ var usersWindow = (function () {
|
||||||
color: WINDOW_HEADING_COLOR,
|
color: WINDOW_HEADING_COLOR,
|
||||||
alpha: WINDOW_HEADING_ALPHA,
|
alpha: WINDOW_HEADING_ALPHA,
|
||||||
backgroundAlpha: 0.0,
|
backgroundAlpha: 0.0,
|
||||||
text: "No users online",
|
text: "Users online",
|
||||||
font: WINDOW_FONT,
|
font: WINDOW_FONT,
|
||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue