History

Merge branch 'master' of https://github.com/highfidelity/hifi into orange

samcake committed 9 years ago

Commit 96a10d22 parents 07e18eb e5602aa66 files · +3223 −627Browse files

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

Unified · Split

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