mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 12:58:00 +03:00
Support max log level for Recast via env variable
Do not write to log if log message level is greater than one speficied in the OPENMW_RECAST_MAX_LOG_LEVEL env variable. Use Error by default.
This commit is contained in:
parent
057c85b710
commit
51258662b5
13 changed files with 68 additions and 35 deletions
|
@ -225,7 +225,8 @@ namespace NavMeshTool
|
|||
Resource::SceneManager sceneManager(&vfs, &imageManager, &nifFileManager, &bgsmFileManager, expiryDelay);
|
||||
Resource::BulletShapeManager bulletShapeManager(&vfs, &sceneManager, &nifFileManager, expiryDelay);
|
||||
DetourNavigator::RecastGlobalAllocator::init();
|
||||
DetourNavigator::Settings navigatorSettings = DetourNavigator::makeSettingsFromSettingsManager();
|
||||
DetourNavigator::Settings navigatorSettings
|
||||
= DetourNavigator::makeSettingsFromSettingsManager(Debug::getRecastMaxLogLevel());
|
||||
navigatorSettings.mRecast.mSwimHeightScale
|
||||
= EsmLoader::getGameSetting(esmData.mGameSettings, "fSwimHeightScale").getFloat();
|
||||
|
||||
|
|
|
@ -847,7 +847,7 @@ void OMW::Engine::prepareEngine()
|
|||
}
|
||||
listener->loadingOff();
|
||||
|
||||
mWorld->init(mViewer, std::move(rootNode), mWorkQueue.get(), *mUnrefQueue);
|
||||
mWorld->init(mMaxRecastLogLevel, mViewer, std::move(rootNode), mWorkQueue.get(), *mUnrefQueue);
|
||||
mEnvironment.setWorldScene(mWorld->getWorldScene());
|
||||
mWorld->setupPlayer();
|
||||
mWorld->setRandomSeed(mRandomSeed);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <filesystem>
|
||||
|
||||
#include <components/compiler/extensions.hpp>
|
||||
#include <components/debug/debuglog.hpp>
|
||||
#include <components/esm/refid.hpp>
|
||||
#include <components/files/collections.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
@ -172,6 +173,7 @@ namespace OMW
|
|||
bool mGrab;
|
||||
|
||||
unsigned int mRandomSeed;
|
||||
Debug::Level mMaxRecastLogLevel = Debug::Error;
|
||||
|
||||
Compiler::Extensions mExtensions;
|
||||
std::unique_ptr<Compiler::Context> mScriptContext;
|
||||
|
@ -180,6 +182,9 @@ namespace OMW
|
|||
Translation::Storage mTranslationDataStorage;
|
||||
bool mNewGame;
|
||||
|
||||
Files::ConfigurationManager& mCfgMgr;
|
||||
int mGlMaxTextureImageUnits;
|
||||
|
||||
// not implemented
|
||||
Engine(const Engine&);
|
||||
Engine& operator=(const Engine&);
|
||||
|
@ -256,9 +261,7 @@ namespace OMW
|
|||
|
||||
void setRandomSeed(unsigned int seed);
|
||||
|
||||
private:
|
||||
Files::ConfigurationManager& mCfgMgr;
|
||||
int mGlMaxTextureImageUnits;
|
||||
void setRecastMaxLogLevel(Debug::Level value) { mMaxRecastLogLevel = value; }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -220,6 +220,8 @@ int runApplication(int argc, char* argv[])
|
|||
Files::ConfigurationManager cfgMgr;
|
||||
std::unique_ptr<OMW::Engine> engine = std::make_unique<OMW::Engine>(cfgMgr);
|
||||
|
||||
engine->setRecastMaxLogLevel(Debug::getRecastMaxLogLevel());
|
||||
|
||||
if (parseOptions(argc, argv, *engine, cfgMgr))
|
||||
{
|
||||
if (!Misc::checkRequiredOSGPluginsArePresent())
|
||||
|
|
|
@ -290,14 +290,14 @@ namespace MWWorld
|
|||
mSwimHeightScale = mStore.get<ESM::GameSetting>().find("fSwimHeightScale")->mValue.getFloat();
|
||||
}
|
||||
|
||||
void World::init(osgViewer::Viewer* viewer, osg::ref_ptr<osg::Group> rootNode, SceneUtil::WorkQueue* workQueue,
|
||||
SceneUtil::UnrefQueue& unrefQueue)
|
||||
void World::init(Debug::Level maxRecastLogLevel, osgViewer::Viewer* viewer, osg::ref_ptr<osg::Group> rootNode,
|
||||
SceneUtil::WorkQueue* workQueue, SceneUtil::UnrefQueue& unrefQueue)
|
||||
{
|
||||
mPhysics = std::make_unique<MWPhysics::PhysicsSystem>(mResourceSystem, rootNode);
|
||||
|
||||
if (Settings::navigator().mEnable)
|
||||
{
|
||||
auto navigatorSettings = DetourNavigator::makeSettingsFromSettingsManager();
|
||||
auto navigatorSettings = DetourNavigator::makeSettingsFromSettingsManager(maxRecastLogLevel);
|
||||
navigatorSettings.mRecast.mSwimHeightScale = mSwimHeightScale;
|
||||
mNavigator = DetourNavigator::makeNavigator(navigatorSettings, mUserDataPath);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <osg/Timer>
|
||||
#include <osg/ref_ptr>
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
#include <components/esm3/readerscache.hpp>
|
||||
#include <components/misc/rng.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
@ -201,8 +202,8 @@ namespace MWWorld
|
|||
Loading::Listener* listener);
|
||||
|
||||
// Must be called after `loadData`.
|
||||
void init(osgViewer::Viewer* viewer, osg::ref_ptr<osg::Group> rootNode, SceneUtil::WorkQueue* workQueue,
|
||||
SceneUtil::UnrefQueue& unrefQueue);
|
||||
void init(Debug::Level maxRecastLogLevel, osgViewer::Viewer* viewer, osg::ref_ptr<osg::Group> rootNode,
|
||||
SceneUtil::WorkQueue* workQueue, SceneUtil::UnrefQueue& unrefQueue);
|
||||
|
||||
virtual ~World();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue