mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-20 07:11:36 +00:00
Check a result of dynamic_cast
This commit is contained in:
parent
f451b09f10
commit
aed0da46a9
2 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue