GLES2/SHADERS: add search path for loading shaders from source code directory

This commit is contained in:
Pawel Kolodziejski 2014-07-06 09:43:10 +02:00
parent 4888f4368c
commit b08462d1bc

View file

@ -30,9 +30,17 @@ namespace Graphics {
static const GLchar *readFile(const Common::String &filename) {
Common::File file;
// Allow load shaders without install them from source code directory.
// It's used for development purpose
// FIXME: it's doesn't work with just search subdirs in 'engines'
SearchMan.addDirectory("GRIM_SHADERS", "engines/grim", 0, 2);
SearchMan.addDirectory("MYST3_SHADERS", "engines/myst3", 0, 2);
file.open(Common::String("shaders/") + filename);
if (!file.isOpen())
error("Could not open shader %s!", filename.c_str());
SearchMan.remove("GRIM_SHADERS");
SearchMan.remove("MYST3_SHADERS");
const int32 size = file.size();
GLchar *shaderSource = new GLchar[size + 1];