History

Merge branch 'master' into 21776

David Rowe committed 8 years ago

Commit 16aefea2 parents b1bda28 db2b79f238 files · +13371 −1178Browse files

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

Unified · Split

interface/src/Application.cpp+26−28
@@ -891,7 +891,7 @@ Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context); · 890 unmodified lines
891891
892892 Setting::Handle<int> sessionRunTime{ "sessionRunTime", 0 };
893893
894−const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 100.0f;
894+const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 70.0f;
895895 const float DEFAULT_DESKTOP_TABLET_SCALE_PERCENT = 75.0f;
896896 const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true;
897897 const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false;
@@ -981,6 +981,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 83 unmodified lines
981981 qInstallMessageHandler(messageHandler);
982982
983983 QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf");
984+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/fontawesome-webfont.ttf");
985+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/hifi-glyphs.ttf");
986+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/AnonymousPro-Regular.ttf");
987+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/FiraSans-Regular.ttf");
988+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/FiraSans-SemiBold.ttf");
989+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Light.ttf");
990+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Regular.ttf");
991+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Bold.ttf");
992+ QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-SemiBold.ttf");
984993 _window->setWindowTitle("High Fidelity Interface");
985994
986995 Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
@@ -1998,20 +2007,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1011 unmodified lines
19982007 connect(_window, SIGNAL(windowMinimizedChanged(bool)), this, SLOT(windowMinimizedChanged(bool)));
19992008 qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0);
20002009
2001− {
2002− PROFILE_RANGE(render, "Process Default Skybox");
2003− auto textureCache = DependencyManager::get<TextureCache>();
2004−
2005− QFileSelector fileSelector;
2006− fileSelector.setExtraSelectors(FileUtils::getFileSelectors());
2007− auto skyboxUrl = fileSelector.select(PathUtils::resourcesPath() + "images/Default-Sky-9-cubemap.ktx");
2008−
2009− _defaultSkyboxTexture = gpu::Texture::unserialize(skyboxUrl.toStdString());
2010− _defaultSkyboxAmbientTexture = _defaultSkyboxTexture;
2011−
2012− _defaultSkybox->setCubemap(_defaultSkyboxTexture);
2013− }
2014−
20152010 EntityTreeRenderer::setEntitiesShouldFadeFunction([this]() {
20162011 SharedNodePointer entityServerNode = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::EntityServer);
20172012 return entityServerNode && !isPhysicsEnabled();
@@ -2461,7 +2456,6 @@ void Application::initializeGL() { · 443 unmodified lines
24612456 DeadlockWatchdogThread::withPause([&] {
24622457 // Set up the render engine
24632458 render::CullFunctor cullFunctor = LODManager::shouldRender;
2464− static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
24652459 _renderEngine->addJob<UpdateSceneTask>("UpdateScene");
24662460 #ifndef Q_OS_ANDROID
24672461 _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED);
@@ -2681,7 +2675,6 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 213 unmodified lines
26812675 surfaceContext->setContextProperty("Overlays", &_overlays);
26822676 surfaceContext->setContextProperty("Window", DependencyManager::get<WindowScriptingInterface>().data());
26832677 surfaceContext->setContextProperty("MenuInterface", MenuScriptingInterface::getInstance());
2684− surfaceContext->setContextProperty("Stats", Stats::getInstance());
26852678 surfaceContext->setContextProperty("Settings", SettingsScriptingInterface::getInstance());
26862679 surfaceContext->setContextProperty("ScriptDiscoveryService", DependencyManager::get<ScriptEngines>().data());
26872680 surfaceContext->setContextProperty("AvatarBookmarks", DependencyManager::get<AvatarBookmarks>().data());
@@ -2711,7 +2704,6 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 23 unmodified lines
27112704
27122705 surfaceContext->setContextProperty("ApplicationCompositor", &getApplicationCompositor());
27132706
2714− surfaceContext->setContextProperty("AvatarInputs", AvatarInputs::getInstance());
27152707 surfaceContext->setContextProperty("Selection", DependencyManager::get<SelectionScriptingInterface>().data());
27162708 surfaceContext->setContextProperty("ContextOverlay", DependencyManager::get<ContextOverlayInterface>().data());
27172709 surfaceContext->setContextProperty("Wallet", DependencyManager::get<WalletScriptingInterface>().data());
@@ -2726,6 +2718,9 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 8 unmodified lines
27262718 void Application::onDesktopRootItemCreated(QQuickItem* rootItem) {
27272719 Stats::show();
27282720 AvatarInputs::show();
2721+ auto surfaceContext = DependencyManager::get<OffscreenUi>()->getSurfaceContext();
2722+ surfaceContext->setContextProperty("Stats", Stats::getInstance());
2723+ surfaceContext->setContextProperty("AvatarInputs", AvatarInputs::getInstance());
27292724 }
27302725
27312726 void Application::updateCamera(RenderArgs& renderArgs, float deltaTime) {
@@ -6148,6 +6143,8 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 3416 unmodified lines
61486143 scriptEngine->registerGlobalObject("Wallet", DependencyManager::get<WalletScriptingInterface>().data());
61496144 scriptEngine->registerGlobalObject("AddressManager", DependencyManager::get<AddressManager>().data());
61506145
6146+ scriptEngine->registerGlobalObject("App", this);
6147+
61516148 qScriptRegisterMetaType(scriptEngine.data(), OverlayIDtoScriptValue, OverlayIDfromScriptValue);
61526149
61536150 DependencyManager::get<PickScriptingInterface>()->registerMetaTypes(scriptEngine.data());
@@ -6633,17 +6630,17 @@ void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, boo · 479 unmodified lines
66336630
66346631 addAssetToWorldInfo(filename, "Adding " + mapping.mid(1) + " to the Asset Server.");
66356632
6636− addAssetToWorldWithNewMapping(path, mapping, 0);
6633+ addAssetToWorldWithNewMapping(path, mapping, 0, isZip, isBlocks);
66376634 }
66386635
6639−void Application::addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy) {
6636+void Application::addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy, bool isZip, bool isBlocks) {
66406637 auto request = DependencyManager::get<AssetClient>()->createGetMappingRequest(mapping);
66416638
66426639 QObject::connect(request, &GetMappingRequest::finished, this, [=](GetMappingRequest* request) mutable {
66436640 const int MAX_COPY_COUNT = 100; // Limit number of duplicate assets; recursion guard.
66446641 auto result = request->getError();
66456642 if (result == GetMappingRequest::NotFound) {
6646− addAssetToWorldUpload(filePath, mapping);
6643+ addAssetToWorldUpload(filePath, mapping, isZip, isBlocks);
66476644 } else if (result != GetMappingRequest::NoError) {
66486645 QString errorInfo = "Could not map asset name: "
66496646 + mapping.left(mapping.length() - QString::number(copy).length() - 1);
@@ -6655,7 +6652,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin · 5 unmodified lines
66556652 }
66566653 copy++;
66576654 mapping = mapping.insert(mapping.lastIndexOf("."), "-" + QString::number(copy));
6658− addAssetToWorldWithNewMapping(filePath, mapping, copy);
6655+ addAssetToWorldWithNewMapping(filePath, mapping, copy, isZip, isBlocks);
66596656 } else {
66606657 QString errorInfo = "Too many copies of asset name: "
66616658 + mapping.left(mapping.length() - QString::number(copy).length() - 1);
@@ -6668,7 +6665,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin · 6 unmodified lines
66686665 request->start();
66696666 }
66706667
6671−void Application::addAssetToWorldUpload(QString filePath, QString mapping) {
6668+void Application::addAssetToWorldUpload(QString filePath, QString mapping, bool isZip, bool isBlocks) {
66726669 qInfo(interfaceapp) << "Uploading" << filePath << "to Asset Server as" << mapping;
66736670 auto upload = DependencyManager::get<AssetClient>()->createUpload(filePath);
66746671 QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
@@ -6677,7 +6674,7 @@ void Application::addAssetToWorldUpload(QString filePath, QString mapping) { · 2 unmodified lines
66776674 qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
66786675 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
66796676 } else {
6680− addAssetToWorldSetMapping(filePath, mapping, hash);
6677+ addAssetToWorldSetMapping(filePath, mapping, hash, isZip, isBlocks);
66816678 }
66826679
66836680 // Remove temporary directory created by Clara.io market place download.
@@ -6694,7 +6691,7 @@ void Application::addAssetToWorldUpload(QString filePath, QString mapping) { · 10 unmodified lines
66946691 upload->start();
66956692 }
66966693
6697−void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash) {
6694+void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash, bool isZip, bool isBlocks) {
66986695 auto request = DependencyManager::get<AssetClient>()->createSetMappingRequest(mapping, hash);
66996696 connect(request, &SetMappingRequest::finished, this, [=](SetMappingRequest* request) mutable {
67006697 if (request->getError() != SetMappingRequest::NoError) {
@@ -6702,9 +6699,10 @@ void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, Q · 1 unmodified line
67026699 qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
67036700 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
67046701 } else {
6705− // to prevent files that aren't models from being loaded into world automatically
6706− if (filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION) ||
6707− filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) {
6702+ // to prevent files that aren't models or texture files from being loaded into world automatically
6703+ if ((filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION)) ||
6704+ ((filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) &&
6705+ ((!isBlocks) && (!isZip)))) {
67086706 addAssetToWorldAddEntity(filePath, mapping);
67096707 } else {
67106708 qCDebug(interfaceapp) << "Zipped contents are not supported entity files";

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