History

Merge pull request #9318 from birarda/ovr-platform-entitlement

handle OVR Platform entitlement checks

Stephen Birarda committed 9 years ago

Commit 1993e352 parents d2c7342 8f279ce7 files · +171 −35Browse files

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

Unified · Split

interface/src/Application.cpp+22−19
@@ -252,7 +252,7 @@ public: · 251 unmodified lines
252252 static const unsigned long MAX_HEARTBEAT_AGE_USECS = 30 * USECS_PER_SECOND;
253253 static const int WARNING_ELAPSED_HEARTBEAT = 500 * USECS_PER_MSEC; // warn if elapsed heartbeat average is large
254254 static const int HEARTBEAT_SAMPLES = 100000; // ~5 seconds worth of samples
255−
255+
256256 // Set the heartbeat on launch
257257 DeadlockWatchdogThread() {
258258 setObjectName("Deadlock Watchdog");
@@ -616,7 +616,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 357 unmodified lines
616616 _window->setWindowTitle("Interface");
617617
618618 Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
619−
619+
620620 auto nodeList = DependencyManager::get<NodeList>();
621621
622622 // 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
637637 qCDebug(interfaceapp) << "[VERSION] We will use DEVELOPMENT global services.";
638638 #endif
639639
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);
640643
641644 static const QString NO_UPDATER_ARG = "--no-updater";
642645 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
697700 audioIO->setPositionGetter([]{
698701 auto avatarManager = DependencyManager::get<AvatarManager>();
699702 auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr;
700−
703+
701704 return myAvatar ? myAvatar->getPositionForAudio() : Vectors::ZERO;
702705 });
703706 audioIO->setOrientationGetter([]{
@@ -880,7 +883,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 176 unmodified lines
880883 #ifdef Q_OS_MAC
881884 auto cursorTarget = _window; // OSX doesn't seem to provide for hiding the cursor only on the GL widget
882885 #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
884887 // window menu, which is a pain, so only hide it for the GL surface
885888 auto cursorTarget = _glWidget;
886889 #endif
@@ -1125,7 +1128,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 238 unmodified lines
11251128 loadSettings();
11261129
11271130 // 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
11291132 // relative to the desktop size for this plugin
11301133 auto offscreenUi = DependencyManager::get<OffscreenUi>();
11311134 offscreenUi->getDesktop()->setProperty("repositionLocked", false);
@@ -1598,7 +1601,7 @@ void Application::checkChangeCursor() { · 466 unmodified lines
15981601 #ifdef Q_OS_MAC
15991602 auto cursorTarget = _window; // OSX doesn't seem to provide for hiding the cursor only on the GL widget
16001603 #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
16021605 // window menu, which is a pain, so only hide it for the GL surface
16031606 auto cursorTarget = _glWidget;
16041607 #endif
@@ -1785,7 +1788,7 @@ Application::~Application() { · 180 unmodified lines
17851788 #endif
17861789 // The window takes ownership of the menu, so this has the side effect of destroying it.
17871790 _window->setMenuBar(nullptr);
1788−
1791+
17891792 _window->deleteLater();
17901793
17911794 // Can't log to file passed this point, FileLogger about to be deleted
@@ -1811,10 +1814,10 @@ void Application::initializeGL() { · 19 unmodified lines
18111814
18121815 _glWidget->makeCurrent();
18131816 gpu::Context::init<gpu::gl::GLBackend>();
1814− qApp->setProperty(hifi::properties::gl::MAKE_PROGRAM_CALLBACK,
1817+ qApp->setProperty(hifi::properties::gl::MAKE_PROGRAM_CALLBACK,
18151818 QVariant::fromValue((void*)(&gpu::gl::GLBackend::makeProgram)));
18161819 _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
18181821 // we need to restore primary rendering context
18191822 _glWidget->makeCurrent();
18201823
@@ -2034,7 +2037,7 @@ void Application::paintGL() { · 213 unmodified lines
20342037 // FIXME not needed anymore?
20352038 _offscreenContext->makeCurrent();
20362039
2037− // If a display plugin loses it's underlying support, it
2040+ // If a display plugin loses it's underlying support, it
20382041 // needs to be able to signal us to not use it
20392042 if (!displayPlugin->beginFrameRender(_frameCount)) {
20402043 _inPaint = false;
@@ -2846,7 +2849,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 805 unmodified lines
28462849 if (isMirrorChecked) {
28472850
28482851 // 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
28502853 // behavior of returning to ThirdPerson
28512854 if (_returnFromFullScreenMirrorTo.isEmpty()) {
28522855 _returnFromFullScreenMirrorTo = MenuOption::ThirdPerson;
@@ -3020,7 +3023,7 @@ void Application::mouseMoveEvent(QMouseEvent* event) { · 167 unmodified lines
30203023 maybeToggleMenuVisible(event);
30213024
30223025 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
30243027 // compositor reticle
30253028 // handleRealMouseMoveEvent() will return true, if we shouldn't process the event further
30263029 if (!compositor.fakeEventActive() && compositor.handleRealMouseMoveEvent()) {
@@ -4109,7 +4112,7 @@ void Application::setKeyboardFocusEntity(EntityItemID entityItemID) { · 1082 unmodified lines
41094112 }
41104113 _lastAcceptedKeyPress = usecTimestampNow();
41114114
4112− setKeyboardFocusHighlight(entity->getPosition(), entity->getRotation(),
4115+ setKeyboardFocusHighlight(entity->getPosition(), entity->getRotation(),
41134116 entity->getDimensions() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR);
41144117 }
41154118 }
@@ -4700,7 +4703,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 584 unmodified lines
47004703 _octreeQuery.setMaxQueryPacketsPerSecond(0);
47014704 }
47024705
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
47044707 // that will cause our next query to be guarenteed to be different and the server will resend to us
47054708 if (forceResend) {
47064709 _octreeQuery.setCameraPosition(glm::vec3(-0.1, -0.1, -0.1));
@@ -5833,7 +5836,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin · 1126 unmodified lines
58335836 mapping = mapping.insert(mapping.lastIndexOf("."), "-" + QString::number(copy));
58345837 addAssetToWorldWithNewMapping(filePath, mapping, copy);
58355838 } else {
5836− QString errorInfo = "Too many copies of asset name: "
5839+ QString errorInfo = "Too many copies of asset name: "
58375840 + mapping.left(mapping.length() - QString::number(copy).length() - 1);
58385841 qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
58395842 addAssetToWorldError(filenameFromPath(filePath), errorInfo);
@@ -5900,7 +5903,7 @@ void Application::addAssetToWorldAddEntity(QString filePath, QString mapping) { · 60 unmodified lines
59005903
59015904 // Note: Model dimensions are not available here; model is scaled per FBX mesh in RenderableModelEntityItem::update() later
59025905 // on. But FBX dimensions may be in cm, so we monitor for the dimension change and rescale again if warranted.
5903−
5906+
59045907 if (entityID == QUuid()) {
59055908 QString errorInfo = "Could not add model " + mapping + " to world.";
59065909 qWarning(interfaceapp) << "Could not add model to world: " + errorInfo;
@@ -6364,7 +6367,7 @@ glm::uvec2 Application::getCanvasSize() const { · 457 unmodified lines
63646367 }
63656368
63666369 QRect Application::getRenderingGeometry() const {
6367− auto geometry = _glWidget->geometry();
6370+ auto geometry = _glWidget->geometry();
63686371 auto topLeft = geometry.topLeft();
63696372 auto topLeftScreen = _glWidget->mapToGlobal(topLeft);
63706373 geometry.moveTopLeft(topLeftScreen);
@@ -6727,8 +6730,8 @@ bool Application::makeRenderingContextCurrent() { · 356 unmodified lines
67276730 return _offscreenContext->makeCurrent();
67286731 }
67296732
6730−bool Application::isForeground() const {
6731− return _isForeground && !_window->isMinimized();
6733+bool Application::isForeground() const {
6734+ return _isForeground && !_window->isMinimized();
67326735 }
67336736
67346737 void Application::sendMousePressOnEntity(QUuid id, PointerEvent event) {