From e7bb8878f3f0a162e89f804e49014615a1894251 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 14:39:48 +0100 Subject: [PATCH] OpenCS: add a mask for particle systems --- apps/opencs/view/render/mask.hpp | 3 +++ apps/opencs/view/render/scenewidget.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/render/mask.hpp b/apps/opencs/view/render/mask.hpp index 9e63cc977..984dccae4 100644 --- a/apps/opencs/view/render/mask.hpp +++ b/apps/opencs/view/render/mask.hpp @@ -17,6 +17,9 @@ namespace CSVRender Mask_Fog = 0x10, Mask_Terrain = 0x20, + // used within models + Mask_ParticleSystem = 0x100, + // control elements Mask_CellMarker = 0x10000, Mask_CellArrow = 0x20000, diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index d06a6b001..d7138b392 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -93,7 +93,7 @@ void RenderWidget::flagAsModified() void RenderWidget::setVisibilityMask(int mask) { - mView->getCamera()->setCullMask(mask); + mView->getCamera()->setCullMask(mask | Mask_ParticleSystem); } bool RenderWidget::eventFilter(QObject* obj, QEvent* event) @@ -167,6 +167,8 @@ SceneWidget::SceneWidget(boost::shared_ptr resourceSys setLighting(&mLightingDay); + mResourceSystem->getSceneManager()->setParticleSystemMask(Mask_ParticleSystem); + /// \todo make shortcut configurable QShortcut *focusToolbar = new QShortcut (Qt::Key_T, this, 0, 0, Qt::WidgetWithChildrenShortcut); connect (focusToolbar, SIGNAL (activated()), this, SIGNAL (focusToolbarRequest()));