Showing the changes to interface/src/Application.cpp (1 of 66 files). Show all
Unified · Split
| @@ -109,6 +109,7 @@ · 108 unmodified lines | ||
| 109 | 109 | #include <plugins/PluginManager.h> |
| 110 | 110 | #include <plugins/PluginUtils.h> |
| 111 | 111 | #include <plugins/SteamClientPlugin.h> |
| 112 | +#include <plugins/InputConfiguration.h> | |
| 112 | 113 | #include <RecordingScriptingInterface.h> |
| 113 | 114 | #include <RenderableWebEntityItem.h> |
| 114 | 115 | #include <UpdateSceneTask.h> |
| @@ -211,7 +212,7 @@ static QTimer pingTimer; · 96 unmodified lines | ||
| 211 | 212 | |
| 212 | 213 | static const int MAX_CONCURRENT_RESOURCE_DOWNLOADS = 16; |
| 213 | 214 | |
| 214 | −// For processing on QThreadPool, we target a number of threads after reserving some | |
| 215 | +// For processing on QThreadPool, we target a number of threads after reserving some | |
| 215 | 216 | // based on how many are being consumed by the application and the display plugin. However, |
| 216 | 217 | // we will never drop below the 'min' value |
| 217 | 218 | static const int MIN_PROCESSING_THREAD_POOL_SIZE = 1; |
| @@ -536,6 +537,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 318 unmodified lines | ||
| 536 | 537 | DependencyManager::set<HMDScriptingInterface>(); |
| 537 | 538 | DependencyManager::set<ResourceScriptingInterface>(); |
| 538 | 539 | DependencyManager::set<TabletScriptingInterface>(); |
| 540 | + DependencyManager::set<InputConfiguration>(); | |
| 539 | 541 | DependencyManager::set<ToolbarScriptingInterface>(); |
| 540 | 542 | DependencyManager::set<UserActivityLoggerScriptingInterface>(); |
| 541 | 543 | DependencyManager::set<AssetMappingsScriptingInterface>(); |
| @@ -884,6 +886,20 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 342 unmodified lines | ||
| 884 | 886 | } |
| 885 | 887 | ResourceCache::setRequestLimit(concurrentDownloads); |
| 886 | 888 | |
| 889 | + // perhaps override the avatar url. Since we will test later for validity | |
| 890 | + // we don't need to do so here. | |
| 891 | + QString avatarURL = getCmdOption(argc, constArgv, "--avatarURL"); | |
| 892 | + _avatarOverrideUrl = QUrl::fromUserInput(avatarURL); | |
| 893 | + | |
| 894 | + // If someone specifies both --avatarURL and --replaceAvatarURL, | |
| 895 | + // the replaceAvatarURL wins. So only set the _overrideUrl if this | |
| 896 | + // does have a non-empty string. | |
| 897 | + QString replaceURL = getCmdOption(argc, constArgv, "--replaceAvatarURL"); | |
| 898 | + if (!replaceURL.isEmpty()) { | |
| 899 | + _avatarOverrideUrl = QUrl::fromUserInput(replaceURL); | |
| 900 | + _saveAvatarOverrideUrl = true; | |
| 901 | + } | |
| 902 | + | |
| 887 | 903 | _glWidget = new GLCanvas(); |
| 888 | 904 | getApplicationCompositor().setRenderingWidget(_glWidget); |
| 889 | 905 | _window->setCentralWidget(_glWidget); |
| @@ -1273,7 +1289,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 383 unmodified lines | ||
| 1273 | 1289 | // Add periodic checks to send user activity data |
| 1274 | 1290 | static int CHECK_NEARBY_AVATARS_INTERVAL_MS = 10000; |
| 1275 | 1291 | static int NEARBY_AVATAR_RADIUS_METERS = 10; |
| 1276 | − | |
| 1292 | + | |
| 1277 | 1293 | // setup the stats interval depending on if the 1s faster hearbeat was requested |
| 1278 | 1294 | static const QString FAST_STATS_ARG = "--fast-heartbeat"; |
| 1279 | 1295 | static int SEND_STATS_INTERVAL_MS = arguments().indexOf(FAST_STATS_ARG) != -1 ? 1000 : 10000; |
| @@ -1423,10 +1439,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 143 unmodified lines | ||
| 1423 | 1439 | |
| 1424 | 1440 | _autoSwitchDisplayModeSupportedHMDPlugin = nullptr; |
| 1425 | 1441 | foreach(DisplayPluginPointer displayPlugin, PluginManager::getInstance()->getDisplayPlugins()) { |
| 1426 | − if (displayPlugin->isHmd() && | |
| 1442 | + if (displayPlugin->isHmd() && | |
| 1427 | 1443 | displayPlugin->getSupportsAutoSwitch()) { |
| 1428 | 1444 | _autoSwitchDisplayModeSupportedHMDPlugin = displayPlugin; |
| 1429 | − _autoSwitchDisplayModeSupportedHMDPluginName = | |
| 1445 | + _autoSwitchDisplayModeSupportedHMDPluginName = | |
| 1430 | 1446 | _autoSwitchDisplayModeSupportedHMDPlugin->getName(); |
| 1431 | 1447 | _previousHMDWornStatus = |
| 1432 | 1448 | _autoSwitchDisplayModeSupportedHMDPlugin->isDisplayVisible(); |
| @@ -1678,7 +1694,7 @@ void Application::onAboutToQuit() { · 245 unmodified lines | ||
| 1678 | 1694 | } |
| 1679 | 1695 | |
| 1680 | 1696 | getActiveDisplayPlugin()->deactivate(); |
| 1681 | − if (_autoSwitchDisplayModeSupportedHMDPlugin | |
| 1697 | + if (_autoSwitchDisplayModeSupportedHMDPlugin | |
| 1682 | 1698 | && _autoSwitchDisplayModeSupportedHMDPlugin->isSessionActive()) { |
| 1683 | 1699 | _autoSwitchDisplayModeSupportedHMDPlugin->endSession(); |
| 1684 | 1700 | } |
| @@ -1747,8 +1763,8 @@ void Application::cleanupBeforeQuit() { · 62 unmodified lines | ||
| 1747 | 1763 | |
| 1748 | 1764 | // Cleanup all overlays after the scripts, as scripts might add more |
| 1749 | 1765 | _overlays.cleanupAllOverlays(); |
| 1750 | − // The cleanup process enqueues the transactions but does not process them. Calling this here will force the actual | |
| 1751 | − // removal of the items. | |
| 1766 | + // The cleanup process enqueues the transactions but does not process them. Calling this here will force the actual | |
| 1767 | + // removal of the items. | |
| 1752 | 1768 | // See https://highfidelity.fogbugz.com/f/cases/5328 |
| 1753 | 1769 | _main3DScene->processTransactionQueue(); |
| 1754 | 1770 | |
| @@ -2023,6 +2039,7 @@ void Application::initializeUi() { · 268 unmodified lines | ||
| 2023 | 2039 | surfaceContext->setContextProperty("TextureCache", DependencyManager::get<TextureCache>().data()); |
| 2024 | 2040 | surfaceContext->setContextProperty("ModelCache", DependencyManager::get<ModelCache>().data()); |
| 2025 | 2041 | surfaceContext->setContextProperty("SoundCache", DependencyManager::get<SoundCache>().data()); |
| 2042 | + surfaceContext->setContextProperty("InputConfiguration", DependencyManager::get<InputConfiguration>().data()); | |
| 2026 | 2043 | |
| 2027 | 2044 | surfaceContext->setContextProperty("Account", AccountScriptingInterface::getInstance()); |
| 2028 | 2045 | surfaceContext->setContextProperty("Tablet", DependencyManager::get<TabletScriptingInterface>().data()); |
| @@ -5240,7 +5257,7 @@ void Application::clearDomainOctreeDetails() { · 3211 unmodified lines | ||
| 5240 | 5257 | skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT); |
| 5241 | 5258 | |
| 5242 | 5259 | _recentlyClearedDomain = true; |
| 5243 | − | |
| 5260 | + | |
| 5244 | 5261 | DependencyManager::get<AnimationCache>()->clearUnusedResources(); |
| 5245 | 5262 | DependencyManager::get<ModelCache>()->clearUnusedResources(); |
| 5246 | 5263 | DependencyManager::get<SoundCache>()->clearUnusedResources(); |
| @@ -5304,6 +5321,10 @@ void Application::nodeActivated(SharedNodePointer node) { · 57 unmodified lines | ||
| 5304 | 5321 | if (node->getType() == NodeType::AvatarMixer) { |
| 5305 | 5322 | // new avatar mixer, send off our identity packet on next update loop |
| 5306 | 5323 | // Reset skeletonModelUrl if the last server modified our choice. |
| 5324 | + // Override the avatar url (but not model name) here too. | |
| 5325 | + if (_avatarOverrideUrl.isValid()) { | |
| 5326 | + getMyAvatar()->useFullAvatarURL(_avatarOverrideUrl); | |
| 5327 | + } | |
| 5307 | 5328 | static const QUrl empty{}; |
| 5308 | 5329 | if (getMyAvatar()->getFullAvatarURLFromPreferences() != getMyAvatar()->cannonicalSkeletonModelURL(empty)) { |
| 5309 | 5330 | getMyAvatar()->resetFullAvatarURL(); |
| @@ -7058,3 +7079,8 @@ QUuid Application::getTabletFrameID() const { · 1748 unmodified lines | ||
| 7058 | 7079 | auto HMD = DependencyManager::get<HMDScriptingInterface>(); |
| 7059 | 7080 | return HMD->getCurrentTabletFrameID(); |
| 7060 | 7081 | } |
| 7082 | + | |
| 7083 | +void Application::setAvatarOverrideUrl(const QUrl& url, bool save) { | |
| 7084 | + _avatarOverrideUrl = url; | |
| 7085 | + _saveAvatarOverrideUrl = save; | |
| 7086 | +} | |