# include <simgear_config.h>
#endif
+#include <simgear/scene/model/SGReaderWriterXMLOptions.hxx>
+#include <simgear/scene/tgdb/userdata.hxx>
+
#include <simgear/math/SGMath.hxx>
#include "EffectBuilder.hxx"
return getEffectPropertyNode(effect, child);
}
+string getGlobalProperty(const SGPropertyNode* prop,
+ const SGReaderWriterXMLOptions* 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->getPropRoot())) {
+ 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();
+}
+
+namespace effect
+{
BuilderException::BuilderException()
{
}
BuilderException::~BuilderException() throw()
{
+
+}
+}
+
+bool isAttributeActive(Effect* effect, const SGPropertyNode* prop)
+{
+ const SGPropertyNode* activeProp
+ = getEffectPropertyChild(effect, prop, "active");
+ return !activeProp || activeProp->getValue<bool>();
+}
+
+namespace effect
+{
+const char* colorFields[] = {"red", "green", "blue", "alpha"};
}
}