From b322fa8f32255fc12bed3b2ba926a70a9dbf13cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Li=C3=B1=C3=A1n?= Date: Mon, 20 May 2019 23:40:12 +0200 Subject: [PATCH] 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. --- simgear/scene/material/makeEffect.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/simgear/scene/material/makeEffect.cxx b/simgear/scene/material/makeEffect.cxx index cfbb87af..35591c51 100644 --- a/simgear/scene/material/makeEffect.cxx +++ b/simgear/scene/material/makeEffect.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -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);