# include <simgear_config.h>
#endif
-#include <simgear/scene/model/SGReaderWriterXMLOptions.hxx>
+#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/scene/tgdb/userdata.hxx>
#include <simgear/math/SGMath.hxx>
return getEffectPropertyNode(effect, child);
}
-string getGlobalProperty(const SGPropertyNode* prop)
+string getGlobalProperty(const SGPropertyNode* prop,
+ const SGReaderWriterOptions* options)
{
if (!prop)
return string();
const SGPropertyNode* useProp = prop->getChild("use");
if (!useProp)
return string();
+ string propName = useProp->getStringValue();
+ SGPropertyNode_ptr propRoot;
+ if (propName[0] == '/') {
+ return propName;
+ } else if ((propRoot = options->getPropertyNode())) {
+ string result = propRoot->getPath();
+ result.append("/");
+ result.append(propName);
+ return result;
+ } else {
+ throw effect::
+ BuilderException("No property root to use with relative name "
+ + propName);
+ }
+
return useProp->getStringValue();
}
{
const char* colorFields[] = {"red", "green", "blue", "alpha"};
}
+
+PassAttributeBuilder::~PassAttributeBuilder()
+{
}
+
+} // of namespace simgear
+
+
+
+
+