From faaf50446d4a7077db61c07674c0fd1c42745323 Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 21 Apr 2018 13:59:53 +0300 Subject: [PATCH] Option to initially enable NavMesh render --- apps/openmw/mwrender/navmesh.cpp | 4 ++-- apps/openmw/mwrender/navmesh.hpp | 2 +- apps/openmw/mwrender/renderingmanager.cpp | 2 +- files/settings-default.cfg | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwrender/navmesh.cpp b/apps/openmw/mwrender/navmesh.cpp index 0d8cb8867..79ee33b97 100644 --- a/apps/openmw/mwrender/navmesh.cpp +++ b/apps/openmw/mwrender/navmesh.cpp @@ -7,9 +7,9 @@ namespace MWRender { - NavMesh::NavMesh(const osg::ref_ptr& root) + NavMesh::NavMesh(const osg::ref_ptr& root, bool enabled) : mRootNode(root) - , mEnabled(false) + , mEnabled(enabled) , mRevision(0) { } diff --git a/apps/openmw/mwrender/navmesh.hpp b/apps/openmw/mwrender/navmesh.hpp index 5ce98ee7b..a6c1f086e 100644 --- a/apps/openmw/mwrender/navmesh.hpp +++ b/apps/openmw/mwrender/navmesh.hpp @@ -16,7 +16,7 @@ namespace MWRender class NavMesh { public: - NavMesh(const osg::ref_ptr& root); + NavMesh(const osg::ref_ptr& root, bool enabled); ~NavMesh(); bool toggle(); diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index e29f9c7d2..400a2d05c 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -234,7 +234,7 @@ namespace MWRender mRootNode->addChild(mSceneRoot); - mNavMesh.reset(new NavMesh(mRootNode)); + mNavMesh.reset(new NavMesh(mRootNode, Settings::Manager::getBool("enable render", "Navigator"))); mPathgrid.reset(new Pathgrid(mRootNode)); mObjects.reset(new Objects(mResourceSystem, sceneRoot, mUnrefQueue.get())); diff --git a/files/settings-default.cfg b/files/settings-default.cfg index a1ea14678..496cfaf2b 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -614,3 +614,4 @@ recast mesh path prefix = # Write nav mesh file at path with this prefix nav mesh path prefix = +enable render = false