From 4b7779f0f55381a1ea10f1b41eb6688ec7ecab69 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Thu, 3 Aug 2017 07:57:21 -0700 Subject: [PATCH] add flag to outline render flags, fix pal.js/edit.js interaction --- interface/src/Application.cpp | 11 ++++++++--- .../src/RenderableModelEntityItem.cpp | 5 ++++- libraries/render/src/render/Args.h | 3 ++- scripts/system/pal.js | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 571f206cb5..d50348d9b7 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1489,7 +1489,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo properties["atp_mapping_requests"] = atpMappingRequests; properties["throttled"] = _displayPlugin ? _displayPlugin->isThrottled() : false; - + QJsonObject bytesDownloaded; bytesDownloaded["atp"] = statTracker->getStat(STAT_ATP_RESOURCE_TOTAL_BYTES).toInt(); bytesDownloaded["http"] = statTracker->getStat(STAT_HTTP_RESOURCE_TOTAL_BYTES).toInt(); @@ -5420,8 +5420,13 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se //ViveControllerManager::getInstance().updateRendering(renderArgs, _main3DScene, transaction); RenderArgs::OutlineFlags renderOutlineFlags = RenderArgs::RENDER_OUTLINE_NONE; - if (DependencyManager::get()->getIsInMarketplaceInspectionMode()) { - renderOutlineFlags = RenderArgs::RENDER_OUTLINE_WIREFRAMES; + auto contextOverlayInterface = DependencyManager::get(); + if (contextOverlayInterface->getEnabled()) { + if (DependencyManager::get()->getIsInMarketplaceInspectionMode()) { + renderOutlineFlags = RenderArgs::RENDER_OUTLINE_MARKETPLACE_MODE; + } else { + renderOutlineFlags = RenderArgs::RENDER_OUTLINE_WIREFRAMES; + } } renderArgs->_outlineFlags = renderOutlineFlags; } diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index a03360a0e5..911fdf4184 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -372,7 +372,10 @@ void RenderableModelEntityItem::render(RenderArgs* args) { _model->updateRenderItems(); } - bool showingEntityHighlight = ((bool)(args->_outlineFlags & (int)RenderArgs::RENDER_OUTLINE_WIREFRAMES) && getMarketplaceID().length() != 0) || getShouldHighlight(); + // this simple logic should say we set showingEntityHighlight to true whenever we are in marketplace mode and we have a marketplace id, or + // whenever we are not set to none and shouldHighlight is true. + bool showingEntityHighlight = ((bool)(args->_outlineFlags & (int)RenderArgs::RENDER_OUTLINE_MARKETPLACE_MODE) && getMarketplaceID().length() != 0) || + (args->_outlineFlags != RenderArgs::RENDER_OUTLINE_NONE && getShouldHighlight()); if (showingEntityHighlight) { static glm::vec4 yellowColor(1.0f, 1.0f, 0.0f, 1.0f); gpu::Batch& batch = *args->_batch; diff --git a/libraries/render/src/render/Args.h b/libraries/render/src/render/Args.h index f53454cf75..d5b5440c32 100644 --- a/libraries/render/src/render/Args.h +++ b/libraries/render/src/render/Args.h @@ -66,7 +66,8 @@ namespace render { enum OutlineFlags { RENDER_OUTLINE_NONE = 0, RENDER_OUTLINE_WIREFRAMES = 1, - RENDER_OUTLINE_SHADER = 2 + RENDER_OUTLINE_MARKETPLACE_MODE = 2, + RENDER_OUTLINE_SHADER = 4 }; enum DebugFlags { RENDER_DEBUG_NONE = 0, diff --git a/scripts/system/pal.js b/scripts/system/pal.js index 58a54ef859..2a8a89ae7d 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -710,6 +710,7 @@ function off() { Controller.mouseMoveEvent.disconnect(handleMouseMoveEvent); tablet.tabletShownChanged.disconnect(tabletVisibilityChanged); isWired = false; + ContextOverlay.enabled = true } if (audioTimer) { Script.clearInterval(audioTimer); @@ -718,7 +719,6 @@ function off() { triggerPressMapping.disable(); // see above removeOverlays(); Users.requestsDomainListData = false; - ContextOverlay.enabled = true; } function tabletVisibilityChanged() {