2
0
Эх сурвалжийг харах

Fix module resolution for latest haxe (#259)

Rudy Ges 9 сар өмнө
parent
commit
ed882fed62

+ 3 - 3
hide/tools/Macros.hx

@@ -26,11 +26,11 @@ class Macros {
 
 	public static function buildSaveLoad() {
 
-		inline function isSerialized( field : haxe.macro.Field ) : Bool {
+		inline function isSerialized( field : Field ) : Bool {
 			return Lambda.find(field.meta, m -> m.name == ":s") != null;
 		}
 
-		inline function isOpt( field : haxe.macro.Field ) : Bool {
+		inline function isOpt( field : Field ) : Bool {
 			return Lambda.find(field.meta, m -> m.name == ":opt") != null;
 		}
 
@@ -159,4 +159,4 @@ class Macros {
 	}
 	#end
 
-}
+}

+ 2 - 2
hrt/prefab/l3d/ModelLibrary.hx

@@ -140,7 +140,7 @@ class ModelLibrarySignature {
 		return { models : models, textures : textures };
 	}
 
-	static function getMaterialSignature( lib : hxd.fmt.hmd.Library, m : hxd.fmt.hmd.Material ) : MaterialSignature {
+	static function getMaterialSignature( lib : hxd.fmt.hmd.Library, m : hxd.fmt.hmd.Data.Material ) : MaterialSignature {
 		var sig = @:privateAccess new MaterialSignature();
 		var mat = h3d.mat.MaterialSetup.current.createMaterial();
 		mat.name = m.name;
@@ -1287,4 +1287,4 @@ class ModelLibrary extends Prefab {
 
 	static var _ = Prefab.register("modelLib", ModelLibrary);
 
-}
+}

+ 4 - 4
hrt/prefab/pbr/SpecularColor.hx

@@ -42,15 +42,15 @@ class SpecularColor extends Prefab {
 
 	override function updateInstance(?propName : String ) {
 		for( m in getMaterials() ) {
-			var sca = m.mainPass.getShader(hrt.shader.SpecularColorAlbedo);
+			var sca = m.mainPass.getShader(SpecularColorAlbedo);
 			if( sca != null ) {
 				// No params
 			}
-			var scf = m.mainPass.getShader(hrt.shader.SpecularColorFlat);
+			var scf = m.mainPass.getShader(SpecularColorFlat);
 			if( scf != null ) {
 				scf.specularColorValue = h3d.Vector.fromColor(specularColorCustomValue);
 			}
-			var sct = m.mainPass.getShader(hrt.shader.SpecularColorTexture);
+			var sct = m.mainPass.getShader(SpecularColorTexture);
 			if( sct != null ) {
 				sct.specularColorTexture = shared.loadTexture(specularColorPath);
 			}
@@ -144,4 +144,4 @@ class SpecularColor extends Prefab {
 	#end
 
 	static var _ = Prefab.register("specularColor", SpecularColor);
-}
+}

+ 6 - 6
hrt/shgraph/NodeGenContext.hx

@@ -113,11 +113,11 @@ class NodeGenContext {
 	}
 
 	public function getGlobalParam(name: String, type: Type) : TExpr {
-		return makeVar(globalVars.getOrPut(name, {v: {id: hxsl.Tools.allocVarId(), name: name, type: type, kind: Param}, defValue:null, __init__: null}).v);
+		return makeVar(globalVars.getOrPut(name, {v: {id: hxsl.Ast.Tools.allocVarId(), name: name, type: type, kind: Param}, defValue:null, __init__: null}).v);
 	}
 
 	public function setGlobalCustomOutput(name: String, expr: TExpr) : Void {
-		var v = makeVar(globalVars.getOrPut(name, {v: {id: hxsl.Tools.allocVarId(), name: name, type: expr.t, kind: Param}, defValue:null, __init__: null}).v);
+		var v = makeVar(globalVars.getOrPut(name, {v: {id: hxsl.Ast.Tools.allocVarId(), name: name, type: expr.t, kind: Param}, defValue:null, __init__: null}).v);
 		expressions.push(makeAssign(v, expr));
 	}
 
@@ -140,7 +140,7 @@ class NodeGenContext {
 			default:
 		}
 
-		var v : TVar = {id: hxsl.Tools.allocVarId(), name: tvar.name, type: type, kind: tvar.kind, qualifiers: tvar.qualifiers};
+		var v : TVar = {id: hxsl.Ast.Tools.allocVarId(), name: tvar.name, type: type, kind: tvar.kind, qualifiers: tvar.qualifiers};
 		def = {v:v, defValue: null, __init__: null};
 		if (tvar.parent != null) {
 			v.parent = getOrAllocateFromTVar(tvar.parent);
@@ -170,7 +170,7 @@ class NodeGenContext {
 				var fullName = Variables.getFullPath(global);
 				var def : ShaderGraph.ExternVarDef = globalVars.get(fullName);
 				if (def == null) {
-					var v : TVar = {id: hxsl.Tools.allocVarId(), name: global.name, type: global.type, kind: kind};
+					var v : TVar = {id: hxsl.Ast.Tools.allocVarId(), name: global.name, type: global.type, kind: kind};
 					var __init__ = null;
 					if (global.__init__ != null) {
 						__init__ = AstTools.makeAssign(AstTools.makeVar(v), global.__init__);
@@ -180,7 +180,7 @@ class NodeGenContext {
 						var p = Variables.Globals[parent];
 						switch (p.varkind) {
 							case KVar(kind, _, _):
-								v.parent = globalVars.getOrPut(Variables.getFullPath(p), {v : {id : hxsl.Tools.allocVarId(), name: p.name, type: TStruct([]), kind: kind}, defValue: null, __init__: null}).v;
+								v.parent = globalVars.getOrPut(Variables.getFullPath(p), {v : {id : hxsl.Ast.Tools.allocVarId(), name: p.name, type: TStruct([]), kind: kind}, defValue: null, __init__: null}).v;
 							default:
 								throw "Parent var must be a KVar";
 						}
@@ -365,4 +365,4 @@ class NodeGenContext {
 
 	var nodeInputInfo : Array<InputInfo>;
 	var globalVars: Map<String, ShaderGraph.ExternVarDef> = [];
-}
+}

+ 3 - 3
hrt/shgraph/ShaderGraph.hx

@@ -437,7 +437,7 @@ class ShaderGraph extends hrt.prefab.Prefab {
 
 			var funcVar : TVar = {
 				name : functionName,
-				id : hxsl.Tools.allocVarId(),
+				id : Tools.allocVarId(),
 				kind : Function,
 				type : TFun([{ ret : TVoid, args : [] }])
 			};
@@ -522,7 +522,7 @@ class ShaderGraph extends hrt.prefab.Prefab {
 		if (__init__exprs.length != 0) {
 			var funcVar : TVar = {
 				name : "__init__",
-				id : hxsl.Tools.allocVarId(),
+				id : Tools.allocVarId(),
 				kind : Function,
 				type : TFun([{ ret : TVoid, args : [] }])
 			};
@@ -900,4 +900,4 @@ class Graph {
 		return json;
 	}
 
-}
+}

+ 4 - 4
hrt/shgraph/ShaderNodeHxsl.hx

@@ -165,7 +165,7 @@ class ShaderNodeHxsl extends ShaderNode {
 
 							var outputVar : TVar= {
 								name: v.name,
-								id: hxsl.Tools.allocVarId(),
+								id: hxsl.Ast.Tools.allocVarId(),
 								type: t,
 								kind: v.kind,
 								parent: v.parent,
@@ -192,7 +192,7 @@ class ShaderNodeHxsl extends ShaderNode {
 					var tvar = varsRemap.getOrPut(v.id,
 						{
 							name: v.name,
-							id: hxsl.Tools.allocVarId(),
+							id: hxsl.Ast.Tools.allocVarId(),
 							type: v.type,
 							kind: v.kind,
 							parent: v.parent,
@@ -203,7 +203,7 @@ class ShaderNodeHxsl extends ShaderNode {
 					var tvar = varsRemap.getOrPut(v.id,
 						{
 							name: v.name,
-							id: hxsl.Tools.allocVarId(),
+							id: hxsl.Ast.Tools.allocVarId(),
 							type: v.type,
 							kind: v.kind,
 							parent: v.parent,
@@ -252,4 +252,4 @@ class ShaderNodeHxsl extends ShaderNode {
 	function getConstValue(name: String) : Null<Int> {
 		return null;
 	}
-}
+}

+ 3 - 3
hrt/shgraph/ShaderType.hx

@@ -27,7 +27,7 @@ enum SType {
 
 class ShaderType {
 
-	static public function getType(type : SType) : hxsl.Type {
+	static public function getType(type : SType) : hxsl.Ast.Type {
 		switch (type) {
 			case Vec2:
 				return TVec(2, VFloat);
@@ -52,7 +52,7 @@ class ShaderType {
 		return null;
 	}
 
-	static public function getSType(type : hxsl.Type) : SType {
+	static public function getSType(type : hxsl.Ast.Type) : SType {
 		switch (type) {
 			case TVec(2, VFloat):
 				return Vec2;
@@ -110,4 +110,4 @@ class ShaderType {
 		}
 	}
 
-}
+}

+ 3 - 3
hrt/shgraph/nodes/SubGraph.hx

@@ -34,7 +34,7 @@ class SubGraph extends ShaderNode {
 		#else
 		var shader = cast hide.Ide.inst.loadPrefab(pathShaderGraph);
 		#end
-		var graph = shader.getGraph(hrt.shgraph.Domain.Fragment);
+		var graph = shader.getGraph(hrt.shgraph.ShaderGraph.Domain.Fragment);
 
 		var genCtx = new ShaderGraphGenContext(graph, false);
 		var nodeGenCtx = new NodeGenContext.NodeGenContextSubGraph(null);
@@ -56,7 +56,7 @@ class SubGraph extends ShaderNode {
 		#else
 		var shader = cast hide.Ide.inst.loadPrefab(pathShaderGraph);
 		#end
-		var graph = shader.getGraph(hrt.shgraph.Domain.Fragment);
+		var graph = shader.getGraph(hrt.shgraph.ShaderGraph.Domain.Fragment);
 
 		var genCtx = new ShaderGraphGenContext(graph, false);
 		var nodeGenCtx = new NodeGenContext.NodeGenContextSubGraph(null);
@@ -70,4 +70,4 @@ class SubGraph extends ShaderNode {
 		return outputs;
 	}
 
-}
+}