From e5a87aa58cac66a5f8d8c834a6d2e3d08a45a058 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 10 Sep 2018 16:56:13 -0700 Subject: [PATCH 1/6] removing unused variables --- interface/src/Application.cpp | 2 -- interface/src/ConnectionMonitor.cpp | 2 -- libraries/networking/src/AddressManager.cpp | 2 -- 3 files changed, 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index de0aea3bc2..c20622f8f3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6421,7 +6421,6 @@ void Application::clearDomainAvatars() { void Application::domainURLChanged(QUrl domainURL) { // disable physics until we have enough information about our new location to not cause craziness. resetPhysicsReadyInformation(); - auto urlStr = domainURL.toString().toStdString(); setIsServerlessMode(domainURL.scheme() != URL_SCHEME_HIFI); if (isServerlessMode()) { loadServerlessDomain(domainURL); @@ -6432,7 +6431,6 @@ void Application::domainURLChanged(QUrl domainURL) { void Application::goToErrorDomainURL(QUrl errorDomainURL) { // disable physics until we have enough information about our new location to not cause craziness. resetPhysicsReadyInformation(); - auto urlStr = errorDomainURL.toString().toStdString(); setIsServerlessMode(errorDomainURL.scheme() != URL_SCHEME_HIFI); if (isServerlessMode()) { loadServerlessDomain(errorDomainURL, true); diff --git a/interface/src/ConnectionMonitor.cpp b/interface/src/ConnectionMonitor.cpp index 7d535d9eaf..2407e1bfdf 100644 --- a/interface/src/ConnectionMonitor.cpp +++ b/interface/src/ConnectionMonitor.cpp @@ -38,7 +38,6 @@ void ConnectionMonitor::init() { connect(&_timer, &QTimer::timeout, this, []() { qDebug() << "ConnectionMonitor: Showing connection failure window"; - //DependencyManager::get()->setDomainConnectionFailureVisibility(true); }); } @@ -48,5 +47,4 @@ void ConnectionMonitor::startTimer() { void ConnectionMonitor::stopTimer() { _timer.stop(); - //DependencyManager::get()->setDomainConnectionFailureVisibility(false); } diff --git a/libraries/networking/src/AddressManager.cpp b/libraries/networking/src/AddressManager.cpp index 6ebd516063..1244cd8828 100644 --- a/libraries/networking/src/AddressManager.cpp +++ b/libraries/networking/src/AddressManager.cpp @@ -48,7 +48,6 @@ QString AddressManager::getProtocol() const { QUrl AddressManager::currentAddress(bool domainOnly) const { QUrl hifiURL = _domainURL; - auto urlStr = hifiURL.toString().toStdString(); if (!domainOnly && hifiURL.scheme() == URL_SCHEME_HIFI) { hifiURL.setPath(currentPath()); @@ -156,7 +155,6 @@ void AddressManager::goForward() { void AddressManager::goToLastAddress() { // this should always return something as long as the URL isn't empty. - auto urlStr = _lastVisitedURL.toString().toStdString(); handleUrl(_lastVisitedURL, LookupTrigger::AttemptedRefresh); } From 2381d6bc027534dfab5fd560463c77fc0dac5f99 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 10 Sep 2018 17:07:49 -0700 Subject: [PATCH 2/6] using `REDIRECT_HIFI_ADDRESS` recycling existing, defined variable for error redirection --- interface/src/ConnectionMonitor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/ConnectionMonitor.cpp b/interface/src/ConnectionMonitor.cpp index 8463539bac..6578abf285 100644 --- a/interface/src/ConnectionMonitor.cpp +++ b/interface/src/ConnectionMonitor.cpp @@ -16,6 +16,7 @@ #include #include +#include #include // Because the connection monitor is created at startup, the time we wait on initial load @@ -40,7 +41,7 @@ void ConnectionMonitor::init() { connect(&_timer, &QTimer::timeout, this, []() { qDebug() << "ConnectionMonitor: Showing connection failure window"; - qApp->goToErrorDomainURL(ERROR_DOMAIN_URL); + qApp->goToErrorDomainURL(REDIRECT_HIFI_ADDRESS); }); } From c194c236f10c9201ee1c2def76294d0e84e0d6b9 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 10 Sep 2018 17:10:13 -0700 Subject: [PATCH 3/6] adding inlines --- interface/src/Application.cpp | 4 ---- interface/src/Application.h | 2 +- interface/src/octree/OctreePacketProcessor.cpp | 10 +--------- interface/src/octree/OctreePacketProcessor.h | 4 ++-- libraries/networking/src/AddressManager.cpp | 4 ++-- libraries/networking/src/AddressManager.h | 1 - 6 files changed, 6 insertions(+), 19 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c20622f8f3..296df7ccb0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3493,10 +3493,6 @@ bool Application::isServerlessMode() const { return false; } -bool Application::isInterstitialMode() const { - return _interstitialMode; -} - void Application::setIsInterstitialMode(bool interstitialMode) { if (_interstitialMode != interstitialMode) { _interstitialMode = interstitialMode; diff --git a/interface/src/Application.h b/interface/src/Application.h index c82dae3b05..de02b7f140 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -310,7 +310,7 @@ public: void saveNextPhysicsStats(QString filename); bool isServerlessMode() const; - bool isInterstitialMode() const; + bool isInterstitialMode() const { return _interstitialMode; } void replaceDomainContent(const QString& url); diff --git a/interface/src/octree/OctreePacketProcessor.cpp b/interface/src/octree/OctreePacketProcessor.cpp index e670153a77..a456958108 100644 --- a/interface/src/octree/OctreePacketProcessor.cpp +++ b/interface/src/octree/OctreePacketProcessor.cpp @@ -136,12 +136,4 @@ void OctreePacketProcessor::startEntitySequence() { bool OctreePacketProcessor::isLoadSequenceComplete() const { return _safeLanding->isLoadSequenceComplete(); -} - -bool OctreePacketProcessor::isEntitiesRenderReady() const { - return _safeLanding->entitiesRenderReady(); -} - -float OctreePacketProcessor::domainLoadingProgress() { - return _safeLanding->loadingProgressPercentage(); -} +} \ No newline at end of file diff --git a/interface/src/octree/OctreePacketProcessor.h b/interface/src/octree/OctreePacketProcessor.h index 71e22bf240..3aa23c49f3 100644 --- a/interface/src/octree/OctreePacketProcessor.h +++ b/interface/src/octree/OctreePacketProcessor.h @@ -27,8 +27,8 @@ public: void startEntitySequence(); bool isLoadSequenceComplete() const; - bool isEntitiesRenderReady() const; - float domainLoadingProgress(); + bool isEntitiesRenderReady() const { return _safeLanding->entitiesRenderReady(); } + float domainLoadingProgress() { return _safeLanding->loadingProgressPercentage(); } signals: void packetVersionMismatch(); diff --git a/libraries/networking/src/AddressManager.cpp b/libraries/networking/src/AddressManager.cpp index 1244cd8828..824e0d4515 100644 --- a/libraries/networking/src/AddressManager.cpp +++ b/libraries/networking/src/AddressManager.cpp @@ -48,7 +48,6 @@ QString AddressManager::getProtocol() const { QUrl AddressManager::currentAddress(bool domainOnly) const { QUrl hifiURL = _domainURL; - if (!domainOnly && hifiURL.scheme() == URL_SCHEME_HIFI) { hifiURL.setPath(currentPath()); } @@ -155,7 +154,8 @@ void AddressManager::goForward() { void AddressManager::goToLastAddress() { // this should always return something as long as the URL isn't empty. - handleUrl(_lastVisitedURL, LookupTrigger::AttemptedRefresh); + handleUrl(_lastVisitedURL, + LookupTrigger::AttemptedRefresh); } void AddressManager::storeCurrentAddress() { diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 7226e92451..e27504fc3a 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -149,7 +149,6 @@ public: UserInput, Back, Forward, - //Retry, StartupFromSettings, DomainPathResponse, Internal, From fa3097225bfb87d16638b2700bdbf9fce6c281de Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 10 Sep 2018 17:33:32 -0700 Subject: [PATCH 4/6] removing inlines - not allowed for unique_ptr --- interface/src/octree/OctreePacketProcessor.cpp | 10 +++++++++- interface/src/octree/OctreePacketProcessor.h | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/interface/src/octree/OctreePacketProcessor.cpp b/interface/src/octree/OctreePacketProcessor.cpp index a456958108..e670153a77 100644 --- a/interface/src/octree/OctreePacketProcessor.cpp +++ b/interface/src/octree/OctreePacketProcessor.cpp @@ -136,4 +136,12 @@ void OctreePacketProcessor::startEntitySequence() { bool OctreePacketProcessor::isLoadSequenceComplete() const { return _safeLanding->isLoadSequenceComplete(); -} \ No newline at end of file +} + +bool OctreePacketProcessor::isEntitiesRenderReady() const { + return _safeLanding->entitiesRenderReady(); +} + +float OctreePacketProcessor::domainLoadingProgress() { + return _safeLanding->loadingProgressPercentage(); +} diff --git a/interface/src/octree/OctreePacketProcessor.h b/interface/src/octree/OctreePacketProcessor.h index 3aa23c49f3..71e22bf240 100644 --- a/interface/src/octree/OctreePacketProcessor.h +++ b/interface/src/octree/OctreePacketProcessor.h @@ -27,8 +27,8 @@ public: void startEntitySequence(); bool isLoadSequenceComplete() const; - bool isEntitiesRenderReady() const { return _safeLanding->entitiesRenderReady(); } - float domainLoadingProgress() { return _safeLanding->loadingProgressPercentage(); } + bool isEntitiesRenderReady() const; + float domainLoadingProgress(); signals: void packetVersionMismatch(); From 28c3afca9dd59390544d3be34e40eb69ba2289c0 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 10 Sep 2018 17:40:35 -0700 Subject: [PATCH 5/6] adding back inlines --- interface/src/octree/OctreePacketProcessor.cpp | 15 +-------------- interface/src/octree/OctreePacketProcessor.h | 11 +++++------ 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/interface/src/octree/OctreePacketProcessor.cpp b/interface/src/octree/OctreePacketProcessor.cpp index e670153a77..790cd235d8 100644 --- a/interface/src/octree/OctreePacketProcessor.cpp +++ b/interface/src/octree/OctreePacketProcessor.cpp @@ -16,7 +16,6 @@ #include "Application.h" #include "Menu.h" #include "SceneScriptingInterface.h" -#include "SafeLanding.h" OctreePacketProcessor::OctreePacketProcessor(): _safeLanding(new SafeLanding()) @@ -132,16 +131,4 @@ void OctreePacketProcessor::processPacket(QSharedPointer messag void OctreePacketProcessor::startEntitySequence() { _safeLanding->startEntitySequence(qApp->getEntities()); -} - -bool OctreePacketProcessor::isLoadSequenceComplete() const { - return _safeLanding->isLoadSequenceComplete(); -} - -bool OctreePacketProcessor::isEntitiesRenderReady() const { - return _safeLanding->entitiesRenderReady(); -} - -float OctreePacketProcessor::domainLoadingProgress() { - return _safeLanding->loadingProgressPercentage(); -} +} \ No newline at end of file diff --git a/interface/src/octree/OctreePacketProcessor.h b/interface/src/octree/OctreePacketProcessor.h index 71e22bf240..627bf9b66a 100644 --- a/interface/src/octree/OctreePacketProcessor.h +++ b/interface/src/octree/OctreePacketProcessor.h @@ -15,7 +15,7 @@ #include #include -class SafeLanding; +#include "SafeLanding.h" /// Handles processing of incoming voxel packets for the interface application. As with other ReceivedPacketProcessor classes /// the user is responsible for reading inbound packets and adding them to the processing queue by calling queueReceivedPacket() @@ -26,10 +26,9 @@ public: ~OctreePacketProcessor(); void startEntitySequence(); - bool isLoadSequenceComplete() const; - bool isEntitiesRenderReady() const; - float domainLoadingProgress(); - + bool isLoadSequenceComplete() const { return _safeLanding->isLoadSequenceComplete(); } + bool isEntitiesRenderReady() const { return _safeLanding->entitiesRenderReady(); } + float domainLoadingProgress() { return _safeLanding->loadingProgressPercentage(); } signals: void packetVersionMismatch(); @@ -42,4 +41,4 @@ private slots: private: std::unique_ptr _safeLanding; }; -#endif // hifi_OctreePacketProcessor_h +#endif // hifi_OctreePacketProcessor_h From 84cf40f8aa70b631326b81b8194b035b0bc6d289 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 11 Sep 2018 10:07:57 -0700 Subject: [PATCH 6/6] changing calculation of load percentage --- interface/src/octree/SafeLanding.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 6b7a0f582c..ef62b04a55 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -130,8 +130,7 @@ bool SafeLanding::isLoadSequenceComplete() { float SafeLanding::loadingProgressPercentage() { Locker lock(_lock); if (_maxTrackedEntityCount > 0) { - float trackedEntityCount = (float)_trackedEntitiesRenderStatus.size(); - return ((_maxTrackedEntityCount - trackedEntityCount) / _maxTrackedEntityCount); + return ((_maxTrackedEntityCount - _trackedEntitiesRenderStatus.size()) / (float)_maxTrackedEntityCount); } return 0.0f;