handle OVR Platform entitlement checks
Showing the changes to interface/src/Application.cpp (1 of 7 files). Show all
Unified · Split
| @@ -252,7 +252,7 @@ public: · 251 unmodified lines | ||
| 252 | 252 | static const unsigned long MAX_HEARTBEAT_AGE_USECS = 30 * USECS_PER_SECOND; |
| 253 | 253 | static const int WARNING_ELAPSED_HEARTBEAT = 500 * USECS_PER_MSEC; // warn if elapsed heartbeat average is large |
| 254 | 254 | static const int HEARTBEAT_SAMPLES = 100000; // ~5 seconds worth of samples |
| 255 | − | |
| 255 | + | |
| 256 | 256 | // Set the heartbeat on launch |
| 257 | 257 | DeadlockWatchdogThread() { |
| 258 | 258 | setObjectName("Deadlock Watchdog"); |
| @@ -616,7 +616,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 357 unmodified lines | ||
| 616 | 616 | _window->setWindowTitle("Interface"); |
| 617 | 617 | |
| 618 | 618 | Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us |
| 619 | − | |
| 619 | + | |
| 620 | 620 | auto nodeList = DependencyManager::get<NodeList>(); |
| 621 | 621 | |
| 622 | 622 | // Set up a watchdog thread to intentionally crash the application on deadlocks |
| @@ -637,6 +637,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 14 unmodified lines | ||
| 637 | 637 | qCDebug(interfaceapp) << "[VERSION] We will use DEVELOPMENT global services."; |
| 638 | 638 | #endif |
| 639 | 639 | |
| 640 | + // set the OCULUS_STORE property so the oculus plugin can know if we ran from the Oculus Store | |
| 641 | + static const QString OCULUS_STORE_ARG = "--oculus-store"; | |
| 642 | + setProperty(hifi::properties::OCULUS_STORE, arguments().indexOf(OCULUS_STORE_ARG) != -1); | |
| 640 | 643 | |
| 641 | 644 | static const QString NO_UPDATER_ARG = "--no-updater"; |
| 642 | 645 | static const bool noUpdater = arguments().indexOf(NO_UPDATER_ARG) != -1; |
| @@ -697,7 +700,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 54 unmodified lines | ||
| 697 | 700 | audioIO->setPositionGetter([]{ |
| 698 | 701 | auto avatarManager = DependencyManager::get<AvatarManager>(); |
| 699 | 702 | auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr; |
| 700 | − | |
| 703 | + | |
| 701 | 704 | return myAvatar ? myAvatar->getPositionForAudio() : Vectors::ZERO; |
| 702 | 705 | }); |
| 703 | 706 | audioIO->setOrientationGetter([]{ |
| @@ -880,7 +883,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 176 unmodified lines | ||
| 880 | 883 | #ifdef Q_OS_MAC |
| 881 | 884 | auto cursorTarget = _window; // OSX doesn't seem to provide for hiding the cursor only on the GL widget |
| 882 | 885 | #else |
| 883 | − // On windows and linux, hiding the top level cursor also means it's invisible when hovering over the | |
| 886 | + // On windows and linux, hiding the top level cursor also means it's invisible when hovering over the | |
| 884 | 887 | // window menu, which is a pain, so only hide it for the GL surface |
| 885 | 888 | auto cursorTarget = _glWidget; |
| 886 | 889 | #endif |
| @@ -1125,7 +1128,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 238 unmodified lines | ||
| 1125 | 1128 | loadSettings(); |
| 1126 | 1129 | |
| 1127 | 1130 | // Now that we've loaded the menu and thus switched to the previous display plugin |
| 1128 | − // we can unlock the desktop repositioning code, since all the positions will be | |
| 1131 | + // we can unlock the desktop repositioning code, since all the positions will be | |
| 1129 | 1132 | // relative to the desktop size for this plugin |
| 1130 | 1133 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 1131 | 1134 | offscreenUi->getDesktop()->setProperty("repositionLocked", false); |
| @@ -1598,7 +1601,7 @@ void Application::checkChangeCursor() { · 466 unmodified lines | ||
| 1598 | 1601 | #ifdef Q_OS_MAC |
| 1599 | 1602 | auto cursorTarget = _window; // OSX doesn't seem to provide for hiding the cursor only on the GL widget |
| 1600 | 1603 | #else |
| 1601 | − // On windows and linux, hiding the top level cursor also means it's invisible when hovering over the | |
| 1604 | + // On windows and linux, hiding the top level cursor also means it's invisible when hovering over the | |
| 1602 | 1605 | // window menu, which is a pain, so only hide it for the GL surface |
| 1603 | 1606 | auto cursorTarget = _glWidget; |
| 1604 | 1607 | #endif |
| @@ -1785,7 +1788,7 @@ Application::~Application() { · 180 unmodified lines | ||
| 1785 | 1788 | #endif |
| 1786 | 1789 | // The window takes ownership of the menu, so this has the side effect of destroying it. |
| 1787 | 1790 | _window->setMenuBar(nullptr); |
| 1788 | − | |
| 1791 | + | |
| 1789 | 1792 | _window->deleteLater(); |
| 1790 | 1793 | |
| 1791 | 1794 | // Can't log to file passed this point, FileLogger about to be deleted |
| @@ -1811,10 +1814,10 @@ void Application::initializeGL() { · 19 unmodified lines | ||
| 1811 | 1814 | |
| 1812 | 1815 | _glWidget->makeCurrent(); |
| 1813 | 1816 | gpu::Context::init<gpu::gl::GLBackend>(); |
| 1814 | − qApp->setProperty(hifi::properties::gl::MAKE_PROGRAM_CALLBACK, | |
| 1817 | + qApp->setProperty(hifi::properties::gl::MAKE_PROGRAM_CALLBACK, | |
| 1815 | 1818 | QVariant::fromValue((void*)(&gpu::gl::GLBackend::makeProgram))); |
| 1816 | 1819 | _gpuContext = std::make_shared<gpu::Context>(); |
| 1817 | − // The gpu context can make child contexts for transfers, so | |
| 1820 | + // The gpu context can make child contexts for transfers, so | |
| 1818 | 1821 | // we need to restore primary rendering context |
| 1819 | 1822 | _glWidget->makeCurrent(); |
| 1820 | 1823 | |
| @@ -2034,7 +2037,7 @@ void Application::paintGL() { · 213 unmodified lines | ||
| 2034 | 2037 | // FIXME not needed anymore? |
| 2035 | 2038 | _offscreenContext->makeCurrent(); |
| 2036 | 2039 | |
| 2037 | − // If a display plugin loses it's underlying support, it | |
| 2040 | + // If a display plugin loses it's underlying support, it | |
| 2038 | 2041 | // needs to be able to signal us to not use it |
| 2039 | 2042 | if (!displayPlugin->beginFrameRender(_frameCount)) { |
| 2040 | 2043 | _inPaint = false; |
| @@ -2846,7 +2849,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 805 unmodified lines | ||
| 2846 | 2849 | if (isMirrorChecked) { |
| 2847 | 2850 | |
| 2848 | 2851 | // if we got here without coming in from a non-Full Screen mirror case, then our |
| 2849 | − // _returnFromFullScreenMirrorTo is unknown. In that case we'll go to the old | |
| 2852 | + // _returnFromFullScreenMirrorTo is unknown. In that case we'll go to the old | |
| 2850 | 2853 | // behavior of returning to ThirdPerson |
| 2851 | 2854 | if (_returnFromFullScreenMirrorTo.isEmpty()) { |
| 2852 | 2855 | _returnFromFullScreenMirrorTo = MenuOption::ThirdPerson; |
| @@ -3020,7 +3023,7 @@ void Application::mouseMoveEvent(QMouseEvent* event) { · 167 unmodified lines | ||
| 3020 | 3023 | maybeToggleMenuVisible(event); |
| 3021 | 3024 | |
| 3022 | 3025 | auto& compositor = getApplicationCompositor(); |
| 3023 | − // if this is a real mouse event, and we're in HMD mode, then we should use it to move the | |
| 3026 | + // if this is a real mouse event, and we're in HMD mode, then we should use it to move the | |
| 3024 | 3027 | // compositor reticle |
| 3025 | 3028 | // handleRealMouseMoveEvent() will return true, if we shouldn't process the event further |
| 3026 | 3029 | if (!compositor.fakeEventActive() && compositor.handleRealMouseMoveEvent()) { |
| @@ -4109,7 +4112,7 @@ void Application::setKeyboardFocusEntity(EntityItemID entityItemID) { · 1082 unmodified lines | ||
| 4109 | 4112 | } |
| 4110 | 4113 | _lastAcceptedKeyPress = usecTimestampNow(); |
| 4111 | 4114 | |
| 4112 | − setKeyboardFocusHighlight(entity->getPosition(), entity->getRotation(), | |
| 4115 | + setKeyboardFocusHighlight(entity->getPosition(), entity->getRotation(), | |
| 4113 | 4116 | entity->getDimensions() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR); |
| 4114 | 4117 | } |
| 4115 | 4118 | } |
| @@ -4700,7 +4703,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 584 unmodified lines | ||
| 4700 | 4703 | _octreeQuery.setMaxQueryPacketsPerSecond(0); |
| 4701 | 4704 | } |
| 4702 | 4705 | |
| 4703 | − // if asked to forceResend, then set the query's position/orientation to be degenerate in a manner | |
| 4706 | + // if asked to forceResend, then set the query's position/orientation to be degenerate in a manner | |
| 4704 | 4707 | // that will cause our next query to be guarenteed to be different and the server will resend to us |
| 4705 | 4708 | if (forceResend) { |
| 4706 | 4709 | _octreeQuery.setCameraPosition(glm::vec3(-0.1, -0.1, -0.1)); |
| @@ -5833,7 +5836,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin · 1126 unmodified lines | ||
| 5833 | 5836 | mapping = mapping.insert(mapping.lastIndexOf("."), "-" + QString::number(copy)); |
| 5834 | 5837 | addAssetToWorldWithNewMapping(filePath, mapping, copy); |
| 5835 | 5838 | } else { |
| 5836 | − QString errorInfo = "Too many copies of asset name: " | |
| 5839 | + QString errorInfo = "Too many copies of asset name: " | |
| 5837 | 5840 | + mapping.left(mapping.length() - QString::number(copy).length() - 1); |
| 5838 | 5841 | qWarning(interfaceapp) << "Error downloading model: " + errorInfo; |
| 5839 | 5842 | addAssetToWorldError(filenameFromPath(filePath), errorInfo); |
| @@ -5900,7 +5903,7 @@ void Application::addAssetToWorldAddEntity(QString filePath, QString mapping) { · 60 unmodified lines | ||
| 5900 | 5903 | |
| 5901 | 5904 | // Note: Model dimensions are not available here; model is scaled per FBX mesh in RenderableModelEntityItem::update() later |
| 5902 | 5905 | // on. But FBX dimensions may be in cm, so we monitor for the dimension change and rescale again if warranted. |
| 5903 | − | |
| 5906 | + | |
| 5904 | 5907 | if (entityID == QUuid()) { |
| 5905 | 5908 | QString errorInfo = "Could not add model " + mapping + " to world."; |
| 5906 | 5909 | qWarning(interfaceapp) << "Could not add model to world: " + errorInfo; |
| @@ -6364,7 +6367,7 @@ glm::uvec2 Application::getCanvasSize() const { · 457 unmodified lines | ||
| 6364 | 6367 | } |
| 6365 | 6368 | |
| 6366 | 6369 | QRect Application::getRenderingGeometry() const { |
| 6367 | − auto geometry = _glWidget->geometry(); | |
| 6370 | + auto geometry = _glWidget->geometry(); | |
| 6368 | 6371 | auto topLeft = geometry.topLeft(); |
| 6369 | 6372 | auto topLeftScreen = _glWidget->mapToGlobal(topLeft); |
| 6370 | 6373 | geometry.moveTopLeft(topLeftScreen); |
| @@ -6727,8 +6730,8 @@ bool Application::makeRenderingContextCurrent() { · 356 unmodified lines | ||
| 6727 | 6730 | return _offscreenContext->makeCurrent(); |
| 6728 | 6731 | } |
| 6729 | 6732 | |
| 6730 | −bool Application::isForeground() const { | |
| 6731 | − return _isForeground && !_window->isMinimized(); | |
| 6733 | +bool Application::isForeground() const { | |
| 6734 | + return _isForeground && !_window->isMinimized(); | |
| 6732 | 6735 | } |
| 6733 | 6736 | |
| 6734 | 6737 | void Application::sendMousePressOnEntity(QUuid id, PointerEvent event) { |