Ver Fonte

Moved shgraph.utils.MapUtils to hrt.tool.MapUtils

Clément Espeute há 1 ano atrás
pai
commit
ff716ea1df

+ 1 - 0
hrt/shgraph/NodeGenContext.hx

@@ -3,6 +3,7 @@ package hrt.shgraph;
 using hxsl.Ast;
 using Lambda;
 using hrt.shgraph.Utils;
+using hrt.tools.MapUtils;
 import hrt.shgraph.AstTools.*;
 import hrt.shgraph.ShaderGraph;
 import hrt.shgraph.ShaderNode;

+ 2 - 0
hrt/shgraph/ShaderNodeHxsl.hx

@@ -3,6 +3,8 @@ package hrt.shgraph;
 import hxsl.Ast.TExpr;
 using hxsl.Ast;
 using hrt.shgraph.Utils;
+using hrt.tools.MapUtils;
+
 using Lambda;
 
 typedef CacheEntry = {expr: TExpr, inputs: Array<ShaderNode.InputInfo>, outputs: Array<ShaderNode.OutputInfo>, idInputOrder: Map<Int, Int>, idOutputOrder: Map<Int,Int>};

+ 0 - 11
hrt/shgraph/Utils.hx

@@ -1,16 +1,5 @@
 package hrt.shgraph;
 
-class MapUtils {
-	public static inline function getOrPut<K,V>(map: Map<K,V>, key: K, def: V) : V {
-		var v = map.get(key);
-		if (v == null) {
-			v = def;
-			map.set(key,v);
-		}
-		return v;
-	}
-}
-
 class ArrayUtils {
 	public static inline function getOrPut<V>(array: Array<V>, pos: Int, def: V) : V {
 		var v = array[pos];

+ 12 - 0
hrt/tools/MapUtils.hx

@@ -0,0 +1,12 @@
+package hrt.tools;
+
+class MapUtils {
+	public static inline function getOrPut<K,V>(map: Map<K,V>, key: K, def: V) : V {
+		var v = map.get(key);
+		if (v == null) {
+			v = def;
+			map.set(key,v);
+		}
+		return v;
+	}
+}