mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-03 01:20:11 +00:00
Initialize RenderingManager fields before use
PostProcessor is constructed before mNearClip, mViewDistance, mFieldOfView are initialized and the constructor calls updateProjectionMatrix that uses these fields. ==16218== Conditional jump or move depends on uninitialised value(s) ==16218== at 0x722EBE: min<float> (stl_algobase.h:235) ==16218== by 0x722EBE: MWRender::RenderingManager::updateProjectionMatrix() (renderingmanager.cpp:1183) ==16218== by 0x7D022F: MWRender::PostProcessor::PostProcessor(MWRender::RenderingManager&, osgViewer::Viewer*, osg::Group*) (postprocessor.cpp:144) ==16218== by 0x728B41: MWRender::RenderingManager::RenderingManager(osgViewer::Viewer*, osg::ref_ptr<osg::Group>, Resource::ResourceSystem*, SceneUtil::WorkQueue*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DetourNavigator::Navigator&) (renderingmanager.cpp:452) ==16218== by 0xBB5E65: MWWorld::World::World(osgViewer::Viewer*, osg::ref_ptr<osg::Group>, Resource::ResourceSystem*, SceneUtil::WorkQueue*, Files::Collections const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ToUTF8::Utf8Encoder*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (worldimp.cpp:190) ==16218== by 0xDEEA6F: OMW::Engine::prepareEngine(Settings::Manager&) (engine.cpp:789) ==16218== by 0xDF2068: OMW::Engine::go() (engine.cpp:959) ==16218== by 0xDE7B8F: runApplication(int, char**) (main.cpp:220) ==16218== by 0x1006593: wrapApplication(int (*)(int, char**), int, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (debugging.cpp:205) ==16218== by 0x7152C3: main (main.cpp:232) ==16218== ==17455== Conditional jump or move depends on uninitialised value(s) ==17455== at 0x4F8613F: osg::Matrixd::makeFrustum(double, double, double, double, double, double) (Matrix_implementation.cpp:916) ==17455== by 0x4EC0E11: osg::Camera::setProjectionMatrixAsPerspective(double, double, double, double) (Matrixd:580) ==17455== by 0x722DDA: MWRender::RenderingManager::updateProjectionMatrix() (renderingmanager.cpp:1167) ==17455== by 0x7D01EF: MWRender::PostProcessor::PostProcessor(MWRender::RenderingManager&, osgViewer::Viewer*, osg::Group*) (postprocessor.cpp:144) ==17455== by 0x728BA1: MWRender::RenderingManager::RenderingManager(osgViewer::Viewer*, osg::ref_ptr<osg::Group>, Resource::ResourceSystem*, SceneUtil::WorkQueue*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DetourNavigator::Navigator&) (renderingmanager.cpp:453) ==17455== by 0xBB5E25: MWWorld::World::World(osgViewer::Viewer*, osg::ref_ptr<osg::Group>, Resource::ResourceSystem*, SceneUtil::WorkQueue*, Files::Collections const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ToUTF8::Utf8Encoder*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (worldimp.cpp:190) ==17455== by 0xDEEA3F: OMW::Engine::prepareEngine(Settings::Manager&) (engine.cpp:789) ==17455== by 0xDF2038: OMW::Engine::go() (engine.cpp:959) ==17455== by 0xDE7B5F: runApplication(int, char**) (main.cpp:220) ==17455== by 0x1006563: wrapApplication(int (*)(int, char**), int, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (debugging.cpp:205) ==17455== by 0x7152C3: main (main.cpp:232) ==17455==
This commit is contained in:
parent
ac3c02496c
commit
d06e697356
@ -293,8 +293,13 @@ namespace MWRender
|
|||||||
, mNavigator(navigator)
|
, mNavigator(navigator)
|
||||||
, mMinimumAmbientLuminance(0.f)
|
, mMinimumAmbientLuminance(0.f)
|
||||||
, mNightEyeFactor(0.f)
|
, mNightEyeFactor(0.f)
|
||||||
|
// TODO: Near clip should not need to be bounded like this, but too small values break OSG shadow calculations CPU-side.
|
||||||
|
// See issue: #6072
|
||||||
|
, mNearClip(std::max(0.005f, Settings::Manager::getFloat("near clip", "Camera")))
|
||||||
|
, mViewDistance(Settings::Manager::getFloat("viewing distance", "Camera"))
|
||||||
, mFieldOfViewOverridden(false)
|
, mFieldOfViewOverridden(false)
|
||||||
, mFieldOfViewOverride(0.f)
|
, mFieldOfViewOverride(0.f)
|
||||||
|
, mFieldOfView(std::min(std::max(1.f, Settings::Manager::getFloat("field of view", "Camera")), 179.f))
|
||||||
{
|
{
|
||||||
bool reverseZ = SceneUtil::getReverseZ();
|
bool reverseZ = SceneUtil::getReverseZ();
|
||||||
|
|
||||||
@ -515,12 +520,6 @@ namespace MWRender
|
|||||||
NifOsg::Loader::setIntersectionDisabledNodeMask(Mask_Effect);
|
NifOsg::Loader::setIntersectionDisabledNodeMask(Mask_Effect);
|
||||||
Nif::NIFFile::setLoadUnsupportedFiles(Settings::Manager::getBool("load unsupported nif files", "Models"));
|
Nif::NIFFile::setLoadUnsupportedFiles(Settings::Manager::getBool("load unsupported nif files", "Models"));
|
||||||
|
|
||||||
// TODO: Near clip should not need to be bounded like this, but too small values break OSG shadow calculations CPU-side.
|
|
||||||
// See issue: #6072
|
|
||||||
mNearClip = std::max(0.005f, Settings::Manager::getFloat("near clip", "Camera"));
|
|
||||||
mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");
|
|
||||||
float fov = Settings::Manager::getFloat("field of view", "Camera");
|
|
||||||
mFieldOfView = std::min(std::max(1.f, fov), 179.f);
|
|
||||||
float firstPersonFov = Settings::Manager::getFloat("first person field of view", "Camera");
|
float firstPersonFov = Settings::Manager::getFloat("first person field of view", "Camera");
|
||||||
mFirstPersonFieldOfView = std::min(std::max(1.f, firstPersonFov), 179.f);
|
mFirstPersonFieldOfView = std::min(std::max(1.f, firstPersonFov), 179.f);
|
||||||
mStateUpdater->setFogEnd(mViewDistance);
|
mStateUpdater->setFogEnd(mViewDistance);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user