Showing the changes to interface/src/Application.cpp (1 of 49 files). Show all
Unified · Split
| @@ -214,7 +214,7 @@ static QTimer pingTimer; · 213 unmodified lines | ||
| 214 | 214 | |
| 215 | 215 | static const int MAX_CONCURRENT_RESOURCE_DOWNLOADS = 16; |
| 216 | 216 | |
| 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 | |
| 218 | 218 | // based on how many are being consumed by the application and the display plugin. However, |
| 219 | 219 | // we will never drop below the 'min' value |
| 220 | 220 | 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 | ||
| 888 | 888 | } |
| 889 | 889 | ResourceCache::setRequestLimit(concurrentDownloads); |
| 890 | 890 | |
| 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 | + | |
| 891 | 905 | _glWidget = new GLCanvas(); |
| 892 | 906 | getApplicationCompositor().setRenderingWidget(_glWidget); |
| 893 | 907 | _window->setCentralWidget(_glWidget); |
| @@ -1277,7 +1291,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 383 unmodified lines | ||
| 1277 | 1291 | // Add periodic checks to send user activity data |
| 1278 | 1292 | static int CHECK_NEARBY_AVATARS_INTERVAL_MS = 10000; |
| 1279 | 1293 | static int NEARBY_AVATAR_RADIUS_METERS = 10; |
| 1280 | − | |
| 1294 | + | |
| 1281 | 1295 | // setup the stats interval depending on if the 1s faster hearbeat was requested |
| 1282 | 1296 | static const QString FAST_STATS_ARG = "--fast-heartbeat"; |
| 1283 | 1297 | 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 | ||
| 1427 | 1441 | |
| 1428 | 1442 | _autoSwitchDisplayModeSupportedHMDPlugin = nullptr; |
| 1429 | 1443 | foreach(DisplayPluginPointer displayPlugin, PluginManager::getInstance()->getDisplayPlugins()) { |
| 1430 | − if (displayPlugin->isHmd() && | |
| 1444 | + if (displayPlugin->isHmd() && | |
| 1431 | 1445 | displayPlugin->getSupportsAutoSwitch()) { |
| 1432 | 1446 | _autoSwitchDisplayModeSupportedHMDPlugin = displayPlugin; |
| 1433 | − _autoSwitchDisplayModeSupportedHMDPluginName = | |
| 1447 | + _autoSwitchDisplayModeSupportedHMDPluginName = | |
| 1434 | 1448 | _autoSwitchDisplayModeSupportedHMDPlugin->getName(); |
| 1435 | 1449 | _previousHMDWornStatus = |
| 1436 | 1450 | _autoSwitchDisplayModeSupportedHMDPlugin->isDisplayVisible(); |
| @@ -1682,7 +1696,7 @@ void Application::onAboutToQuit() { · 245 unmodified lines | ||
| 1682 | 1696 | } |
| 1683 | 1697 | |
| 1684 | 1698 | getActiveDisplayPlugin()->deactivate(); |
| 1685 | − if (_autoSwitchDisplayModeSupportedHMDPlugin | |
| 1699 | + if (_autoSwitchDisplayModeSupportedHMDPlugin | |
| 1686 | 1700 | && _autoSwitchDisplayModeSupportedHMDPlugin->isSessionActive()) { |
| 1687 | 1701 | _autoSwitchDisplayModeSupportedHMDPlugin->endSession(); |
| 1688 | 1702 | } |
| @@ -1751,8 +1765,8 @@ void Application::cleanupBeforeQuit() { · 62 unmodified lines | ||
| 1751 | 1765 | |
| 1752 | 1766 | // Cleanup all overlays after the scripts, as scripts might add more |
| 1753 | 1767 | _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. | |
| 1756 | 1770 | // See https://highfidelity.fogbugz.com/f/cases/5328 |
| 1757 | 1771 | _main3DScene->processTransactionQueue(); |
| 1758 | 1772 | |
| @@ -5265,7 +5279,7 @@ void Application::clearDomainOctreeDetails() { · 3506 unmodified lines | ||
| 5265 | 5279 | skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT); |
| 5266 | 5280 | |
| 5267 | 5281 | _recentlyClearedDomain = true; |
| 5268 | − | |
| 5282 | + | |
| 5269 | 5283 | DependencyManager::get<AnimationCache>()->clearUnusedResources(); |
| 5270 | 5284 | DependencyManager::get<ModelCache>()->clearUnusedResources(); |
| 5271 | 5285 | DependencyManager::get<SoundCache>()->clearUnusedResources(); |
| @@ -5329,6 +5343,10 @@ void Application::nodeActivated(SharedNodePointer node) { · 57 unmodified lines | ||
| 5329 | 5343 | if (node->getType() == NodeType::AvatarMixer) { |
| 5330 | 5344 | // new avatar mixer, send off our identity packet on next update loop |
| 5331 | 5345 | // 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 | + } | |
| 5332 | 5350 | static const QUrl empty{}; |
| 5333 | 5351 | if (getMyAvatar()->getFullAvatarURLFromPreferences() != getMyAvatar()->cannonicalSkeletonModelURL(empty)) { |
| 5334 | 5352 | getMyAvatar()->resetFullAvatarURL(); |
| @@ -7083,3 +7101,8 @@ QUuid Application::getTabletFrameID() const { · 1748 unmodified lines | ||
| 7083 | 7101 | auto HMD = DependencyManager::get<HMDScriptingInterface>(); |
| 7084 | 7102 | return HMD->getCurrentTabletFrameID(); |
| 7085 | 7103 | } |
| 7104 | + | |
| 7105 | +void Application::setAvatarOverrideUrl(const QUrl& url, bool save) { | |
| 7106 | + _avatarOverrideUrl = url; | |
| 7107 | + _saveAvatarOverrideUrl = save; | |
| 7108 | +} | |