#include <simgear/scene/material/Pass.hxx>
#include <simgear/scene/util/CopyOp.hxx>
#include <simgear/scene/util/OsgMath.hxx>
+#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <boost/scoped_array.hpp>
#include <boost/foreach.hpp>
-typedef std::map<string, osg::observer_ptr<simgear::Effect> > EffectMap;
+typedef std::map<std::string, osg::observer_ptr<simgear::Effect> > EffectMap;
static EffectMap lightEffectMap;
#define GET_COLOR_VALUE(n) \
SGLightAnimation::SGLightAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
- const string &path, int i) :
- SGAnimation(configNode, modelRoot)
+ const osgDB::Options* options,
+ const std::string &path, int i) :
+ SGAnimation(configNode, modelRoot),
+ _options(options)
{
_light_type = getConfig()->getStringValue("light-type");
_position = SGVec3d( getConfig()->getDoubleValue("position/x"), getConfig()->getDoubleValue("position/y"), getConfig()->getDoubleValue("position/z") );
_cutoff = getConfig()->getDoubleValue("cutoff");
_near = getConfig()->getDoubleValue("near-m");
_far = getConfig()->getDoubleValue("far-m");
- _key = path + ";" + boost::lexical_cast<string>( i );
+ _key = path + ";" + boost::lexical_cast<std::string>( i );
SGConstPropertyNode_ptr dim_factor = configNode->getChild("dim-factor");
if (dim_factor.valid()) {
return;
}
- effect = simgear::makeEffect(effectProp, true);
+ effect = simgear::makeEffect(effectProp, true, dynamic_cast<const simgear::SGReaderWriterOptions*>(_options.get()));
if (iter == lightEffectMap.end() && cacheEffect)
lightEffectMap.insert(EffectMap::value_type(_key, effect));
else if (cacheEffect)