Browse Source

allow #if editor in dynamic shaders

Nicolas Cannasse 4 years ago
parent
commit
e108d105d1
1 changed files with 1 additions and 0 deletions
  1. 1 0
      hide/tools/ShaderLoader.hx

+ 1 - 0
hide/tools/ShaderLoader.hx

@@ -82,6 +82,7 @@ class ShaderLoader {
 
 
 	function loadShaderString( file : String, content : String, name : String ) {
 	function loadShaderString( file : String, content : String, name : String ) {
 		var parser = new hscript.Parser();
 		var parser = new hscript.Parser();
+		parser.preprocesorValues.set("editor", true);
 		var decls = parser.parseModule(content, file);
 		var decls = parser.parseModule(content, file);
 		var cl = null, cf = null;
 		var cl = null, cf = null;
 		for( d in decls ) {
 		for( d in decls ) {