Add PhysicsShowOwned back to Menu

This commit is contained in:
Zach Pomerantz 2016-01-26 18:56:22 -08:00
parent 4354eae129
commit e770d7b679
5 changed files with 27 additions and 11 deletions

View file

@ -673,13 +673,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
_offscreenContext->makeCurrent();
initializeGL();
// Start rendering
render::CullFunctor cullFunctor = LODManager::shouldRender;
_renderEngine->addJob<RenderShadowTask>("RenderShadowTask", cullFunctor);
_renderEngine->addJob<RenderDeferredTask>("RenderDeferredTask", cullFunctor);
_renderEngine->registerScene(_main3DScene);
// TODO: Load a cached config file
_offscreenContext->makeCurrent();
// Tell our entity edit sender about our known jurisdictions
@ -1150,9 +1143,17 @@ void Application::initializeGL() {
initDisplay();
qCDebug(interfaceapp, "Initialized Display.");
// Set up the render engine
render::CullFunctor cullFunctor = LODManager::shouldRender;
_renderEngine->addJob<RenderShadowTask>("RenderShadowTask", cullFunctor);
_renderEngine->addJob<RenderDeferredTask>("RenderDeferredTask", cullFunctor);
_renderEngine->registerScene(_main3DScene);
// TODO: Load a cached config file
// The UI can't be created until the primary OpenGL
// context is created, because it needs to share
// texture resources
// Needs to happen AFTER the render engine initialization to access its configuration
initializeUi();
qCDebug(interfaceapp, "Initialized Offscreen UI.");
_offscreenContext->makeCurrent();

View file

@ -32,6 +32,7 @@
#include "devices/Faceshift.h"
#include "input-plugins/SpacemouseManager.h"
#include "MainWindow.h"
#include "render/DrawStatus.h"
#include "scripting/MenuScriptingInterface.h"
#include "ui/AssetUploadDialogFactory.h"
#include "ui/DialogsManager.h"
@ -584,6 +585,11 @@ Menu::Menu() {
// Developer > Physics >>>
MenuWrapper* physicsOptionsMenu = developerMenu->addMenu("Physics");
{
auto drawStatusConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<render::DrawStatus>();
addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowOwned,
0, false, drawStatusConfig, SLOT(setShowNetwork(bool)));
}
addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowHulls);
// Developer > Display Crash Options

View file

@ -245,6 +245,7 @@ namespace MenuOption {
const QString PackageModel = "Package Model...";
const QString Pair = "Pair";
const QString PhysicsShowHulls = "Draw Collision Hulls";
const QString PhysicsShowOwned = "Highlight Simulation Ownership";
const QString PipelineWarnings = "Log Render Pipeline Warnings";
const QString Preferences = "General...";
const QString Quit = "Quit";

View file

@ -27,7 +27,10 @@
using namespace render;
void DrawStatusConfig::dirtyHelper() {
enabled = showNetwork || showDisplay;
emit dirty();
}
const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
if (!_drawItemBoundsPipeline) {

View file

@ -18,15 +18,20 @@
namespace render {
class DrawStatusConfig : public Job::Config {
Q_OBJECT
Q_PROPERTY(bool enabled MEMBER enabled)
Q_PROPERTY(bool showDisplay MEMBER showDisplay NOTIFY dirty)
Q_PROPERTY(bool showNetwork MEMBER showDisplay NOTIFY dirty)
Q_PROPERTY(bool showDisplay MEMBER showDisplay WRITE setShowDisplay)
Q_PROPERTY(bool showNetwork MEMBER showNetwork WRITE setShowNetwork)
public:
DrawStatusConfig() : Job::Config(false) {}
void dirtyHelper();
bool showDisplay{ false };
bool showNetwork{ false };
public slots:
void setShowDisplay(bool enabled) { showDisplay = enabled; dirtyHelper(); }
void setShowNetwork(bool enabled) { showNetwork = enabled; dirtyHelper(); }
signals:
void dirty();
};