Code review

This commit is contained in:
David Rowe 2018-07-20 08:32:21 +12:00
parent 5e624246a8
commit a3e677e64f
6 changed files with 10 additions and 10 deletions

View file

@ -2719,7 +2719,7 @@ void Application::initializeDisplayPlugins() {
[this](const QSize& size) { resizeGL(); }); [this](const QSize& size) { resizeGL(); });
QObject::connect(displayPlugin.get(), &DisplayPlugin::resetSensorsRequested, this, &Application::requestReset); QObject::connect(displayPlugin.get(), &DisplayPlugin::resetSensorsRequested, this, &Application::requestReset);
if (displayPlugin->isHmd()) { if (displayPlugin->isHmd()) {
QObject::connect(dynamic_cast<HmdDisplayPlugin*>(displayPlugin.get()), &HmdDisplayPlugin::isHmdMountedChanged, QObject::connect(dynamic_cast<HmdDisplayPlugin*>(displayPlugin.get()), &HmdDisplayPlugin::hmdMountedChanged,
DependencyManager::get<HMDScriptingInterface>().data(), &HMDScriptingInterface::mountedChanged); DependencyManager::get<HMDScriptingInterface>().data(), &HMDScriptingInterface::mountedChanged);
} }
} }

View file

@ -47,7 +47,7 @@ public:
virtual bool onDisplayTextureReset() override { _clearPreviewFlag = true; return true; }; virtual bool onDisplayTextureReset() override { _clearPreviewFlag = true; return true; };
signals: signals:
void isHmdMountedChanged(); void hmdMountedChanged();
protected: protected:
virtual void hmdPresent() = 0; virtual void hmdPresent() = 0;

View file

@ -36,9 +36,9 @@ bool OculusBaseDisplayPlugin::beginFrameRender(uint32_t frameIndex) {
if (ovr::reorientRequested(status)) { if (ovr::reorientRequested(status)) {
emit resetSensorsRequested(); emit resetSensorsRequested();
} }
if (ovr::hmdMounted(status) != _isHmdMounted) { if (ovr::hmdMounted(status) != _hmdMounted) {
_isHmdMounted = !_isHmdMounted; _hmdMounted = !_hmdMounted;
emit isHmdMountedChanged(); emit hmdMountedChanged();
} }
_currentRenderFrameInfo = FrameInfo(); _currentRenderFrameInfo = FrameInfo();

View file

@ -44,5 +44,5 @@ protected:
ovrLayerEyeFov _sceneLayer; ovrLayerEyeFov _sceneLayer;
ovrViewScaleDesc _viewScaleDesc; ovrViewScaleDesc _viewScaleDesc;
// ovrLayerEyeFovDepth _depthLayer; // ovrLayerEyeFovDepth _depthLayer;
bool _isHmdMounted { false }; bool _hmdMounted { false };
}; };

View file

@ -701,9 +701,9 @@ void OpenVrDisplayPlugin::postPreview() {
_nextRenderPoseData = nextRender; _nextRenderPoseData = nextRender;
} }
if (isHmdMounted() != _isHmdMounted) { if (isHmdMounted() != _hmdMounted) {
_isHmdMounted = !_isHmdMounted; _hmdMounted = !_hmdMounted;
emit isHmdMountedChanged(); emit hmdMountedChanged();
} }
} }

View file

@ -91,5 +91,5 @@ private:
bool _asyncReprojectionActive { false }; bool _asyncReprojectionActive { false };
bool _isHmdMounted { false }; bool _hmdMounted { false };
}; };