History

Merge branch 'master' into 21396

David Rowe committed 9 years ago

Commit 9d0407c2 parents b26f5c5 8510b6049 files · +822 −255Browse files

Showing the changes to interface/src/Application.cpp (1 of 49 files). Show all

Unified · Split

interface/src/Application.cpp+31−8
@@ -214,7 +214,7 @@ static QTimer pingTimer; · 213 unmodified lines
214214
215215 static const int MAX_CONCURRENT_RESOURCE_DOWNLOADS = 16;
216216
217−// For processing on QThreadPool, we target a number of threads after reserving some
217+// For processing on QThreadPool, we target a number of threads after reserving some
218218 // based on how many are being consumed by the application and the display plugin. However,
219219 // we will never drop below the 'min' value
220220 static const int MIN_PROCESSING_THREAD_POOL_SIZE = 1;
@@ -888,6 +888,20 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 667 unmodified lines
888888 }
889889 ResourceCache::setRequestLimit(concurrentDownloads);
890890
891+ // perhaps override the avatar url. Since we will test later for validity
892+ // we don't need to do so here.
893+ QString avatarURL = getCmdOption(argc, constArgv, "--avatarURL");
894+ _avatarOverrideUrl = QUrl::fromUserInput(avatarURL);
895+
896+ // If someone specifies both --avatarURL and --replaceAvatarURL,
897+ // the replaceAvatarURL wins. So only set the _overrideUrl if this
898+ // does have a non-empty string.
899+ QString replaceURL = getCmdOption(argc, constArgv, "--replaceAvatarURL");
900+ if (!replaceURL.isEmpty()) {
901+ _avatarOverrideUrl = QUrl::fromUserInput(replaceURL);
902+ _saveAvatarOverrideUrl = true;
903+ }
904+
891905 _glWidget = new GLCanvas();
892906 getApplicationCompositor().setRenderingWidget(_glWidget);
893907 _window->setCentralWidget(_glWidget);
@@ -1277,7 +1291,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 383 unmodified lines
12771291 // Add periodic checks to send user activity data
12781292 static int CHECK_NEARBY_AVATARS_INTERVAL_MS = 10000;
12791293 static int NEARBY_AVATAR_RADIUS_METERS = 10;
1280−
1294+
12811295 // setup the stats interval depending on if the 1s faster hearbeat was requested
12821296 static const QString FAST_STATS_ARG = "--fast-heartbeat";
12831297 static int SEND_STATS_INTERVAL_MS = arguments().indexOf(FAST_STATS_ARG) != -1 ? 1000 : 10000;
@@ -1427,10 +1441,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 143 unmodified lines
14271441
14281442 _autoSwitchDisplayModeSupportedHMDPlugin = nullptr;
14291443 foreach(DisplayPluginPointer displayPlugin, PluginManager::getInstance()->getDisplayPlugins()) {
1430− if (displayPlugin->isHmd() &&
1444+ if (displayPlugin->isHmd() &&
14311445 displayPlugin->getSupportsAutoSwitch()) {
14321446 _autoSwitchDisplayModeSupportedHMDPlugin = displayPlugin;
1433− _autoSwitchDisplayModeSupportedHMDPluginName =
1447+ _autoSwitchDisplayModeSupportedHMDPluginName =
14341448 _autoSwitchDisplayModeSupportedHMDPlugin->getName();
14351449 _previousHMDWornStatus =
14361450 _autoSwitchDisplayModeSupportedHMDPlugin->isDisplayVisible();
@@ -1682,7 +1696,7 @@ void Application::onAboutToQuit() { · 245 unmodified lines
16821696 }
16831697
16841698 getActiveDisplayPlugin()->deactivate();
1685− if (_autoSwitchDisplayModeSupportedHMDPlugin
1699+ if (_autoSwitchDisplayModeSupportedHMDPlugin
16861700 && _autoSwitchDisplayModeSupportedHMDPlugin->isSessionActive()) {
16871701 _autoSwitchDisplayModeSupportedHMDPlugin->endSession();
16881702 }
@@ -1751,8 +1765,8 @@ void Application::cleanupBeforeQuit() { · 62 unmodified lines
17511765
17521766 // Cleanup all overlays after the scripts, as scripts might add more
17531767 _overlays.cleanupAllOverlays();
1754− // The cleanup process enqueues the transactions but does not process them. Calling this here will force the actual
1755− // removal of the items.
1768+ // The cleanup process enqueues the transactions but does not process them. Calling this here will force the actual
1769+ // removal of the items.
17561770 // See https://highfidelity.fogbugz.com/f/cases/5328
17571771 _main3DScene->processTransactionQueue();
17581772
@@ -5265,7 +5279,7 @@ void Application::clearDomainOctreeDetails() { · 3506 unmodified lines
52655279 skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT);
52665280
52675281 _recentlyClearedDomain = true;
5268−
5282+
52695283 DependencyManager::get<AnimationCache>()->clearUnusedResources();
52705284 DependencyManager::get<ModelCache>()->clearUnusedResources();
52715285 DependencyManager::get<SoundCache>()->clearUnusedResources();
@@ -5329,6 +5343,10 @@ void Application::nodeActivated(SharedNodePointer node) { · 57 unmodified lines
53295343 if (node->getType() == NodeType::AvatarMixer) {
53305344 // new avatar mixer, send off our identity packet on next update loop
53315345 // Reset skeletonModelUrl if the last server modified our choice.
5346+ // Override the avatar url (but not model name) here too.
5347+ if (_avatarOverrideUrl.isValid()) {
5348+ getMyAvatar()->useFullAvatarURL(_avatarOverrideUrl);
5349+ }
53325350 static const QUrl empty{};
53335351 if (getMyAvatar()->getFullAvatarURLFromPreferences() != getMyAvatar()->cannonicalSkeletonModelURL(empty)) {
53345352 getMyAvatar()->resetFullAvatarURL();
@@ -7083,3 +7101,8 @@ QUuid Application::getTabletFrameID() const { · 1748 unmodified lines
70837101 auto HMD = DependencyManager::get<HMDScriptingInterface>();
70847102 return HMD->getCurrentTabletFrameID();
70857103 }
7104+
7105+void Application::setAvatarOverrideUrl(const QUrl& url, bool save) {
7106+ _avatarOverrideUrl = url;
7107+ _saveAvatarOverrideUrl = save;
7108+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t