mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Check a result of dynamic_cast
This commit is contained in:
parent
f451b09f10
commit
aed0da46a9
@ -39,6 +39,8 @@ namespace MWRender
|
||||
size_t frameId = frame % 2;
|
||||
|
||||
MWRender::PostProcessor* postProcessor = dynamic_cast<MWRender::PostProcessor*>(cv->getCurrentCamera()->getUserData());
|
||||
if (!postProcessor)
|
||||
throw std::runtime_error("PingPongCull: failed to get a PostProcessor!");
|
||||
|
||||
if (Stereo::getStereo())
|
||||
{
|
||||
|
@ -40,6 +40,8 @@ namespace fx
|
||||
if (mUseUBO)
|
||||
{
|
||||
osg::UniformBufferBinding* ubb = dynamic_cast<osg::UniformBufferBinding*>(stateset->getAttribute(osg::StateAttribute::UNIFORMBUFFERBINDING, static_cast<int>(Resource::SceneManager::UBOBinding::PostProcessor)));
|
||||
if (!ubb)
|
||||
throw std::runtime_error("StateUpdater::apply: failed to get an UniformBufferBinding!");
|
||||
|
||||
auto& dest = static_cast<osg::BufferTemplate<UniformData::BufferType>*>(ubb->getBufferData())->getData();
|
||||
mData.copyTo(dest);
|
||||
@ -60,4 +62,4 @@ namespace fx
|
||||
if (mPointLightBuffer)
|
||||
mPointLightBuffer->applyUniforms(nv->getTraversalNumber(), stateset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user