From 6695b918eac95efb8a9025b6f36a8aeb9aa96dad Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Wed, 9 May 2012 23:31:06 +0200 Subject: [PATCH] Allow to specify buffer name from parameters in effects --- simgear/scene/material/TextureBuilder.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/simgear/scene/material/TextureBuilder.cxx b/simgear/scene/material/TextureBuilder.cxx index 5ee5836a..a361fee1 100644 --- a/simgear/scene/material/TextureBuilder.cxx +++ b/simgear/scene/material/TextureBuilder.cxx @@ -849,7 +849,11 @@ Texture* GBufferBuilder::build(Effect* effect, Pass* pass, const SGPropertyNode* } else { SG_LOG(SG_INPUT, SG_ALERT, "no texture unit"); } - buffer = prop->getStringValue("name"); + const SGPropertyNode* nameProp = getEffectPropertyChild(effect, prop, + "name"); + if (!nameProp) + return 0; + buffer = nameProp->getStringValue(); pass->setBufferUnit( unit, buffer ); -- 2.39.5