From: Frederic Bouvier Date: Sat, 14 Apr 2012 16:00:42 +0000 (+0200) Subject: Ensure uniform are there before trying to use them X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=77b8b278ea242f0f606c467201e1cd81f751e9e9;p=simgear.git Ensure uniform are there before trying to use them --- diff --git a/simgear/scene/model/SGLightAnimation.cxx b/simgear/scene/model/SGLightAnimation.cxx index 930d2db2..e2f25d96 100644 --- a/simgear/scene/model/SGLightAnimation.cxx +++ b/simgear/scene/model/SGLightAnimation.cxx @@ -72,11 +72,14 @@ public: BOOST_FOREACH(osg::ref_ptr& pass, technique->passes) { osg::Uniform* amb = pass->getUniform("Ambient"); - amb->set(toOsg(_ambient) * dim); + if (amb) + amb->set(toOsg(_ambient) * dim); osg::Uniform* dif = pass->getUniform("Diffuse"); - dif->set(toOsg(_diffuse) * dim); + if (dif) + dif->set(toOsg(_diffuse) * dim); osg::Uniform* spe = pass->getUniform("Specular"); - spe->set(toOsg(_specular) * dim); + if (spe) + spe->set(toOsg(_specular) * dim); } } }