Use $FG_ROOT/Compositor/Effects instead of $FG_ROOT/Effects when the compositor is enabled

This allows coexistence of new compositor-compatible effects and current effects.
This commit is contained in:
Fernando García Liñán 2019-05-20 23:40:12 +02:00
parent 81d1e16d7b
commit b322fa8f32

View File

@ -33,6 +33,7 @@
#include <simgear/debug/logstream.hxx>
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/props/props_io.hxx>
#include <simgear/scene/tgdb/userdata.hxx>
#include <simgear/scene/util/SGSceneFeatures.hxx>
#include <simgear/scene/util/SplicingVisitor.hxx>
#include <simgear/structure/SGExpression.hxx>
@ -126,7 +127,12 @@ Effect* makeEffect(const string& name,
itr->second.valid())
return itr->second.get();
}
string effectFileName(name);
string effectFileName;
// Use getPropertyRoot() because the SGReaderWriterOptions might not have a
// valid property tree
if (getPropertyRoot()->getBoolValue("/sim/version/compositor-support", false))
effectFileName += "Compositor/";
effectFileName += name;
effectFileName += ".eff";
string absFileName
= SGModelLib::findDataFile(effectFileName, options);