#include <msp/datafile/collection.h>
+#include <msp/io/print.h>
#include <msp/strings/format.h>
#include "error.h"
#include "material.h"
add("uniform_slot", &Loader::uniform_slot2);
}
+// Temporary compatibility feature
+string RenderPass::Loader::get_shader_name(const string &n)
+{
+ if(n.size()>=5 && !n.compare(n.size()-5, 5, ".glsl"))
+ {
+ IO::print(IO::cerr, "Warning: Loading module '%s' as shader is deprecated\n", n);
+ return n+".shader";
+ }
+ return n;
+}
+
void RenderPass::Loader::material_inline()
{
Material::GenericLoader ldr(coll);
void RenderPass::Loader::shader(const string &n)
{
- obj.shprog = &get_collection().get<Program>(n);
+ obj.shprog = &get_collection().get<Program>(get_shader_name(n));
obj.shprog.keep();
obj.shprog_from_material = false;
if(obj.shdata)